Skip to content
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.mod
*.a
*.pyc
*.i90
3 changes: 3 additions & 0 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
'FV3/ccpp/physics/physics/module_bfmicrophysics.f',
'FV3/ccpp/physics/physics/multi_gases.F90',
'FV3/ccpp/physics/physics/module_gfdl_cloud_microphys.F90',
'FV3/ccpp/physics/physics/module_mp_nssl_2mom.F90',
'FV3/ccpp/physics/physics/mp_nssl_2mom.F90',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this file (mp_nssl_2mom.F90) is the CCPP entry point scheme, it should not need to appear in the dependencies list (only the schemes list below).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think I have this correct now.

'FV3/ccpp/physics/physics/module_nst_model.f90',
'FV3/ccpp/physics/physics/module_nst_parameters.f90',
'FV3/ccpp/physics/physics/module_nst_water_prop.f90',
Expand Down Expand Up @@ -270,6 +272,7 @@
'FV3/ccpp/physics/physics/mp_thompson_pre.F90',
'FV3/ccpp/physics/physics/mp_thompson.F90',
'FV3/ccpp/physics/physics/mp_thompson_post.F90',
'FV3/ccpp/physics/physics/mp_nssl_2mom.F90',
'FV3/ccpp/physics/physics/ozphys.f',
'FV3/ccpp/physics/physics/ozphys_2015.f',
'FV3/ccpp/physics/physics/precpd.f',
Expand Down
87 changes: 87 additions & 0 deletions ccpp/suites/suite_HMTW_2020_mp2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suite looks like it is derived from GFS_v15p2. Is that right? If not, could you edit the PR description to describe the purpose of the suite (e.g. operational GFS suite with NSSL MP substituted for GFDL MP)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR comment has been edited.


<suite name="HMTW_2020_mp2" lib="ccppphys" ver="3">
<!-- <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>
<!--scheme>stochastic_physics</scheme>
<scheme>stochastic_physics_sfc</scheme-->
</subcycle>
</group>
<group name="radiation">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset</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>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>GFS_PBL_generic_pre</scheme>
<scheme>hedmf</scheme>
<scheme>GFS_PBL_generic_post</scheme>
<scheme>GFS_GWD_generic_pre</scheme>
<scheme>cires_ugwp</scheme>
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>rayleigh_damp</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>ozphys</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</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_nssl_2mom</scheme>
<scheme>GFS_MP_generic_post</scheme>
<scheme>maximum_hourly_diagnostics</scheme>
</subcycle>
</group>
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
</subcycle>
</group>
<!-- <finalize></finalize> -->
</suite>
58 changes: 52 additions & 6 deletions gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ module GFS_typedefs
#ifdef CCPP
!--- restart information
logical :: restart !< flag whether this is a coldstart (.false.) or a warmstart/restart (.true.)
logical :: cycling !< flag whether this is a coldstart (.false.) or a cycled run (.true.)
!--- hydrostatic/non-hydrostatic flag
logical :: hydrostatic !< flag whether this is a hydrostatic or non-hydrostatic run
#endif
Expand Down Expand Up @@ -707,6 +708,7 @@ module GFS_typedefs
integer :: imp_physics !< choice of microphysics scheme
integer :: imp_physics_gfdl = 11 !< choice of GFDL microphysics scheme
integer :: imp_physics_thompson = 8 !< choice of Thompson microphysics scheme
integer :: imp_physics_nssl = 17 !< choice of NSSL microphysics scheme
integer :: imp_physics_wsm6 = 6 !< choice of WSMG microphysics scheme
integer :: imp_physics_zhao_carr = 99 !< choice of Zhao-Carr microphysics scheme
integer :: imp_physics_zhao_carr_pdf = 98 !< choice of Zhao-Carr microphysics scheme with PDF clouds
Expand Down Expand Up @@ -1065,12 +1067,16 @@ module GFS_typedefs
integer :: ntrw !< tracer index for rain water
integer :: ntsw !< tracer index for snow water
integer :: ntgl !< tracer index for graupel
integer :: nthl !< tracer index for hail
integer :: ntclamt !< tracer index for cloud amount
integer :: ntlnc !< tracer index for liquid number concentration
integer :: ntinc !< tracer index for ice number concentration
integer :: ntrnc !< tracer index for rain number concentration
integer :: ntsnc !< tracer index for snow number concentration
integer :: ntgnc !< tracer index for graupel number concentration
integer :: nthnc !< tracer index for hail number concentration
integer :: nqvolg !< tracer index for graupel particle volume m3 kg-1
integer :: nqvolh !< tracer index for hail particle volume m3 kg-1
integer :: ntke !< tracer index for kinetic energy
integer :: nto !< tracer index for oxygen ion
integer :: nto2 !< tracer index for oxygen
Expand Down Expand Up @@ -1128,6 +1134,7 @@ module GFS_typedefs
#ifdef CCPP
logical :: first_time_step !< flag signaling first time step for time integration routine
logical :: restart !< flag whether this is a coldstart (.false.) or a warmstart/restart (.true.)
logical :: cycling !< flag whether this is a coldstart (.false.) or a cycled run (.true.)
logical :: hydrostatic !< flag whether this is a hydrostatic or non-hydrostatic run
#endif
integer :: jdat(1:8) !< current forecast date and time
Expand Down Expand Up @@ -2894,6 +2901,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: aux2d_time_avg(1:naux2dmax) = .false. !< flags for time averaging of auxiliary 2d arrays
logical :: aux3d_time_avg(1:naux3dmax) = .false. !< flags for time averaging of auxiliary 3d arrays

