Skip to content

Commit

Permalink
Merge pull request NOAA-EMC#57 from climbfuji/mike_unified_ugwp_with_…
Browse files Browse the repository at this point in the history
…dom_mods

Wrapper for PR NOAA-EMC#53 (Unified ugwp)
  • Loading branch information
DomHeinzeller authored Nov 17, 2020
2 parents bf64848 + 8061355 commit bcf422d
Show file tree
Hide file tree
Showing 7 changed files with 340 additions and 32 deletions.
2 changes: 2 additions & 0 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
'FV3/ccpp/physics/physics/GFS_time_vary_pre.fv3.F90',
'FV3/ccpp/physics/physics/cires_ugwp.F90',
'FV3/ccpp/physics/physics/cires_ugwp_post.F90',
'FV3/ccpp/physics/physics/unified_ugwp.F90',
'FV3/ccpp/physics/physics/unified_ugwp_post.F90',
'FV3/ccpp/physics/physics/cnvc90.f',
'FV3/ccpp/physics/physics/cs_conv.F90',
'FV3/ccpp/physics/physics/cs_conv_aw_adj.F90',
Expand Down
2 changes: 1 addition & 1 deletion ccpp/physics
93 changes: 93 additions & 0 deletions ccpp/suites/suite_FV3_GSD_v0_unified_ugwp_suite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>

<suite name="FV3_GSD_v0_unified_ugwp_suite" version="1">
<!-- <init></init> -->
<group name="time_vary">
<subcycle loop="1">
<scheme>GFS_time_vary_pre</scheme>
<scheme>GFS_rrtmg_setup</scheme>
<scheme>GFS_rad_time_vary</scheme>
<scheme>GFS_phys_time_vary</scheme>
</subcycle>
</group>
<group name="radiation">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>GFS_rrtmg_pre</scheme>
<scheme>rrtmg_sw_pre</scheme>
<scheme>rrtmg_sw</scheme>
<scheme>rrtmg_sw_post</scheme>
<scheme>rrtmg_lw_pre</scheme>
<scheme>rrtmg_lw</scheme>
<scheme>sgscloud_radpost</scheme>
<scheme>rrtmg_lw_post</scheme>
<scheme>GFS_rrtmg_post</scheme>
</subcycle>
</group>
<group name="physics">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_phys_reset</scheme>
<scheme>GFS_suite_stateout_reset</scheme>
<scheme>get_prs_fv3</scheme>
<scheme>GFS_suite_interstitial_1</scheme>
<scheme>GFS_surface_generic_pre</scheme>
<scheme>GFS_surface_composites_pre</scheme>
<scheme>dcyc2t3</scheme>
<scheme>GFS_surface_composites_inter</scheme>
<scheme>GFS_suite_interstitial_2</scheme>
</subcycle>
<!-- Surface iteration loop -->
<subcycle loop="2">
<scheme>sfc_diff</scheme>
<scheme>GFS_surface_loop_control_part1</scheme>
<scheme>sfc_nst_pre</scheme>
<scheme>sfc_nst</scheme>
<scheme>sfc_nst_post</scheme>
<scheme>lsm_ruc</scheme>
<scheme>lsm_ruc_sfc_sice_pre</scheme>
<scheme>sfc_sice</scheme>
<scheme>lsm_ruc_sfc_sice_post</scheme>
<scheme>GFS_surface_loop_control_part2</scheme>
</subcycle>
<!-- End of surface iteration loop -->
<subcycle loop="1">
<scheme>GFS_surface_composites_post</scheme>
<scheme>sfc_diag</scheme>
<scheme>sfc_diag_post</scheme>
<scheme>GFS_surface_generic_post</scheme>
<scheme>mynnedmf_wrapper</scheme>
<scheme>GFS_GWD_generic_pre</scheme>
<scheme>unified_ugwp</scheme>
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>rayleigh_damp</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>ozphys_2015</scheme>
<scheme>h2ophys</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
<scheme>cu_gf_driver_pre</scheme>
<scheme>cu_gf_driver</scheme>
<scheme>GFS_DCNV_generic_post</scheme>
<scheme>GFS_SCNV_generic_pre</scheme>
<scheme>GFS_SCNV_generic_post</scheme>
<scheme>GFS_suite_interstitial_4</scheme>
<scheme>cnvc90</scheme>
<scheme>GFS_MP_generic_pre</scheme>
<scheme>mp_thompson_pre</scheme>
<scheme>mp_thompson</scheme>
<scheme>mp_thompson_post</scheme>
<scheme>GFS_MP_generic_post</scheme>
<scheme>cu_gf_driver_post</scheme>
<scheme>maximum_hourly_diagnostics</scheme>
</subcycle>
</group>
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
</subcycle>
</group>
<!-- <finalize></finalize> -->
</suite>
91 changes: 91 additions & 0 deletions ccpp/suites/suite_FV3_GSD_v0_unified_ugwp_suite_noah.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>

