Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 68 additions & 17 deletions physics/GFS_surface_composites.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ end subroutine GFS_surface_composites_pre_finalize
!> \section arg_table_GFS_surface_composites_pre_run Argument Table
!! \htmlinclude GFS_surface_composites_pre_run.html
!!
subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, frac_grid, &
flag_cice, cplflx, cplice, cplwav2atm, landfrac, lakefrac, lakedepth, oceanfrac, frland, &
subroutine GFS_surface_composites_pre_run (im, xlat_d, xlon_d, flag_init, flag_restart, lkm, frac_grid, &
flag_cice, cplflx, cplice, cplwav2atm, lsm, lsm_ruc, &
landfrac, lakefrac, lakedepth, oceanfrac, frland, &
dry, icy, lake, use_flake, wet, hice, cice, zorlo, zorll, zorli, &
snowd, snowd_lnd, snowd_ice, tprcp, tprcp_wat, &
tprcp_lnd, tprcp_ice, uustar, uustar_wat, uustar_lnd, uustar_ice, &
Expand All @@ -40,10 +41,11 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
implicit none

! Interface variables
integer, intent(in ) :: im, lkm, kdt
integer, intent(in ) :: im, lkm, kdt, lsm, lsm_ruc
logical, intent(in ) :: flag_init, flag_restart, frac_grid, cplflx, cplice, cplwav2atm
logical, dimension(:), intent(inout) :: flag_cice
logical, dimension(:), intent(inout) :: dry, icy, lake, use_flake, wet
real(kind=kind_phys), dimension(:), intent(in ) :: xlat_d, xlon_d
real(kind=kind_phys), dimension(:), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac
real(kind=kind_phys), dimension(:), intent(inout) :: cice, hice
real(kind=kind_phys), dimension(:), intent( out) :: frland
Expand Down Expand Up @@ -201,12 +203,17 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
endif
endif
enddo
endif
endif ! frac_grid

do i=1,im
tprcp_wat(i) = tprcp(i)
tprcp_lnd(i) = tprcp(i)
tprcp_ice(i) = tprcp(i)
!if ( (xlon_d(i) > 298.6) .and. (xlon_d(i) < 298.7) .and. &
! (xlat_d(i) > 68.6 ) .and. (xlat_d(i) < 68.7 )) then
! print *,'Composit weasd_ice(i),snowd_ice',kdt,i,xlat_d(i),xlon_d(i),weasd_ice(i),snowd_ice(i)
!endif

if (wet(i)) then ! Water
uustar_wat(i) = uustar(i)
tsfc_wat(i) = tsfco(i)
Expand All @@ -218,7 +225,6 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
endif
if (dry(i)) then ! Land
uustar_lnd(i) = uustar(i)
weasd_lnd(i) = weasd(i)
tsurf_lnd(i) = tsfcl(i)
! DH*
else
Expand All @@ -229,7 +235,6 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
endif
if (icy(i)) then ! Ice
uustar_ice(i) = uustar(i)
weasd_ice(i) = weasd(i)
tsurf_ice(i) = tisfc(i)
ep1d_ice(i) = zero
gflx_ice(i) = zero
Expand All @@ -256,7 +261,9 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
endif
enddo
!
if (.not. cplflx .or. kdt == 1) then
!tgs - cold-start initialization of snow on sea ice and land for a coupled run or
! a run with RUC lsm (that has the ice model)
if (( cplflx .or. lsm == lsm_ruc) .and. (kdt == 1 .and. .not. flag_restart)) then
if (frac_grid) then
do i=1,im
if (dry(i)) then
Expand All @@ -275,6 +282,15 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
enddo
else
do i=1,im
!if ( (xlon_d(i) > 284.35) .and. (xlon_d(i) < 284.6) .and. &
! (xlat_d(i) > 41.0 ) .and. (xlat_d(i) < 41.2 )) then
! print *,'Composit2 weasd_lnd(i),snowd_lnd',kdt,i,xlat_d(i),xlon_d(i),weasd_lnd(i),snowd_lnd(i)
!endif
!if ( (xlon_d(i) > 298.6) .and. (xlon_d(i) < 298.7) .and. &
! (xlat_d(i) > 68.6 ) .and. (xlat_d(i) < 68.7 )) then
! print *,'Composit2 weasd_ice(i),snowd_ice',kdt,i,xlat_d(i),xlon_d(i),weasd_ice(i),snowd_ice(i)
!endif

if (dry(i)) then
snowd_lnd(i) = snowd(i)
weasd_lnd(i) = weasd(i)
Expand All @@ -283,13 +299,27 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, fra
elseif (icy(i)) then
snowd_lnd(i) = zero
weasd_lnd(i) = zero
tem = one / cice(i)
snowd_ice(i) = snowd(i) * tem
weasd_ice(i) = weasd(i) * tem
if(lsm /= lsm_ruc) then
tem = one / cice(i)
snowd_ice(i) = snowd(i) * tem
weasd_ice(i) = weasd(i) * tem
else
snowd_ice(i) = snowd(i)
weasd_ice(i) = weasd(i)
endif
endif
!if ( (xlon_d(i) > 284.35) .and. (xlon_d(i) < 284.6) .and. &
! (xlat_d(i) > 41.0 ) .and. (xlat_d(i) < 41.2 )) then
! print *,'Composit3 weasd_lnd(i),snowd_lnd',kdt,i,xlat_d(i),xlon_d(i),weasd_lnd(i),snowd_lnd(i)
!endif
!if ( (xlon_d(i) > 298.6) .and. (xlon_d(i) < 298.7) .and. &
! (xlat_d(i) > 68.6 ) .and. (xlat_d(i) < 68.7 )) then
! print *,'Composit3 weasd_ice(i),snowd_ice',kdt,i,xlat_d(i),xlon_d(i),weasd_ice(i),snowd_ice(i)
!endif

enddo
endif
endif
endif ! frac_grid
endif ! cold-start

! write(0,*)' minmax of ice snow=',minval(snowd_ice),maxval(snowd_ice)

Expand Down Expand Up @@ -378,6 +408,7 @@ module GFS_surface_composites_post

use machine, only: kind_phys


! For consistent calculations of composite surface properties
use sfc_diff, only: stability

Expand All @@ -402,8 +433,8 @@ end subroutine GFS_surface_composites_post_finalize
!! \htmlinclude GFS_surface_composites_post_run.html
!!
subroutine GFS_surface_composites_post_run ( &
im, kice, km, rd, rvrdm1, cplflx, cplwav2atm, frac_grid, flag_cice, thsfc_loc, islmsk, dry, wet, icy, wind, t1, q1, prsl1, &
landfrac, lakefrac, oceanfrac, zorl, zorlo, zorll, zorli, garea, &
im, kice, km, rd, rvrdm1, cplflx, cplwav2atm, lsm, lsm_ruc, frac_grid, flag_cice, thsfc_loc, islmsk, dry, wet, icy, &
wind, t1, q1, prsl1, landfrac, lakefrac, oceanfrac, zorl, zorlo, zorll, zorli, garea, &
cd, cd_wat, cd_lnd, cd_ice, cdq, cdq_wat, cdq_lnd, cdq_ice, rb, rb_wat, rb_lnd, rb_ice, stress, stress_wat, stress_lnd, &
stress_ice, ffmm, ffmm_wat, ffmm_lnd, ffmm_ice, ffhh, ffhh_wat, ffhh_lnd, ffhh_ice, uustar, uustar_wat, uustar_lnd, &
uustar_ice, fm10, fm10_wat, fm10_lnd, fm10_ice, fh2, fh2_wat, fh2_lnd, fh2_ice, tsurf_wat, tsurf_lnd, tsurf_ice, &
Expand All @@ -417,7 +448,7 @@ subroutine GFS_surface_composites_post_run (

implicit none

integer, intent(in) :: im, kice, km
integer, intent(in) :: im, kice, km, lsm, lsm_ruc
logical, intent(in) :: cplflx, frac_grid, cplwav2atm
logical, intent(in) :: lheatstrg
logical, dimension(:), intent(in) :: flag_cice, dry, wet, icy
Expand Down Expand Up @@ -544,6 +575,8 @@ subroutine GFS_surface_composites_post_run (
cdq(i) = cdq_lnd(i)
stress(i) = stress_lnd(i)
uustar(i) = uustar_lnd(i)
weasd(i) = weasd_lnd(i)
snowd(i) = snowd_lnd(i)
elseif(txo == one) then ! 100% open water
rb(i) = rb_wat(i)
ffmm(i) = ffmm_wat(i)
Expand All @@ -554,6 +587,8 @@ subroutine GFS_surface_composites_post_run (
cdq(i) = cdq_wat(i)
stress(i) = stress_wat(i)
uustar(i) = uustar_wat(i)
weasd(i) = zero
snowd(i) = zero
elseif(txi == one) then ! 100% ice
rb(i) = rb_ice(i)
ffmm(i) = ffmm_ice(i)
Expand All @@ -564,6 +599,14 @@ subroutine GFS_surface_composites_post_run (
cdq(i) = cdq_ice(i)
stress(i) = stress_ice(i)
uustar(i) = uustar_ice(i)
if(lsm /= lsm_ruc) then
weasd(i) = weasd_ice(i) * cice(i)
snowd(i) = snowd_ice(i) * cice(i)
else
weasd(i) = weasd_ice(i)
snowd(i) = snowd_ice(i)
endif

else ! Mix of multiple surface types (land, water, and/or ice)
!
! re-compute zvfun with composite surface roughness & green vegetation fraction
Expand Down Expand Up @@ -644,6 +687,7 @@ subroutine GFS_surface_composites_post_run (

do i=1,im
if (islmsk(i) == 1) then
!-- land
zorl(i) = zorll(i)
cd(i) = cd_lnd(i)
cdq(i) = cdq_lnd(i)
Expand All @@ -669,6 +713,7 @@ subroutine GFS_surface_composites_post_run (
hice(i) = zero
cice(i) = zero
elseif (islmsk(i) == 0) then
!-- water
zorl(i) = zorlo(i)
cd(i) = cd_wat(i)
cdq(i) = cdq_wat(i)
Expand All @@ -695,6 +740,7 @@ subroutine GFS_surface_composites_post_run (
hice(i) = zero
cice(i) = zero
else ! islmsk(i) == 2
!-- ice
zorl(i) = zorli(i)
cd(i) = cd_ice(i)
cdq(i) = cdq_ice(i)
Expand All @@ -709,8 +755,13 @@ subroutine GFS_surface_composites_post_run (
chh(i) = chh_ice(i)
gflx(i) = gflx_ice(i)
ep1d(i) = ep1d_ice(i)
weasd(i) = weasd_ice(i) * cice(i)
snowd(i) = snowd_ice(i) * cice(i)
if(lsm /= lsm_ruc) then
weasd(i) = weasd_ice(i) * cice(i)
snowd(i) = snowd_ice(i) * cice(i)
else
weasd(i) = weasd_ice(i)
snowd(i) = snowd_ice(i)
endif
qss(i) = qss_ice(i)
evap(i) = evap_ice(i)
hflx(i) = hflx_ice(i)
Expand Down
44 changes: 44 additions & 0 deletions physics/GFS_surface_composites.meta
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
dimensions = ()
type = integer
intent = in
[xlat_d]
standard_name = latitude_in_degree
long_name = latitude in degree north
units = degree_north
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[xlon_d]
standard_name = longitude_in_degree
long_name = longitude in degree east
units = degree_east
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[flag_init]
standard_name = flag_for_first_timestep
long_name = flag signaling first time step for time integration loop
Expand Down Expand Up @@ -70,6 +86,20 @@
dimensions = ()
type = logical
intent = in
[lsm]
standard_name = control_for_land_surface_scheme
long_name = flag for land surface model
units = flag
dimensions = ()
type = integer
intent = in
[lsm_ruc]
standard_name = identifier_for_ruc_land_surface_scheme
long_name = flag for RUC land surface model
units = flag
dimensions = ()
type = integer
intent = in
[landfrac]
standard_name = land_area_fraction
long_name = fraction of horizontal grid area occupied by land
Expand Down Expand Up @@ -762,6 +792,20 @@
type = real
kind = kind_phys
intent = in
[lsm]
standard_name = control_for_land_surface_scheme
long_name = flag for land surface model
units = flag
dimensions = ()
type = integer
intent = in
[lsm_ruc]
standard_name = identifier_for_ruc_land_surface_scheme
long_name = flag for RUC land surface model
units = flag
dimensions = ()
type = integer
intent = in
[landfrac]
standard_name = land_area_fraction
long_name = fraction of horizontal grid area occupied by land
Expand Down
2 changes: 1 addition & 1 deletion physics/module_sf_mynn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ MODULE module_sf_mynn
!1: check input
!2: everything - heavy I/O
LOGICAL, PARAMETER :: compute_diag = .false.
LOGICAL, PARAMETER :: compute_flux = .false. !shouldn't need compute
LOGICAL, PARAMETER :: compute_flux = .true. !shouldn't need compute
! these in FV3. They will be written over anyway.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is OK for now. In the near future, this flag will have to made into a namelist option.

! Computing the fluxes here is leftover from the WRF world.

Expand Down