Skip to content

Commit 7f7a407

Browse files
authored
Merge pull request NCAR#1144 from grantfirl/ufs-dev-PR278
UFS-dev PR#278
2 parents c3160d4 + ff1f277 commit 7f7a407

5 files changed

Lines changed: 150 additions & 57 deletions

File tree

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,14 +702,16 @@ end subroutine GFS_phys_time_vary_init
702702
!>\section gen_GFS_phys_time_vary_timestep_init GFS_phys_time_vary_timestep_init General Algorithm
703703
!> @{
704704
subroutine GFS_phys_time_vary_timestep_init ( &
705-
me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, idate, nsswr, fhswr, lsswr, fhour, &
705+
me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, idate, cplflx, &
706+
nsswr, fhswr, lsswr, fhour, &
706707
imfdeepcnv, cal_pre, random_clds, nscyc, ntoz, h2o_phys, iaerclm, iccn, clstp, &
707708
jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, iflip, &
708709
jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, &
709710
jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, fn_nml, &
710711
imap, jmap, prsl, seed0, rann, nthrds, nx, ny, nsst, tile_num, nlunit, lsoil, lsoil_lsm,&
711712
kice, ialb, isot, ivegsrc, input_nml_file, use_ufo, nst_anl, frac_grid, fhcyc, phour, &
712-
lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, &
713+
oceanfrac, lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, &
714+
tg3, tref, &
713715
tsfc, tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, zorli, zorll, &
714716
zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype,scolor, shdmin, shdmax, snowd, &
715717
cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, landfrac, ozphys, h2ophys, &
@@ -723,7 +725,7 @@ subroutine GFS_phys_time_vary_timestep_init (
723725
nsswr, imfdeepcnv, iccn, nscyc, ntoz, iflip
724726
integer, intent(in) :: idate(:)
725727
real(kind_phys), intent(in) :: fhswr, fhour
726-
logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm
728+
logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm, cplflx
727729
real(kind_phys), intent(out) :: clstp
728730
integer, intent(in), optional :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:)
729731
real(kind_phys), intent(in), optional :: ddy_o3(:), ddy_h(:)
@@ -753,7 +755,7 @@ subroutine GFS_phys_time_vary_timestep_init (
753755
character(len=*), intent(in) :: fn_nml
754756
logical, intent(in) :: use_ufo, nst_anl, frac_grid
755757
real(kind_phys), intent(in) :: fhcyc, phour, lakefrac(:), min_seaice, min_lakeice, &
756-
xlat_d(:), xlon_d(:), landfrac(:)
758+
xlat_d(:), xlon_d(:), landfrac(:),oceanfrac(:)
757759
real(kind_phys), intent(inout) :: smc(:,:), slc(:,:), stc(:,:), tiice(:,:), tg3(:), &
758760
tsfc(:), tsfco(:), tisfc(:), hice(:), fice(:), &
759761
facsf(:), facwf(:), alvsf(:), alvwf(:), alnsf(:), alnwf(:), &
@@ -926,6 +928,7 @@ subroutine GFS_phys_time_vary_timestep_init (
926928
tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, &
927929
zorli, zorll, zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, &
928930
stype, scolor, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, &
931+
cplflx, oceanfrac, &
929932
xlat_d, xlon_d, slmsk, imap, jmap, errmsg, errflg)
930933
endif
931934
endif

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,13 @@
11731173
dimensions = (4)
11741174
type = integer
11751175
intent = in
1176+
[cplflx]
1177+
standard_name = flag_for_surface_flux_coupling
1178+
long_name = flag controlling cplflx collection (default off)
1179+
units = flag
1180+
dimensions = ()
1181+
type = logical
1182+
intent = in
11761183
[nsswr]
11771184
standard_name = number_of_timesteps_between_shortwave_radiation_calls
11781185
long_name = number of timesteps between shortwave radiation calls
@@ -1638,6 +1645,14 @@
16381645
type = real
16391646
kind = kind_phys
16401647
intent = in
1648+
[oceanfrac]
1649+
standard_name = sea_area_fraction
1650+
long_name = fraction of horizontal grid area occupied by ocean
1651+
units = frac
1652+
dimensions = (horizontal_dimension)
1653+
type = real
1654+
kind = kind_phys
1655+
intent = in
16411656
[lakefrac]
16421657
standard_name = lake_area_fraction
16431658
long_name = fraction of horizontal grid area occupied by lake

physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml,
2222
tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, &
2323
zorli, zorll, zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, &
2424
stype, scolor, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, &
25+
cplflx, oceanfrac, &
2526
xlat_d, xlon_d, slmsk, imap, jmap, errmsg, errflg)
2627
!
2728
!
@@ -33,9 +34,9 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml,
3334
integer, intent(in) :: idate(:), ialb, isot, ivegsrc
3435
character(len = 64), intent(in) :: fn_nml
3536
character(len=*), intent(in) :: input_nml_file(:)
36-
logical, intent(in) :: use_ufo, nst_anl, frac_grid
37+
logical, intent(in) :: use_ufo, nst_anl, frac_grid, cplflx
3738
real(kind=kind_phys), intent(in) :: fhcyc, phour, landfrac(:), lakefrac(:), &
38-
min_seaice, min_lakeice, &
39+
min_seaice, min_lakeice,oceanfrac(:), &
3940
xlat_d(:), xlon_d(:)
4041
real(kind=kind_phys), intent(inout), optional :: &
4142
smois(:,:), &
@@ -103,6 +104,17 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml,
103104
STCFC1 (nx*ny*max(lsoil,lsoil_lsm)), &
104105
SLCFC1 (nx*ny*max(lsoil,lsoil_lsm))
105106

107+
!
108+
! declare the variables (arrays) for cplflx, surface type dependent gcycle changes
109+
!
110+
real(kind=kind_io8) :: &
111+
hice_save (nx*ny), & ! sea or lake ice thickness
112+
fice_save (nx*ny), & ! sea or lake ice fraction
113+
snowd_save (nx*ny), & ! water equivalent snow depth
114+
snoalb_save (nx*ny), & ! maximum snow albedo
115+
tisfc_save (nx*ny), & ! surface skin temperature over (sea or lake) ice
116+
weasd_save (nx*ny) ! water equiv of acc snow depth over land and (sea or lake) ice
117+
106118

107119
real (kind=kind_io8) :: min_ice(nx*ny)
108120
integer :: i_indx(nx*ny), j_indx(nx*ny)
@@ -131,11 +143,25 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml,
131143
sig1t = 0.0_kind_phys
132144
npts = nx*ny
133145
!
146+
! Some surface variables need to be updated by gcycle with coupled mode, and nsst mode dependent. A few variables are saved
147+
! in order to be able to update them over the specific surface types only after call sfccycle
148+
!
149+
if ( cplflx ) then
150+
hice_save = hice
151+
fice_save = fice
152+
snowd_save = snowd
153+
snoalb_save = snoalb
154+
tisfc_save = tisfc
155+
weasd_save = weasd
156+
endif
157+
134158
if ( nsst > 0 ) then
135159
TSFFCS = tref
136160
else
137161
TSFFCS = tsfco
138-
end if
162+
endif
163+
164+
139165
! integer to real/double precision
140166
slpfcs = real(slope)
141167
vegfcs = real(vtype)
@@ -251,11 +277,45 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml,
251277
close (nlunit)
252278
#endif
253279
!
254-
if ( nsst > 0 ) then
255-
tref = TSFFCS
280+
! The gcycle resulted change is applied to some variables in the way of the coupled mode dependent, water surface type (ocean or lake)
281+
! dependent and nsst mode dependent
282+
!
283+
if ( cplflx ) then
284+
! In coupled mode, keep these variables the same as is (before sfccycle is called) over ocean
285+
do ix=1,npts
286+
if ( oceanfrac(ix) > 0.0_kind_phys ) then
287+
hice(ix) = hice_save(ix)
288+
fice(ix) = fice_save(ix)
289+
snowd(ix) = snowd_save(ix)
290+
snoalb(ix) = snoalb_save(ix)
291+
tisfc(ix) = tisfc_save(ix)
292+
weasd(ix) = weasd_save(ix)
293+
endif
294+
enddo
295+
! In the coupled mode and when NSST is on, update tref over non-ocean
296+
if ( nsst > 0 ) then
297+
do ix=1,npts
298+
if ( oceanfrac(ix) == 0.0_kind_phys ) then
299+
tref(ix) = TSFFCS(ix)
300+
endif
301+
enddo
302+
! In the coupled mode and when NSST is off, update tsfc and tsfco over non-ocean
303+
else
304+
do ix=1,npts
305+
if ( oceanfrac(ix) == 0.0_kind_phys ) then
306+
tsfc(ix) = TSFFCS(ix)
307+
tsfco(ix) = TSFFCS(ix)
308+
endif
309+
enddo
310+
endif
311+
! The same as before (this modification) in uncoupled mode
256312
else
257-
tsfc = TSFFCS
258-
tsfco = TSFFCS
313+
if ( nsst > 0 ) then
314+
tref = TSFFCS
315+
else
316+
tsfc = TSFFCS
317+
tsfco = TSFFCS
318+
endif
259319
endif
260320
!
261321
! real/double precision to integer

physics/SFC_Models/Land/Noahmp/module_sf_noahmp_glacier.F90

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,15 +2632,24 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in
26322632
snliq ,imelt ,ficeold, & !in
26332633
isnow ,dzsnso ) !inout
26342634

2635+
if(isnow < 0) & !when multi-layer
26352636
call combine_glacier (nsnow ,nsoil , & !in
26362637
isnow ,sh2o ,stc ,snice ,snliq , & !inout
26372638
dzsnso ,sice ,snowh ,sneqv , & !inout
26382639
ponding1 ,ponding2) !out
26392640

2641+
if(isnow < 0) & !when multi-layer
26402642
call divide_glacier (nsnow ,nsoil , & !in
26412643
isnow ,stc ,snice ,snliq ,dzsnso ) !inout
26422644
end if
26432645

2646+
call snowh2o_glacier (nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in
2647+
qrain , & !in
2648+
isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout
2649+
snliq ,sh2o ,sice ,stc , & !inout
2650+
ponding1 ,ponding2 ,fsh , & !inout
2651+
qsnbot ) !out
2652+
26442653
!set empty snow layers to zero
26452654

26462655
do iz = -nsnow+1, isnow
@@ -2651,16 +2660,9 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in
26512660
zsnso(iz) = 0.
26522661
enddo
26532662

2654-
call snowh2o_glacier (nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in
2655-
qrain , & !in
2656-
isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout
2657-
snliq ,sh2o ,sice ,stc , & !inout
2658-
ponding1 ,ponding2 ,fsh , & !inout
2659-
qsnbot ) !out
2660-
26612663
!to obtain equilibrium state of snow in glacier region
26622664

2663-
if(sneqv > mwd .and. isnow /= 0) then ! 100 mm -> maximum water depth
2665+
if(sneqv > mwd) then ! 100 mm -> maximum water depth
26642666
bdsnow = snice(0) / dzsnso(0)
26652667
snoflow = (sneqv - mwd)
26662668
snice(0) = snice(0) - snoflow
@@ -2670,7 +2672,7 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in
26702672

26712673
! sum up snow mass for layered snow
26722674

2673-
if(isnow /= 0) then
2675+
if(isnow < 0) then
26742676
sneqv = 0.
26752677
snowh = 0.
26762678
do iz = isnow+1,0
@@ -2746,7 +2748,7 @@ subroutine snowfall_glacier (nsoil ,nsnow ,dt ,qsnow ,snowhin , & !in
27462748

27472749
! creating a new layer
27482750

2749-
if(isnow == 0 .and. qsnow>0. .and. snowh >= 0.05) then
2751+
if(isnow == 0 .and. qsnow>0. .and. snowh >= 0.025) then
27502752
isnow = -1
27512753
newnode = 1
27522754
dzsnso(0)= snowh
@@ -2904,8 +2906,8 @@ subroutine combine_glacier (nsnow ,nsoil , & !in
29042906
real (kind=kind_phys) :: zwice !< total ice mass in snow
29052907
real (kind=kind_phys) :: zwliq !< total liquid water in snow
29062908
real (kind=kind_phys) :: dzmin(3) !< minimum of top snow layer
2907-
data dzmin /0.045, 0.05, 0.2/
2908-
! data dzmin /0.025, 0.025, 0.1/ ! mb: change limit
2909+
! data dzmin /0.045, 0.05, 0.2/
2910+
data dzmin /0.025, 0.025, 0.1/ ! mb: change limit
29092911
!-----------------------------------------------------------------------
29102912

29112913
isnow_old = isnow
@@ -2915,17 +2917,29 @@ subroutine combine_glacier (nsnow ,nsoil , & !in
29152917
if(j /= 0) then
29162918
snliq(j+1) = snliq(j+1) + snliq(j)
29172919
snice(j+1) = snice(j+1) + snice(j)
2920+
dzsnso(j+1) = dzsnso(j+1) + dzsnso(j)
29182921
else
29192922
if (isnow_old < -1) then
29202923
snliq(j-1) = snliq(j-1) + snliq(j)
29212924
snice(j-1) = snice(j-1) + snice(j)
2925+
dzsnso(j-1) = dzsnso(j-1) + dzsnso(j)
29222926
else
2923-
ponding1 = ponding1 + snliq(j) ! isnow will get set to zero below
2924-
sneqv = snice(j) ! ponding will get added to ponding from
2925-
snowh = dzsnso(j) ! phasechange which should be zero here
2926-
snliq(j) = 0.0 ! because there it was only calculated
2927-
snice(j) = 0.0 ! for thin snow
2928-
dzsnso(j) = 0.0
2927+
if(snice(j) >= 0.) then
2928+
ponding1 = snliq(j) ! isnow will get set to zero below; ponding1 will get
2929+
sneqv = snice(j) ! added to ponding from phasechange ponding should be
2930+
snowh = dzsnso(j) ! zero here because it was calculated for thin snow
2931+
else ! snice over-sublimated earlier
2932+
ponding1 = snliq(j) + snice(j)
2933+
if(ponding1 < 0.) then ! if snice and snliq sublimates remove from soil
2934+
sice(1) = max(0.0,sice(1)+ponding1/(dzsnso(1)*1000.))
2935+
ponding1 = 0.0
2936+
end if
2937+
sneqv = 0.0
2938+
snowh = 0.0
2939+
end if
2940+
snliq(j) = 0.0
2941+
snice(j) = 0.0
2942+
dzsnso(j) = 0.0
29292943
endif
29302944
! sh2o(1) = sh2o(1)+snliq(j)/(dzsnso(1)*1000.)
29312945
! sice(1) = sice(1)+snice(j)/(dzsnso(1)*1000.)
@@ -2968,8 +2982,8 @@ subroutine combine_glacier (nsnow ,nsoil , & !in
29682982
! check the snow depth - all snow gone
29692983
! the liquid water assumes ponding on soil surface.
29702984

2971-
! if (snowh < 0.025 .and. isnow < 0 ) then ! mb: change limit
2972-
if (snowh < 0.05 .and. isnow < 0 ) then
2985+
if (snowh < 0.025 .and. isnow < 0 ) then ! mb: change limit
2986+
! if (snowh < 0.05 .and. isnow < 0 ) then
29732987
isnow = 0
29742988
sneqv = zwice
29752989
ponding2 = ponding2 + zwliq ! limit of isnow < 0 means input ponding
@@ -3167,8 +3181,8 @@ subroutine divide_glacier (nsnow ,nsoil , & !in
31673181
zwliq, zwice, tsno(1))
31683182

31693183
! subdivide a new layer
3170-
! if (msno <= 2 .and. dz(2) > 0.20) then ! mb: change limit
3171-
if (msno <= 2 .and. dz(2) > 0.10) then
3184+
if (msno <= 2 .and. dz(2) > 0.20) then ! mb: change limit
3185+
! if (msno <= 2 .and. dz(2) > 0.10) then
31723186
msno = 3
31733187
dtdz = (tsno(1) - tsno(2))/((dz(1)+dz(2))/2.)
31743188
dz(2) = dz(2)/2.
@@ -3295,6 +3309,7 @@ subroutine snowh2o_glacier (nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in
32953309
sneqv = sneqv - qsnsub*dt + qsnfro*dt
32963310
propor = sneqv/temp
32973311
snowh = max(0.,propor * snowh)
3312+
snowh = min(max(snowh,sneqv/500.0),sneqv/50.0) ! limit adjustment to a reasonable density
32983313
elseif(opt_gla == 2) then
32993314
fsh = fsh - (qsnfro-qsnsub)*hsub
33003315
qsnfro = 0.0

physics/SFC_Models/Land/Noahmp/noahmpdrv.F90

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,34 +1207,34 @@ subroutine noahmpdrv_run &
12071207
!
12081208

12091209
snow_cover_fraction = 1.0
1210-
temperature_leaf = undefined
1211-
canopy_ice = undefined
1212-
canopy_liquid = undefined
1213-
vapor_pres_canopy_air = undefined
1214-
temperature_canopy_air = undefined
1215-
canopy_wet_fraction = undefined
1216-
lake_water = undefined
1217-
depth_water_table = undefined
1218-
aquifer_water = undefined
1219-
saturated_water = undefined
1220-
leaf_carbon = undefined
1221-
root_carbon = undefined
1222-
stem_carbon = undefined
1223-
wood_carbon = undefined
1224-
soil_carbon_stable = undefined
1225-
soil_carbon_fast = undefined
1226-
leaf_area_index = undefined
1227-
stem_area_index = undefined
1228-
evaporation_canopy = undefined
1229-
transpiration = undefined
1230-
aquifer_water = undefined
1231-
precip_adv_heat_total = undefined
1210+
temperature_leaf = temperature_radiative
1211+
canopy_ice = 0.0
1212+
canopy_liquid = 0.0
1213+
vapor_pres_canopy_air = 2000.0
1214+
temperature_canopy_air = temperature_radiative
1215+
canopy_wet_fraction = 0.0
1216+
lake_water = 0.0
1217+
depth_water_table = 0.0
1218+
aquifer_water = 0.0
1219+
saturated_water = 0.0
1220+
leaf_carbon = 0.0
1221+
root_carbon = 0.0
1222+
stem_carbon = 0.0
1223+
wood_carbon = 0.0
1224+
soil_carbon_stable = 0.0
1225+
soil_carbon_fast = 0.0
1226+
leaf_area_index = 0.0
1227+
stem_area_index = 0.0
1228+
evaporation_canopy = 0.0
1229+
transpiration = 0.0
1230+
aquifer_water = 0.0
1231+
precip_adv_heat_total = 0.0
12321232
soil_moisture_wtd = 0.0
12331233
recharge = 0.0
12341234
deep_recharge = 0.0
12351235
eq_soil_water_vol = soil_moisture_vol
1236-
transpiration_heat = undefined
1237-
latent_heat_canopy = undefined
1236+
transpiration_heat = 0.0
1237+
latent_heat_canopy = 0.0
12381238
z0_total = 0.002
12391239
latent_heat_total = latent_heat_ground
12401240
t2mmp(i) = temperature_bare_2m

0 commit comments

Comments
 (0)