Skip to content

Commit f8f1086

Browse files
committed
Merge remote-tracking branch 'upstream/ufs/dev' into ogwd
2 parents ef97ca0 + ad5a241 commit f8f1086

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
@@ -2630,15 +2630,24 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in
26302630
snliq ,imelt ,ficeold, & !in
26312631
isnow ,dzsnso ) !inout
26322632

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

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

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

26442653
do iz = -nsnow+1, isnow
@@ -2649,16 +2658,9 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in
26492658
zsnso(iz) = 0.
26502659
enddo
26512660

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

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

26692671
! sum up snow mass for layered snow
26702672

2671-
if(isnow /= 0) then
2673+
if(isnow < 0) then
26722674
sneqv = 0.
26732675
snowh = 0.
26742676
do iz = isnow+1,0
@@ -2744,7 +2746,7 @@ subroutine snowfall_glacier (nsoil ,nsnow ,dt ,qsnow ,snowhin , & !in
27442746

27452747
! creating a new layer
27462748

2747-
if(isnow == 0 .and. qsnow>0. .and. snowh >= 0.05) then
2749+
if(isnow == 0 .and. qsnow>0. .and. snowh >= 0.025) then
27482750
isnow = -1
27492751
newnode = 1
27502752
dzsnso(0)= snowh
@@ -2902,8 +2904,8 @@ subroutine combine_glacier (nsnow ,nsoil , & !in
29022904
real (kind=kind_phys) :: zwice !< total ice mass in snow
29032905
real (kind=kind_phys) :: zwliq !< total liquid water in snow
29042906
real (kind=kind_phys) :: dzmin(3) !< minimum of top snow layer
2905-
data dzmin /0.045, 0.05, 0.2/
2906-
! data dzmin /0.025, 0.025, 0.1/ ! mb: change limit
2907+
! data dzmin /0.045, 0.05, 0.2/
2908+
data dzmin /0.025, 0.025, 0.1/ ! mb: change limit
29072909
!-----------------------------------------------------------------------
29082910

29092911
isnow_old = isnow
@@ -2913,17 +2915,29 @@ subroutine combine_glacier (nsnow ,nsoil , & !in
29132915
if(j /= 0) then
29142916
snliq(j+1) = snliq(j+1) + snliq(j)
29152917
snice(j+1) = snice(j+1) + snice(j)
2918+
dzsnso(j+1) = dzsnso(j+1) + dzsnso(j)
29162919
else
29172920
if (isnow_old < -1) then
29182921
snliq(j-1) = snliq(j-1) + snliq(j)
29192922
snice(j-1) = snice(j-1) + snice(j)
2923+
dzsnso(j-1) = dzsnso(j-1) + dzsnso(j)
29202924
else
2921-
ponding1 = ponding1 + snliq(j) ! isnow will get set to zero below
2922-
sneqv = snice(j) ! ponding will get added to ponding from
2923-
snowh = dzsnso(j) ! phasechange which should be zero here
2924-
snliq(j) = 0.0 ! because there it was only calculated
2925-
snice(j) = 0.0 ! for thin snow
2926-
dzsnso(j) = 0.0
2925+
if(snice(j) >= 0.) then
2926+
ponding1 = snliq(j) ! isnow will get set to zero below; ponding1 will get
2927+
sneqv = snice(j) ! added to ponding from phasechange ponding should be
2928+
snowh = dzsnso(j) ! zero here because it was calculated for thin snow
2929+
else ! snice over-sublimated earlier
2930+
ponding1 = snliq(j) + snice(j)
2931+
if(ponding1 < 0.) then ! if snice and snliq sublimates remove from soil
2932+
sice(1) = max(0.0,sice(1)+ponding1/(dzsnso(1)*1000.))
2933+
ponding1 = 0.0
2934+
end if
2935+
sneqv = 0.0
2936+
snowh = 0.0
2937+
end if
2938+
snliq(j) = 0.0
2939+
snice(j) = 0.0
2940+
dzsnso(j) = 0.0
29272941
endif
29282942
! sh2o(1) = sh2o(1)+snliq(j)/(dzsnso(1)*1000.)
29292943
! sice(1) = sice(1)+snice(j)/(dzsnso(1)*1000.)
@@ -2966,8 +2980,8 @@ subroutine combine_glacier (nsnow ,nsoil , & !in
29662980
! check the snow depth - all snow gone
29672981
! the liquid water assumes ponding on soil surface.
29682982

2969-
! if (snowh < 0.025 .and. isnow < 0 ) then ! mb: change limit
2970-
if (snowh < 0.05 .and. isnow < 0 ) then
2983+
if (snowh < 0.025 .and. isnow < 0 ) then ! mb: change limit
2984+
! if (snowh < 0.05 .and. isnow < 0 ) then
29712985
isnow = 0
29722986
sneqv = zwice
29732987
ponding2 = ponding2 + zwliq ! limit of isnow < 0 means input ponding
@@ -3165,8 +3179,8 @@ subroutine divide_glacier (nsnow ,nsoil , & !in
31653179
zwliq, zwice, tsno(1))
31663180

31673181
! subdivide a new layer
3168-
! if (msno <= 2 .and. dz(2) > 0.20) then ! mb: change limit
3169-
if (msno <= 2 .and. dz(2) > 0.10) then
3182+
if (msno <= 2 .and. dz(2) > 0.20) then ! mb: change limit
3183+
! if (msno <= 2 .and. dz(2) > 0.10) then
31703184
msno = 3
31713185
dtdz = (tsno(1) - tsno(2))/((dz(1)+dz(2))/2.)
31723186
dz(2) = dz(2)/2.
@@ -3293,6 +3307,7 @@ subroutine snowh2o_glacier (nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in
32933307
sneqv = sneqv - qsnsub*dt + qsnfro*dt
32943308
propor = sneqv/temp
32953309
snowh = max(0.,propor * snowh)
3310+
snowh = min(max(snowh,sneqv/500.0),sneqv/50.0) ! limit adjustment to a reasonable density
32963311
elseif(opt_gla == 2) then
32973312
fsh = fsh - (qsnfro-qsnsub)*hsub
32983313
qsnfro = 0.0

physics/SFC_Models/Land/Noahmp/noahmpdrv.F90

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,34 +1205,34 @@ subroutine noahmpdrv_run &
12051205
!
12061206

12071207
snow_cover_fraction = 1.0
1208-
temperature_leaf = undefined
1209-
canopy_ice = undefined
1210-
canopy_liquid = undefined
1211-
vapor_pres_canopy_air = undefined
1212-
temperature_canopy_air = undefined
1213-
canopy_wet_fraction = undefined
1214-
lake_water = undefined
1215-
depth_water_table = undefined
1216-
aquifer_water = undefined
1217-
saturated_water = undefined
1218-
leaf_carbon = undefined
1219-
root_carbon = undefined
1220-
stem_carbon = undefined
1221-
wood_carbon = undefined
1222-
soil_carbon_stable = undefined
1223-
soil_carbon_fast = undefined
1224-
leaf_area_index = undefined
1225-
stem_area_index = undefined
1226-
evaporation_canopy = undefined
1227-
transpiration = undefined
1228-
aquifer_water = undefined
1229-
precip_adv_heat_total = undefined
1208+
temperature_leaf = temperature_radiative
1209+
canopy_ice = 0.0
1210+
canopy_liquid = 0.0
1211+
vapor_pres_canopy_air = 2000.0
1212+
temperature_canopy_air = temperature_radiative
1213+
canopy_wet_fraction = 0.0
1214+
lake_water = 0.0
1215+
depth_water_table = 0.0
1216+
aquifer_water = 0.0
1217+
saturated_water = 0.0
1218+
leaf_carbon = 0.0
1219+
root_carbon = 0.0
1220+
stem_carbon = 0.0
1221+
wood_carbon = 0.0
1222+
soil_carbon_stable = 0.0
1223+
soil_carbon_fast = 0.0
1224+
leaf_area_index = 0.0
1225+
stem_area_index = 0.0
1226+
evaporation_canopy = 0.0
1227+
transpiration = 0.0
1228+
aquifer_water = 0.0
1229+
precip_adv_heat_total = 0.0
12301230
soil_moisture_wtd = 0.0
12311231
recharge = 0.0
12321232
deep_recharge = 0.0
12331233
eq_soil_water_vol = soil_moisture_vol
1234-
transpiration_heat = undefined
1235-
latent_heat_canopy = undefined
1234+
transpiration_heat = 0.0
1235+
latent_heat_canopy = 0.0
12361236
z0_total = 0.002
12371237
latent_heat_total = latent_heat_ground
12381238
t2mmp(i) = temperature_bare_2m

0 commit comments

Comments
 (0)