<suite name="FV3_GSD_v0_unified_ugwp_suite_noah" version="1">
<!-- <init></init> -->
<group name="time_vary">
<subcycle loop="1">
<scheme>GFS_time_vary_pre</scheme>
<scheme>GFS_rrtmg_setup</scheme>
<scheme>GFS_rad_time_vary</scheme>
<scheme>GFS_phys_time_vary</scheme>
</subcycle>
</group>
<group name="radiation">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>GFS_rrtmg_pre</scheme>
<scheme>rrtmg_sw_pre</scheme>
<scheme>rrtmg_sw</scheme>
<scheme>rrtmg_sw_post</scheme>
<scheme>rrtmg_lw_pre</scheme>
<scheme>rrtmg_lw</scheme>
<scheme>sgscloud_radpost</scheme>
<scheme>rrtmg_lw_post</scheme>
<scheme>GFS_rrtmg_post</scheme>
</subcycle>
</group>
<group name="physics">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_phys_reset</scheme>
<scheme>GFS_suite_stateout_reset</scheme>
<scheme>get_prs_fv3</scheme>
<scheme>GFS_suite_interstitial_1</scheme>
<scheme>GFS_surface_generic_pre</scheme>
<scheme>GFS_surface_composites_pre</scheme>
<scheme>dcyc2t3</scheme>
<scheme>GFS_surface_composites_inter</scheme>
<scheme>GFS_suite_interstitial_2</scheme>
</subcycle>
<!-- Surface iteration loop -->
<subcycle loop="2">
<scheme>sfc_diff</scheme>
<scheme>GFS_surface_loop_control_part1</scheme>
<scheme>sfc_nst_pre</scheme>
<scheme>sfc_nst</scheme>
<scheme>sfc_nst_post</scheme>
<scheme>lsm_noah</scheme>
<scheme>sfc_sice</scheme>
<scheme>GFS_surface_loop_control_part2</scheme>
</subcycle>
<!-- End of surface iteration loop -->
<subcycle loop="1">
<scheme>GFS_surface_composites_post</scheme>
<scheme>sfc_diag</scheme>
<scheme>sfc_diag_post</scheme>
<scheme>GFS_surface_generic_post</scheme>
<scheme>mynnedmf_wrapper</scheme>
<scheme>GFS_GWD_generic_pre</scheme>
<scheme>unified_ugwp</scheme>
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>rayleigh_damp</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>ozphys_2015</scheme>
<scheme>h2ophys</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
<scheme>cu_gf_driver_pre</scheme>
<scheme>cu_gf_driver</scheme>
<scheme>GFS_DCNV_generic_post</scheme>
<scheme>GFS_SCNV_generic_pre</scheme>
<scheme>GFS_SCNV_generic_post</scheme>
<scheme>GFS_suite_interstitial_4</scheme>
<scheme>cnvc90</scheme>
<scheme>GFS_MP_generic_pre</scheme>
<scheme>mp_thompson_pre</scheme>
<scheme>mp_thompson</scheme>
<scheme>mp_thompson_post</scheme>
<scheme>GFS_MP_generic_post</scheme>
<scheme>cu_gf_driver_post</scheme>
<scheme>maximum_hourly_diagnostics</scheme>
</subcycle>
</group>
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
</subcycle>
</group>
<!-- <finalize></finalize> -->
</suite>
74 changes: 56 additions & 18 deletions gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module GFS_typedefs
con_t0c, con_cvap, con_cliq, con_eps, con_epsq, &
con_epsm1, con_ttp, rlapse, con_jcal, con_rhw0, &
con_sbc, con_tice, cimin, con_p0, rhowater, &
con_csol, con_epsqs
con_csol, con_epsqs, con_omega, con_rerth

