Skip to content

Commit be960be

Browse files
committed
Merge branch 'main' into return-on-error
2 parents 8030eaa + 7f7a407 commit be960be

78 files changed

Lines changed: 9610 additions & 5326 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

physics/GWD/ugwp_driver_v0.F

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module ugwp_driver_v0
1010
!ugwp-v0 subroutines: GWDPS_V0 and fv3_ugwp_solv2_v0
1111
!
1212
!=====================================================================
13-
!>\ingroup cires_ugwp_run_mod
1413
!>\defgroup ugwp_driverv0_mod UGWP V0 Driver Module
1514
!! This is the CIRES UGWP V0 driver module
1615
!!
@@ -924,8 +923,7 @@ end subroutine gwdps_v0
924923
!===============================================================================
925924
!23456==============================================================================
926925

927-
!>\ingroup cires_ugwp_run_mod
928-
!! A modification of the Scinocca (2003) \cite scinocca_2003 algorithm for
926+
!> A modification of the Scinocca (2003) \cite scinocca_2003 algorithm for
929927
!! NGWs with non-hydrostatic and rotational
930928
!!effects for GW propagations and background dissipation
931929
subroutine fv3_ugwp_solv2_v0(klon, klev, dtime,

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_common.F90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ subroutine set_aerosol_tracer_index(imp_physics, imp_physics_wsm6, &
1515
imp_physics_thompson, ltaerosol,mraerosol, &
1616
imp_physics_mg, ntgl, imp_physics_gfdl, &
1717
imp_physics_zhao_carr, imp_physics_nssl,&
18-
nssl_hail_on, nssl_ccn_on, kk, &
18+
nssl_hail_on, nssl_ccn_on, nssl_3moment, kk, &
1919
errmsg, errflg)
2020
implicit none
2121
!
2222
integer, intent(in ) :: imp_physics, imp_physics_wsm6, &
2323
imp_physics_thompson, &
2424
imp_physics_mg, ntgl, imp_physics_gfdl, &
2525
imp_physics_zhao_carr,imp_physics_nssl
26-
logical, intent(in ) :: ltaerosol, mraerosol, nssl_hail_on, nssl_ccn_on
26+
logical, intent(in ) :: ltaerosol, mraerosol, nssl_hail_on, nssl_ccn_on, nssl_3moment
2727
integer, intent(out) :: kk
2828
character(len=*), intent(out) :: errmsg
2929
integer, intent(out) :: errflg
@@ -59,8 +59,10 @@ subroutine set_aerosol_tracer_index(imp_physics, imp_physics_wsm6, &
5959
elseif (imp_physics == imp_physics_nssl) then
6060
IF ( nssl_hail_on ) THEN
6161
kk = 16
62+
IF ( nssl_3moment ) kk = kk + 3
6263
ELSE
6364
kk = 13
65+
IF ( nssl_3moment ) kk = kk + 2
6466
ENDIF
6567
IF ( nssl_ccn_on ) kk = kk + 1
6668
else

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
110110
imp_physics_thompson, ltaerosol,mraerosol, &
111111
imp_physics_mg, ntgl, imp_physics_gfdl, &
112112
imp_physics_zhao_carr, imp_physics_nssl,&
113-
nssl_hail_on, nssl_ccn_on, kk, &
113+
nssl_hail_on, nssl_ccn_on, nssl_3moment, kk, &
114114
errmsg, errflg)
115115
if (errflg /= 0) return
116116
!

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index,
276276
imp_physics_thompson, ltaerosol,mraerosol, &
277277
imp_physics_mg, ntgl, imp_physics_gfdl, &
278278
imp_physics_zhao_carr, imp_physics_nssl,&
279-
nssl_hail_on, nssl_ccn_on, kk, &
279+
nssl_hail_on, nssl_ccn_on, nssl_3moment, kk, &
280280
errmsg, errflg)
281281
if (errflg /= 0) return
282282
!

physics/Interstitials/UFS_SCM_NEPTUNE/GFS_photochemistry.F90

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
! #########################################################################################
2-
!> \file GFS_photochemistry.f90
1+
!> \file GFS_photochemistry.F90
32
!!
4-
! #########################################################################################
3+
54
module GFS_photochemistry
65
use machine, only: kind_phys
76
use module_ozphys, only: ty_ozphys
87
use module_h2ophys, only: ty_h2ophys
98
implicit none
109
contains
1110