logical :: cycling = .false. !< flag to activate extra cycling procedures
real(kind=kind_phys) :: fhcyc = 0. !< frequency for surface data cycling (hours)
integer :: thermodyn_id = 1 !< valid for GFS only for get_prs/phi
integer :: sfcpress_id = 1 !< valid for GFS only for get_prs/phi
Expand Down Expand Up @@ -4060,12 +4068,16 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%ntrw = get_tracer_index(Model%tracer_names, 'rainwat', Model%me, Model%master, Model%debug)
Model%ntsw = get_tracer_index(Model%tracer_names, 'snowwat', Model%me, Model%master, Model%debug)
Model%ntgl = get_tracer_index(Model%tracer_names, 'graupel', Model%me, Model%master, Model%debug)
Model%nthl = get_tracer_index(Model%tracer_names, 'hailwat', Model%me, Model%master, Model%debug)
Model%ntclamt = get_tracer_index(Model%tracer_names, 'cld_amt', Model%me, Model%master, Model%debug)
Model%ntlnc = get_tracer_index(Model%tracer_names, 'water_nc', Model%me, Model%master, Model%debug)
Model%ntinc = get_tracer_index(Model%tracer_names, 'ice_nc', Model%me, Model%master, Model%debug)
Model%ntrnc = get_tracer_index(Model%tracer_names, 'rain_nc', Model%me, Model%master, Model%debug)
Model%ntsnc = get_tracer_index(Model%tracer_names, 'snow_nc', Model%me, Model%master, Model%debug)
Model%ntgnc = get_tracer_index(Model%tracer_names, 'graupel_nc', Model%me, Model%master, Model%debug)
Model%nthnc = get_tracer_index(Model%tracer_names, 'hail_nc', Model%me, Model%master, Model%debug)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned elsewhere in the comments, I'm assuming there are changes to a field_table file to use these new tracers?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there is a new field_table. Where in the tree would I commit that file?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that the field_tables are in this or the parent (ufs-weather-model) repository anywhere. I think that they are considered as part of the input data and are typically staged on the platforms where regression tests are performed. You could just attach the field_table that you used as part of a comment in this PR so that the file can be staged when regression tests are done. @climbfuji, do you have a better idea?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, attaching it to the PR is a good idea, thanks.

Model%nqvolg = get_tracer_index(Model%tracer_names, 'graupel_pv', Model%me, Model%master, Model%debug)
Model%nqvolh = get_tracer_index(Model%tracer_names, 'hail_pv', Model%me, Model%master, Model%debug)
Model%ntke = get_tracer_index(Model%tracer_names, 'sgs_tke', Model%me, Model%master, Model%debug)
#ifdef CCPP
Model%nqrimef = get_tracer_index(Model%tracer_names, 'q_rimef', Model%me, Model%master, Model%debug)
Expand Down Expand Up @@ -4177,6 +4189,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
#ifdef CCPP
Model%first_time_step = .true.
Model%restart = restart
Model%cycling = cycling
Model%hydrostatic = hydrostatic
#endif
Model%jdat(1:8) = jdat(1:8)
Expand Down Expand Up @@ -4572,6 +4585,20 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
' num_p3d =',Model%num_p3d, &
' num_p2d =',Model%num_p2d