use module_radsw_parameters, only: topfsw_type, sfcfsw_type, profsw_type, cmpfsw_type, NBDSW
use module_radlw_parameters, only: topflw_type, sfcflw_type, proflw_type, NBDLW
Expand Down Expand Up @@ -817,9 +817,17 @@ module GFS_typedefs
logical :: cnvgwd !< flag for conv gravity wave drag
#ifdef CCPP
integer :: gwd_opt !< gwd_opt = 1 => original GFS gwd (gwdps.f)
!< gwd_opt = 2 => unified GWD (placeholder)
!< gwd_opt = 3 => GSD drag suite
!< gwd_opt = 33 => GSD drag suite with extra output
!< gwd_opt = 2 => unified ugwp GWD
!< gwd_opt = 22 => unified ugwp GWD with extra output
!< gwd_opt = 3 => GSL drag suite
!< gwd_opt = 33 => GSL drag suite with extra output
logical :: do_ugwp_v0 !< flag for version 0 ugwp GWD
logical :: do_ugwp_v0_orog_only !< flag for version 0 ugwp GWD (orographic drag only)
logical :: do_gsl_drag_ls_bl !< flag for GSL drag (large-scale GWD and blocking only)
logical :: do_gsl_drag_ss !< flag for GSL drag (small-scale GWD only)
logical :: do_gsl_drag_tofd !< flag for GSL drag (turbulent orog form drag only)
logical :: do_ugwp_v1 !< flag for version 1 ugwp GWD
logical :: do_ugwp_v1_orog_only !< flag for version 1 ugwp GWD (orographic drag only)
#endif
logical :: mstrat !< flag for moorthi approach for stratus
logical :: moist_adj !< flag for moist convective adjustment
Expand Down Expand Up @@ -893,7 +901,7 @@ module GFS_typedefs
#endif
integer :: nmtvr !< number of topographic variables such as variance etc
!< used in the GWD parameterization - 10 more added if
!< GSD orographic drag scheme is used
!< GSL orographic drag scheme is used
integer :: jcap !< number of spectral wave trancation used only by sascnv shalcnv
real(kind=kind_phys) :: cs_parm(10) !< tunable parameters for Chikira-Sugiyama convection
real(kind=kind_phys) :: flgmin(2) !< [in] ice fraction bounds
Expand Down Expand Up @@ -2064,7 +2072,7 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: qs_r(:,:) => null() !<
real (kind=kind_phys), pointer :: qg_r(:,:) => null() !<

!-- GSD drag suite
!-- GSL drag suite
real (kind=kind_phys), pointer :: varss(:) => null() !<
real (kind=kind_phys), pointer :: ocss(:) => null() !<
real (kind=kind_phys), pointer :: oa4ss(:,:) => null() !<
Expand Down Expand Up @@ -3089,8 +3097,17 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: old_monin = .false. !< flag for diff monin schemes
logical :: cnvgwd = .false. !< flag for conv gravity wave drag
integer :: gwd_opt = 1 !< flag for configuring gwd scheme
!< gwd_opt = 3 : GSDdrag suite
!< gwd_opt = 33: GSDdrag suite with extra output
!< gwd_opt = 2 => unified ugwp GWD
!< gwd_opt = 22 => unified ugwp GWD with extra output
!< gwd_opt = 3 : GSLdrag suite
!< gwd_opt = 33: GSLdrag suite with extra output
logical :: do_ugwp_v0 = .true. !< flag for version 0 ugwp GWD
logical :: do_ugwp_v0_orog_only = .false. !< flag for version 0 ugwp GWD (orographic drag only)
logical :: do_gsl_drag_ls_bl = .false. !< flag for GSL drag (large-scale GWD and blocking only)
logical :: do_gsl_drag_ss = .false. !< flag for GSL drag (small-scale GWD only)
logical :: do_gsl_drag_tofd = .false. !< flag for GSL drag (turbulent orog form drag only)
logical :: do_ugwp_v1 = .false. !< flag for version 1 ugwp GWD
logical :: do_ugwp_v1_orog_only = .false. !< flag for version 1 ugwp GWD (orographic drag only)
!--- vay-2018
logical :: ldiag_ugwp = .false. !< flag for UGWP diag fields
logical :: do_ugwp = .false. !< flag do UGWP+RF
Expand Down Expand Up @@ -3383,7 +3400,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
bl_mynn_cloudpdf, bl_mynn_edmf, bl_mynn_edmf_mom, &
bl_mynn_edmf_tke, bl_mynn_edmf_part, bl_mynn_cloudmix, &
bl_mynn_mixqt, bl_mynn_output, icloud_bl, bl_mynn_tkeadvect, &
gwd_opt, &
gwd_opt, do_ugwp_v0, do_ugwp_v0_orog_only, &
do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, &
do_ugwp_v1, do_ugwp_v1_orog_only, &
! *DH
do_myjsfc, do_myjpbl, &
hwrf_samfdeep, hwrf_samfshal, &
Expand Down Expand Up @@ -3942,10 +3961,18 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%icloud_bl = icloud_bl
! *DH
Model%gwd_opt = gwd_opt
if (Model%gwd_opt==3 .or. Model%gwd_opt==33) then
! Add 10 more orographic static fields for GSD drag scheme
if (Model%gwd_opt==3 .or. Model%gwd_opt==33 .or. &
Model%gwd_opt==2 .or. Model%gwd_opt==22) then
! Add 10 more orographic static fields for GSL drag scheme
Model%nmtvr = 24
end if
Model%do_ugwp_v0 = do_ugwp_v0
Model%do_ugwp_v0_orog_only = do_ugwp_v0_orog_only
Model%do_gsl_drag_ls_bl = do_gsl_drag_ls_bl
Model%do_gsl_drag_ss = do_gsl_drag_ss
Model%do_gsl_drag_tofd = do_gsl_drag_tofd
Model%do_ugwp_v1 = do_ugwp_v1
Model%do_ugwp_v1_orog_only = do_ugwp_v1_orog_only
Model%do_myjsfc = do_myjsfc
Model%do_myjpbl = do_myjpbl
#endif
Expand Down Expand Up @@ -5012,7 +5039,15 @@ subroutine control_print(Model)
print *, ' do_mynnsfclay : ', Model%do_mynnsfclay
print *, ' do_myjsfc : ', Model%do_myjsfc
print *, ' do_myjpbl : ', Model%do_myjpbl
print *, ' do_ugwp : ', Model%do_ugwp
print *, ' gwd_opt : ', Model%gwd_opt
print *, ' do_ugwp_v0 : ', Model%do_ugwp_v0
print *, ' do_ugwp_v0_orog_only : ', Model%do_ugwp_v0_orog_only
print *, ' do_gsl_drag_ls_bl : ', Model%do_gsl_drag_ls_bl
print *, ' do_gsl_drag_ss : ', Model%do_gsl_drag_ss
print *, ' do_gsl_drag_tofd : ', Model%do_gsl_drag_tofd
print *, ' do_ugwp_v1 : ', Model%do_ugwp_v1
print *, ' do_ugwp_v1_orog_only : ', Model%do_ugwp_v1_orog_only
#endif
print *, ' '
print *, 'Rayleigh friction'
Expand Down Expand Up @@ -5755,7 +5790,7 @@ subroutine diag_create (Diag, IM, Model)
endif

