Skip to content

Commit 747d50a

Browse files
committed
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physics into HEAD
2 parents 53cd7f8 + ad5a241 commit 747d50a

3 files changed

Lines changed: 89 additions & 11 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

0 commit comments

Comments
 (0)