12-
! #########################################################################################
1311
!> \section arg_table_GFS_photochemistry_init Argument Table
1412
!! \htmlinclude GFS_photochemistry_init.html
1513
!!
16-
! #########################################################################################
1714
subroutine GFS_photochemistry_init(oz_phys_2006, oz_phys_2015, h2o_phys, errmsg, errflg)
1815
logical, intent(in) :: &
19-
oz_phys_2015, & ! Do ozone photochemistry? (2015)
20-
oz_phys_2006, & ! Do ozone photochemistry? (2006)
21-
h2o_phys ! Do stratospheric h2o photochemistry?
16+
oz_phys_2015, & !< Do ozone photochemistry? (2015)
17+
oz_phys_2006, & !< Do ozone photochemistry? (2006)
18+
h2o_phys !< Do stratospheric h2o photochemistry?
2219
character(len=*), intent(out) :: &
23-
errmsg ! CCPP Error message.
20+
errmsg !< CCPP Error message.
2421
integer, intent(out) :: &
25-
errflg ! CCPP Error flag.
22+
errflg !< CCPP Error flag.
2623

2724
! Initialize CCPP error handling variables
2825
errmsg = ''
@@ -44,11 +41,9 @@ subroutine GFS_photochemistry_init(oz_phys_2006, oz_phys_2015, h2o_phys, errmsg,
4441

4542
end subroutine GFS_photochemistry_init
4643

47-
! #########################################################################################
4844
!> \section arg_table_GFS_photochemistry_run Argument Table
4945
!! \htmlinclude GFS_photochemistry_run.html
5046
!!
51-
! #########################################################################################
5247
subroutine GFS_photochemistry_run (dtp, ozphys, oz_phys_2015, oz_phys_2006, con_1ovg, &
5348
prsl, dp, ozpl, h2o_phys, h2ophys, h2opl, h2o0, oz0, gt0, do3_dt_prd, do3_dt_ozmx, &
5449
do3_dt_temp, do3_dt_ohoz, errmsg, errflg)

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
@@ -706,14 +706,16 @@ end subroutine GFS_phys_time_vary_init
706706
!>\section gen_GFS_phys_time_vary_timestep_init GFS_phys_time_vary_timestep_init General Algorithm
707707
!> @{
708708
subroutine GFS_phys_time_vary_timestep_init ( &
709-
me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, idate, nsswr, fhswr, lsswr, fhour, &
709+
me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, idate, cplflx, &
710+
nsswr, fhswr, lsswr, fhour, &
710711
imfdeepcnv, cal_pre, random_clds, nscyc, ntoz, h2o_phys, iaerclm, iccn, clstp, &
711712
jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, iflip, &
712713
jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, &
713714
jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, fn_nml, &
714715
imap, jmap, prsl, seed0, rann, nthrds, nx, ny, nsst, tile_num, nlunit, lsoil, lsoil_lsm,&
715716
kice, ialb, isot, ivegsrc, input_nml_file, use_ufo, nst_anl, frac_grid, fhcyc, phour, &
716-
lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, &
717+
oceanfrac, lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, &
718+
tg3, tref, &
717719
tsfc, tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, zorli, zorll, &
718720
zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype,scolor, shdmin, shdmax, snowd, &
719721
cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, landfrac, ozphys, h2ophys, &
@@ -727,7 +729,7 @@ subroutine GFS_phys_time_vary_timestep_init (
727729
nsswr, imfdeepcnv, iccn, nscyc, ntoz, iflip
728730
integer, intent(in) :: idate(:)
729731
real(kind_phys), intent(in) :: fhswr, fhour
730-
logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm
732+
logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm, cplflx
731733
real(kind_phys), intent(out) :: clstp
732734
integer, intent(in), optional :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:)
733735
real(kind_phys), intent(in), optional :: ddy_o3(:), ddy_h(:)
@@ -757,7 +759,7 @@ subroutine GFS_phys_time_vary_timestep_init (
757759
character(len=*), intent(in) :: fn_nml
758760
logical, intent(in) :: use_ufo, nst_anl, frac_grid
759761
real(kind_phys), intent(in) :: fhcyc, phour, lakefrac(:), min_seaice, min_lakeice, &
760-
xlat_d(:), xlon_d(:), landfrac(:)
762+
xlat_d(:), xlon_d(:), landfrac(:),oceanfrac(:)
761763
real(kind_phys), intent(inout) :: smc(:,:), slc(:,:), stc(:,:), tiice(:,:), tg3(:), &
762764
tsfc(:), tsfco(:), tisfc(:), hice(:), fice(:), &
763765
facsf(:), facwf(:), alvsf(:), alvwf(:), alnsf(:), alnwf(:), &
@@ -928,6 +930,7 @@ subroutine GFS_phys_time_vary_timestep_init (
928930
tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, &
929931
zorli, zorll, zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, &
930932
stype, scolor, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, &
933+
cplflx, oceanfrac, &
931934
xlat_d, xlon_d, slmsk, imap, jmap, errmsg, errflg)
932935
endif
933936
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)
@@ -250,11 +276,45 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml,
250276
close (nlunit)
251277
#endif
252278
!
253-
if ( nsst > 0 ) then
254-
tref = TSFFCS
279+
! The gcycle resulted change is applied to some variables in the way of the coupled mode dependent, water surface type (ocean or lake)
280+
! dependent and nsst mode dependent
281+
!
282+
if ( cplflx ) then
283+
! In coupled mode, keep these variables the same as is (before sfccycle is called) over ocean
284+
do ix=1,npts
285+
if ( oceanfrac(ix) > 0.0_kind_phys ) then
286+
hice(ix) = hice_save(ix)
287+
fice(ix) = fice_save(ix)
288+
snowd(ix) = snowd_save(ix)
289+
snoalb(ix) = snoalb_save(ix)
290+
tisfc(ix) = tisfc_save(ix)
291+
weasd(ix) = weasd_save(ix)
292+
endif
293+
enddo
294+
! In the coupled mode and when NSST is on, update tref over non-ocean
295+
if ( nsst > 0 ) then
296+
do ix=1,npts
297+
if ( oceanfrac(ix) == 0.0_kind_phys ) then
298+
tref(ix) = TSFFCS(ix)
299+
endif
300+
enddo
301+
! In the coupled mode and when NSST is off, update tsfc and tsfco over non-ocean
302+
else
303+
do ix=1,npts
304+
if ( oceanfrac(ix) == 0.0_kind_phys ) then
305+
tsfc(ix) = TSFFCS(ix)
306+
tsfco(ix) = TSFFCS(ix)
307+
endif
308+
enddo
309+
endif
310+
! The same as before (this modification) in uncoupled mode
255311
else
256-
tsfc = TSFFCS
257-
tsfco = TSFFCS
312+
if ( nsst > 0 ) then
313+
tref = TSFFCS
314+
else
315+
tsfc = TSFFCS
316+
tsfco = TSFFCS
317+
endif
258318
endif
259319
!
260320
! real/double precision to integer

physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ module sgscloud_radpre
2222
!> \section arg_table_sgscloud_radpre_run Argument Table
2323
!! \htmlinclude sgscloud_radpre_run.html
2424
!!
25-
!! cloud array description: !
26-
!! clouds(:,:,1) - layer total cloud fraction !
27-
!! clouds(:,:,2) - layer cloud liq water path !
28-
!! clouds(:,:,3) - mean effective radius for liquid cloud !
29-
!! clouds(:,:,4) - layer cloud ice water path !
30-
!! clouds(:,:,5) - mean effective radius for ice cloud !
31-
!! clouds(:,:,6) - layer rain drop water path !
32-
!! clouds(:,:,7) - mean effective radius for rain drop !
33-
!! clouds(:,:,8) - layer snow flake water path !
34-
!! clouds(:,:,9) - mean effective radius for snow flake
35-
!!
36-
!>\section sgscloud_radpre_mod SGS Cloud Scheme Pre General Algorithm
25+
! cloud array description: !
26+
! clouds(:,:,1) - layer total cloud fraction !
27+
! clouds(:,:,2) - layer cloud liq water path !
28+
! clouds(:,:,3) - mean effective radius for liquid cloud !
29+
! clouds(:,:,4) - layer cloud ice water path !
30+
! clouds(:,:,5) - mean effective radius for ice cloud !
31+
! clouds(:,:,6) - layer rain drop water path !
32+
! clouds(:,:,7) - mean effective radius for rain drop !
33+
! clouds(:,:,8) - layer snow flake water path !
34+
! clouds(:,:,9) - mean effective radius for snow flake
35+
!
36+
! \section sgscloud_radpre_mod SGS Cloud Scheme Pre General Algorithm
3737
subroutine sgscloud_radpre_run( &
3838
im,dt,fhswr,levs, &
3939
flag_init,flag_restart, &

0 commit comments

Comments
 (0)