Skip to content

Commit 6eea755

Browse files
committed
Merge branch 'ufs/dev' into feature/gfdlmpv3
2 parents 73b851b + 8a5f4f5 commit 6eea755

13 files changed

Lines changed: 3742 additions & 115 deletions

File tree

physics/GWD/drag_suite.F90

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ subroutine drag_suite_psl( &
17311731
real(kind=kind_phys),parameter :: odmax = 10.
17321732
real(kind=kind_phys),parameter :: cdmin = 0.0
17331733
integer :: komax(im),kbmax(im),kblk(im)
1734-
real(kind=kind_phys) :: hmax(im)
1734+
real(kind=kind_phys) :: href(im),hmax(im)
17351735
real(kind=kind_phys) :: cd
17361736
real(kind=kind_phys) :: zblk,tautem
17371737
real(kind=kind_phys) :: pe,ke
@@ -1916,6 +1916,7 @@ subroutine drag_suite_psl( &
19161916
! initialize array for flow-blocking drag
19171917
!
19181918
taufb(1:im,1:km+1) = 0.0
1919+
href(1:im) = 0.0
19191920
hmax(1:im) = 0.0
19201921
komax(1:im) = 0
19211922
kbmax(1:im) = 0
@@ -2000,11 +2001,13 @@ subroutine drag_suite_psl( &
20002001
!
20012002
do i = its,im
20022003
hmax(i) = max(elvmax(i),zlowtop(i))
2004+
href(i) = max(hmax(i),hpbl(i))
20032005
enddo
20042006
!
20052007
do i = its,im
20062008
!!! kbl(i) = max(kpbl(i), klowtop(i)) ! do not use pbl height for the time being...
2007-
kbl(i) = max(komax(i), klowtop(i))
2009+
kbl(i) = max(komax(i), klowtop(i))
2010+
kbl(i) = max(kbl(i), kpbl(i))
20082011
kbl(i) = max(min(kbl(i),kpblmax),kpblmin)
20092012
enddo
20102013
!
@@ -2109,7 +2112,7 @@ subroutine drag_suite_psl( &
21092112
!
21102113
! no drag when sub-oro is too small..
21112114
!
2112-
ldrag(i) = hmax(i).le.hmt_min
2115+
ldrag(i) = href(i).le.hmt_min
21132116
!
21142117
! no drag when critical level in the base layer
21152118
!

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_Layer/UFS/sfc_diff.f

Lines changed: 43 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
6060
& sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
6161
& z0pert,ztpert, & ! mg, sfc-perts !intent(in)
6262
& flag_iter,redrag, & !intent(in)
63-
& flag_lakefreeze, & !intent(in)
63+
& flag_lakefreeze,lakefrac,fice, & !intent(in)
6464
& u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in)
6565
& u1,v1,usfco,vsfco,icplocn2atm, &
6666
& wet,dry,icy, & !intent(in)
@@ -106,6 +106,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
106106
& ps,t1,q1,z1,garea,prsl1,prslki,prsik1,prslk1, &
107107
& wind,sigmaf,shdmax, &
108108
& z0pert,ztpert ! mg, sfc-perts
109+
real(kind=kind_phys), dimension(:), intent(in) :: lakefrac
110+
real(kind=kind_phys), dimension(:), intent(in) :: fice
109111
real(kind=kind_phys), dimension(:), intent(in) :: &
110112
& tskin_wat, tskin_lnd, tskin_ice, &
111113
& tsurf_wat, tsurf_lnd, tsurf_ice
@@ -340,7 +342,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
340342
! --- outputs:
341343
& rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i),
342344
& cm_ice(i), ch_ice(i), stress_ice(i), ustar_ice(i))
343-
endif ! Icy points
345+
endif ! Icy points
344346
345347
! BWG: Everything from here to end of subroutine was after
346348
! the stuff now put into "stability"
@@ -364,20 +366,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
364366
windrel=sqrt((u1(i)-usfco(i))**2+(v1(i)-vsfco(i))**2)
365367
endif
366368
367-
if (sfc_z0_type == -1) then ! using wave model derived momentum roughness
368-
tem1 = 0.11 * vis / ustar_wat(i)
369-
z0 = tem1 + 0.01_kp * z0rl_wav(i)
370-
371-
if (redrag) then
372-
z0max = max(min(z0, z0s_max),1.0e-7_kp)
373-
else
374-
z0max = max(min(z0,0.1_kp), 1.0e-7_kp)
375-
endif
376-
z0rl_wat(i) = 100.0_kp * z0max ! cm
377-
else
378-
z0 = 0.01_kp * z0rl_wat(i)
379-
z0max = max(zmin, min(z0,z1(i)))
380-
endif
369+
z0 = 0.01_kp * z0rl_wat(i)
370+
z0max = max(zmin, min(z0,z1(i)))
381371
!
382372
!** test xubin's new z0
383373

@@ -416,52 +406,51 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
416406
!
417407
! update z0 over ocean
418408
!
419-
if (sfc_z0_type >= 0) then
420-
if (sfc_z0_type == 0) then
421-
! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i)
422-
tem1 = 0.11 * vis / ustar_wat(i)
423-
z0 = tem1 + (charnock/grav)*ustar_wat(i)*ustar_wat(i)
409+
if ((sfc_z0_type == -1) .and.
410+
& (lakefrac(i) == 0.0 .and. fice(i) == 0.0) .and.
411+
& (z0rl_wav(i)>1.0e-7_kp .and. z0rl_wav(i)<0.1_kp)) then
412+
! using wave model derived momentum roughness
413+
tem1 = 0.11 * vis / ustar_wat(i)
414+
z0 = tem1 + 0.01_kp * z0rl_wav(i)
415+
416+
if (redrag) then
417+
z0rl_wat(i) = 100.0_kp * max(min(z0,z0s_max),1.0e-7_kp)
418+
else
419+
z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.e-7_kp)
420+
endif
421+
422+
elseif ((sfc_z0_type == 0) .or.
423+
& ((sfc_z0_type == -1) .and.
424+
& (z0rl_wav(i)<=1.0e-7_kp .or. z0rl_wav(i)>=0.1_kp))) then
425+
! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i)
426+
tem1 = 0.11 * vis / ustar_wat(i)
427+
z0 = tem1 + (charnock/grav)*ustar_wat(i)*ustar_wat(i)
424428