elseif (Model%imp_physics == Model%imp_physics_nssl) then ! NSSL microphysics
Model%npdf3d = 0
Model%num_p3d = 3
Model%num_p2d = 1
Model%pdfcld = .false.
Model%shcnvcw = .false.
Model%ncnd = 5
Model%nleffr = 1
Model%nieffr = 2
Model%nseffr = 3
if (Model%me == Model%master) print *,' Using NSSL double moment', &
' microphysics', ' num_p3d =',Model%num_p3d, &
' num_p2d =',Model%num_p2d

else if (Model%imp_physics == Model%imp_physics_mg) then ! Morrison-Gettelman Microphysics
Model%npdf3d = 0
Model%num_p3d = 5
Expand Down Expand Up @@ -4880,6 +4907,9 @@ subroutine control_print(Model)
print *, ' ttendlim : ', Model%ttendlim
print *, ' '
endif
if (Model%imp_physics == Model%imp_physics_nssl) then
print *, ' NSSL microphysical parameters'
endif
if (Model%imp_physics == Model%imp_physics_mg) then
print *, ' M-G microphysical parameters'
print *, ' fprcp : ', Model%fprcp
Expand Down Expand Up @@ -5091,12 +5121,16 @@ subroutine control_print(Model)
print *, ' ntrw : ', Model%ntrw
print *, ' ntsw : ', Model%ntsw
print *, ' ntgl : ', Model%ntgl
print *, ' nthl : ', Model%nthl
print *, ' ntclamt : ', Model%ntclamt
print *, ' ntlnc : ', Model%ntlnc
print *, ' ntinc : ', Model%ntinc
print *, ' ntrnc : ', Model%ntrnc
print *, ' ntsnc : ', Model%ntsnc
print *, ' ntgnc : ', Model%ntgnc
print *, ' nthnc : ', Model%nthnc
print *, ' nqvolg : ', Model%nqvolg
print *, ' nqvolh : ', Model%nqvolh
print *, ' ntke : ', Model%ntke
print *, ' nto : ', Model%nto
print *, ' nto2 : ', Model%nto2
Expand Down Expand Up @@ -5147,6 +5181,7 @@ subroutine control_print(Model)
print *, ' sec : ', Model%sec
print *, ' first_time_step : ', Model%first_time_step
print *, ' restart : ', Model%restart
print *, ' cycling : ', Model%cycling
print *, ' hydrostatic : ', Model%hydrostatic
#endif
endif
Expand Down Expand Up @@ -5801,6 +5836,7 @@ end subroutine diag_create
subroutine diag_rad_zero(Diag, Model)
class(GFS_diag_type) :: Diag
type(GFS_control_type), intent(in) :: Model
integer :: i

Diag%fluxr = zero
Diag%topfsw%upfxc = zero
Expand All @@ -5823,6 +5859,7 @@ subroutine diag_phys_zero (Diag, Model, linit, iauwindow_center)
logical,optional, intent(in) :: linit, iauwindow_center

logical set_totprcp
integer :: i

!--- In/Out
Diag%srunoff = zero
Expand Down Expand Up @@ -6445,7 +6482,7 @@ subroutine interstitial_create (Interstitial, IM, Model)
end if
!
! Allocate arrays that are conditional on physics choices
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson) then
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson .or. Model%imp_physics == Model%imp_physics_nssl) then
allocate (Interstitial%graupelmp (IM))
allocate (Interstitial%icemp (IM))
allocate (Interstitial%rainmp (IM))
Expand Down Expand Up @@ -6577,6 +6614,11 @@ subroutine interstitial_setup_tracers(Interstitial, Model)
Interstitial%nncl = 5
endif