!--- Drag Suite variables:
if (Model%gwd_opt == 33) then
if (Model%gwd_opt == 33 .or. Model%gwd_opt == 22) then
!print*,"Allocating all Drag Suite variables:"
allocate (Diag%dtaux2d_ls (IM,Model%levs))
allocate (Diag%dtauy2d_ls (IM,Model%levs))
Expand Down Expand Up @@ -6490,8 +6525,9 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%dudt_mtb (IM,Model%levs))
allocate (Interstitial%dudt_ogw (IM,Model%levs))
allocate (Interstitial%dudt_tms (IM,Model%levs))
!-- GSD drag suite
if (Model%gwd_opt==3 .or. Model%gwd_opt==33) then
!-- GSL drag suite
if (Model%gwd_opt==3 .or. Model%gwd_opt==33 .or. &
Model%gwd_opt==2 .or. Model%gwd_opt==22 ) then
allocate (Interstitial%varss (IM))
allocate (Interstitial%ocss (IM))
allocate (Interstitial%oa4ss (IM,4))
Expand Down Expand Up @@ -7071,8 +7107,9 @@ subroutine interstitial_phys_reset (Interstitial, Model)
Interstitial%dudt_mtb = clear_val
Interstitial%dudt_ogw = clear_val
Interstitial%dudt_tms = clear_val
!-- GSD drag suite
if (Model%gwd_opt==3 .or. Model%gwd_opt==33) then
!-- GSL drag suite
if (Model%gwd_opt==3 .or. Model%gwd_opt==33 .or. &
Model%gwd_opt==2 .or. Model%gwd_opt==22) then
Interstitial%varss = clear_val
Interstitial%ocss = clear_val
Interstitial%oa4ss = clear_val
Expand Down Expand Up @@ -7430,8 +7467,9 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno)
write (0,*) 'sum(Interstitial%dudt_mtb ) = ', sum(Interstitial%dudt_mtb )
write (0,*) 'sum(Interstitial%dudt_ogw ) = ', sum(Interstitial%dudt_ogw )
write (0,*) 'sum(Interstitial%dudt_tms ) = ', sum(Interstitial%dudt_tms )
!-- GSD drag suite
if (Model%gwd_opt==3 .or. Model%gwd_opt==33) then
!-- GSL drag suite
if (Model%gwd_opt==3 .or. Model%gwd_opt==33 .or. &
Model%gwd_opt==2 .or. Model%gwd_opt==22) then
write (0,*) 'sum(Interstitial%varss ) = ', sum(Interstitial%varss)
write (0,*) 'sum(Interstitial%ocss ) = ', sum(Interstitial%ocss)
write (0,*) 'sum(Interstitial%oa4ss ) = ', sum(Interstitial%oa4ss)
Expand Down
Loading

0 comments on commit bcf422d

Please sign in to comment.