425429

426430
! mbek -- toga-coare flux algorithm
427-
! z0 = (charnock / grav) * ustar(i)*ustar(i) + arnu/ustar(i)
431+
! z0 = (charnock / grav) * ustar(i)*ustar(i) + arnu/ustar(i)
428432
! new implementation of z0
429-
! cc = ustar(i) * z0 / rnu
430-
! pp = cc / (1. + cc)
431-
! ff = grav * arnu / (charnock * ustar(i) ** 3)
432-
! z0 = arnu / (ustar(i) * ff ** pp)
433-
434-
if (redrag) then
435-
z0rl_wat(i) = 100.0_kp * max(min(z0, z0s_max), &
436-
& 1.0e-7_kp)
437-
else
438-
z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.e-7_kp)
439-
endif
440-
441-
elseif (sfc_z0_type == 6) then ! wang
442-
call znot_m_v6(wind10m, z0) ! wind, m/s, z0, m
443-
z0rl_wat(i) = 100.0_kp * z0 ! cm
444-
elseif (sfc_z0_type == 7) then ! wang
445-
call znot_m_v7(wind10m, z0) ! wind, m/s, z0, m
446-
z0rl_wat(i) = 100.0_kp * z0 ! cm
433+
! cc = ustar(i) * z0 / rnu
434+
! pp = cc / (1. + cc)
435+
! ff = grav * arnu / (charnock * ustar(i) ** 3)
436+
! z0 = arnu / (ustar(i) * ff ** pp)
437+
438+
if (redrag) then
439+
z0rl_wat(i) = 100.0_kp * max(min(z0,z0s_max),1.0e-7_kp)
447440
else
448-
z0rl_wat(i) = 1.0e-4_kp
441+
z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.e-7_kp)
449442
endif
450443

451-
elseif (z0rl_wav(i) <= 1.0e-7_kp .or.
452-
& z0rl_wav(i) > 1.0_kp) then
453-
! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i)
454-
tem1 = 0.11 * vis / ustar_wat(i)
455-
z0 = tem1 + (charnock/grav)*ustar_wat(i)*ustar_wat(i)
456-
457-
if (redrag) then
458-
z0rl_wat(i) = 100.0_kp * max(min(z0, z0s_max),1.0e-7_kp)
459-
else
460-
z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.0e-7_kp)
461-
endif
462-
444+
elseif (sfc_z0_type == 6) then ! wang
445+
call znot_m_v6(wind10m, z0) ! wind, m/s, z0, m
446+
z0rl_wat(i) = 100.0_kp * z0 ! cm
447+
elseif (sfc_z0_type == 7) then ! wang
448+
call znot_m_v7(wind10m, z0) ! wind, m/s, z0, m
449+
z0rl_wat(i) = 100.0_kp * z0 ! cm
450+
else
451+
z0rl_wat(i) = 1.0e-4_kp
463452
endif
464-
453+
!
465454
endif ! end of if(open ocean)
466455
!
467456
endif ! end of if(flagiter) loop

physics/SFC_Layer/UFS/sfc_diff.meta

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@
143143
type = real
144144
kind = kind_phys
145145
intent = in
146+
[lakefrac]
147+
standard_name = lake_area_fraction
148+
long_name = fraction of horizontal grid area occupied by lake
149+
units = frac
150+
dimensions = (horizontal_loop_extent)
151+
type = real
152+
kind = kind_phys
153+
intent = in
154+
[fice]
155+
standard_name = sea_ice_area_fraction_of_sea_area_fraction
156+
long_name = ice fraction over open water
157+
units = frac
158+
dimensions = (horizontal_loop_extent)
159+
type = real
160+
kind = kind_phys
161+
intent = in
146162
[vegtype]
147163
standard_name = vegetation_type_classification
148164
long_name = vegetation type at each grid cell

0 commit comments

Comments
 (0)