if (Model%imp_physics == Model%imp_physics_nssl) then
Interstitial%nvdiff = Model%ntrac
Interstitial%nncl = 5
end if

if (Model%imp_physics == Model%imp_physics_mg) then
if (abs(Model%fprcp) == 1) then
Interstitial%nncl = 4 ! MG2 with rain and snow
Expand Down Expand Up @@ -6660,13 +6702,17 @@ subroutine interstitial_setup_tracers(Interstitial, Model)
do n=2,Model%ntrac
if ( n /= Model%ntcw .and. n /= Model%ntiw .and. n /= Model%ntclamt .and. &
n /= Model%ntrw .and. n /= Model%ntsw .and. n /= Model%ntrnc .and. &
n /= Model%ntsnc .and. n /= Model%ntgl .and. n /= Model%ntgnc) then
! n /= Model%ntlnc .and. n /= Model%ntinc .and. &
n /= Model%ntsnc .and. n /= Model%ntgl .and. n /= Model%ntgnc .and. &
n /= Model%nthl .and. n /= Model%nthnc .and. &
n /= Model%nqvolg .and. n /= Model%nqvolh ) then
tracers = tracers + 1
if (Model%ntke == n ) then
Interstitial%otspt(tracers+1,1) = .false.
Interstitial%ntk = tracers
endif
if (Model%ntlnc == n .or. Model%ntinc == n .or. Model%ntrnc == n .or. Model%ntsnc == n .or. Model%ntgnc == n) &
if (Model%ntlnc == n .or. Model%ntinc == n .or. Model%ntrnc == n .or. Model%ntsnc == n .or. &
Model%ntgnc == n .or. Model%nthnc == n .or. Model%nqvolg == n .or. Model%nqvolh == n) &

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grantfirl @tsupinie
I have been working a parallel effort on this and did a similar thing here (in the SCM first). It seems that this if statement doesn't matter for ntrnc and others that are excluded by the outer if conditional (i.e., n /= model%ntrnc). It looks like only ntlnc == n and ntinc == n would ever trigger this, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that's correct. It looks like that controls which tracers are advected in updrafts and downdrafts in the Chikira-Sugiyama convective scheme, which I've never used. At some point, we'll probably want to run tests to see what settings are best. For now, it's a bit over-complicated, I guess.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I haven't really figured out the subgrid (shallow/deep) convective transport yet. The GFS_suite_interstitial_3_run and GFS_suite_interstitial_4_run routines have a duplicate logic that presumably could be replaced by the otspt array? I'm just looking at 3km dx, so I have those modules removed from the working suite, anyway.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MicroTed, do you have a branch where you have the SCM changes for this scheme? If so, could you point me to it? I'm generally more comfortable testing new schemes out there before FV3, so that would help me out for reviewing this again. Hopefully, we can get this regression tested with the FV3 and get this merged in to master this time around. :)

! if (ntlnc == n .or. ntinc == n .or. ntrnc == n .or. ntsnc == n .or.&
! ntrw == n .or. ntsw == n .or. ntgl == n) &
Interstitial%otspt(tracers+1,1) = .false.
Expand Down Expand Up @@ -7023,7 +7069,7 @@ subroutine interstitial_phys_reset (Interstitial, Model)
end if
!
! Reset fields that are conditional on physics choices
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson) then
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson .or. Model%imp_physics == Model%imp_physics_nssl) then
Interstitial%graupelmp = clear_val
Interstitial%icemp = clear_val
Interstitial%rainmp = clear_val
Expand Down Expand Up @@ -7376,8 +7422,8 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno)
end if
!
! Print arrays that are conditional on physics choices
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson) then
write (0,*) 'Interstitial_print: values specific to GFDL/Thompson microphysics'
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson .or. Model%imp_physics == Model%imp_physics_nssl) then
write (0,*) 'Interstitial_print: values specific to GFDL/Thompson/NSSL microphysics'
write (0,*) 'sum(Interstitial%graupelmp ) = ', sum(Interstitial%graupelmp )
write (0,*) 'sum(Interstitial%icemp ) = ', sum(Interstitial%icemp )
write (0,*) 'sum(Interstitial%rainmp ) = ', sum(Interstitial%rainmp )
Expand Down
Loading