Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for NSSL 2-moment cloud microphysics scheme #761

Merged
merged 77 commits into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
99e3043
- Adds support for NSSL full 2-moment microphysics with droplets, rai…
MicroTed Apr 1, 2021
a13afa1
- Fixes subroutine end statements (causes error on some older compil…
MicroTed Apr 1, 2021
8c25e52
Add missing 'nthl' to call interface
MicroTed Apr 1, 2021
ef29545
- Pass effrr into NSSL driver
MicroTed Apr 2, 2021
dc2a827
Turned off a print statement.
MicroTed Apr 2, 2021
9e30e90
Restore the incorrectly removed flags.
MicroTed Apr 2, 2021
7049163
Turn off setting rain radius for now.
MicroTed Apr 2, 2021
315489b
Fixed typo in meta file
MicroTed Apr 6, 2021
2b95bde
Fixed typo and missing declaration
MicroTed Apr 6, 2021
4b35ce9
- Fixed setting of itimestep on first model step. This was preventin…
MicroTed Apr 8, 2021
1cfe2c8
Turned on zeroing out of hail for low number concentration. Some spu…
MicroTed Apr 9, 2021
c27901c
Added extra printout info for large fall speeds.
MicroTed Apr 12, 2021
21a2875
Call calcnfromq on every time step, which helps keep boundaries a bi…
MicroTed Apr 14, 2021
06fc773
Removed re_rain from interface (not used and not planning to use th…
MicroTed Apr 19, 2021
8ff7b02
Updated calcnfromq to use qxmin_init for higher mass thresholds. Lo…
MicroTed Apr 19, 2021
6d484f7
Changed itimestep to a purely local variable (i.e., not saved)
MicroTed Apr 29, 2021
635e028
Fixed bug in setting array values of "rain" (noticed by E. Aligo)
MicroTed May 9, 2021
9d0fcbd
- Changed from two imp_physics_nssl flags to a single one with secon…
MicroTed Oct 1, 2021
e18f790
Fixed missing setting of save arrays for NSSL.
MicroTed Oct 1, 2021
b565f5f
Update to newer base code plus some cleanup of NSSL microphysics
MicroTed Oct 15, 2021
3b7b139
Made IF test on tracer indices in post_run consistent with pre_run
MicroTed Oct 15, 2021
7e41947
Switched 'vertical_dimension' to 'vertical_layer_dimension'
MicroTed Oct 16, 2021
7e38a90
Added convert_dry_rho flag
MicroTed Oct 16, 2021
b17240a
Removed some commented code; pass in physical constants to init rou…
MicroTed Oct 19, 2021
53658e5
Added dependencies to RUC physics
MicroTed Oct 19, 2021
da10201
Cleaned up unused code and variables.
MicroTed Nov 10, 2021
961d9b6
Merge branch 'feature/nsslmicro' of https://github.com/MicroTed/ccpp-…
MicroTed Nov 10, 2021
4b42e19
- Adds support for NSSL full 2-moment microphysics with droplets, rai…
MicroTed Apr 1, 2021
c8bbd69
- Fixes subroutine end statements (causes error on some older compil…
MicroTed Apr 1, 2021
a5f236f
Add missing 'nthl' to call interface
MicroTed Apr 1, 2021
e38406a
- Pass effrr into NSSL driver
MicroTed Apr 2, 2021
841eab2
Turned off a print statement.
MicroTed Apr 2, 2021
72e7693
Restore the incorrectly removed flags.
MicroTed Apr 2, 2021
d9f2ced
Turn off setting rain radius for now.
MicroTed Apr 2, 2021
2b92bcb
Fixed typo in meta file
MicroTed Apr 6, 2021
8157607
Fixed typo and missing declaration
MicroTed Apr 6, 2021
a8f3948
- Fixed setting of itimestep on first model step. This was preventin…
MicroTed Apr 8, 2021
5944560
Turned on zeroing out of hail for low number concentration. Some spu…
MicroTed Apr 9, 2021
3ec235b
Added extra printout info for large fall speeds.
MicroTed Apr 12, 2021
74dd53c
Call calcnfromq on every time step, which helps keep boundaries a bi…
MicroTed Apr 14, 2021
4ccadc0
Removed re_rain from interface (not used and not planning to use th…
MicroTed Apr 19, 2021
b4d0379
Updated calcnfromq to use qxmin_init for higher mass thresholds. Lo…
MicroTed Apr 19, 2021
eae593d
Changed itimestep to a purely local variable (i.e., not saved)
MicroTed Apr 29, 2021
48983e8
Fixed bug in setting array values of "rain" (noticed by E. Aligo)
MicroTed May 9, 2021
115aeb0
- Changed from two imp_physics_nssl flags to a single one with secon…
MicroTed Oct 1, 2021
5b95964
Fixed missing setting of save arrays for NSSL.
MicroTed Oct 1, 2021
6920e48
Update to newer base code plus some cleanup of NSSL microphysics
MicroTed Oct 15, 2021
9d77cb1
Made IF test on tracer indices in post_run consistent with pre_run
MicroTed Oct 15, 2021
3e28640
Switched 'vertical_dimension' to 'vertical_layer_dimension'
MicroTed Oct 16, 2021
a3a6c1b
Added convert_dry_rho flag
MicroTed Oct 16, 2021
b2a5a94
Removed some commented code; pass in physical constants to init rou…
MicroTed Oct 19, 2021
383cb3c
Cleaned up unused code and variables.
MicroTed Nov 10, 2021
938d5f2
Added dependencies to RUC physics
MicroTed Oct 19, 2021
906248e
Removed a bunch of "optional = F" from meta files.
MicroTed Dec 8, 2021
c500790
Merge remote-tracking branch 'tedsrepo/feature/nsslmicro_rebase2' int…
MicroTed Dec 9, 2021
0aeccf6
Merge commit 'aae0d5f281f4f9f41fa8287ac326823a9910207f' into feature/…
MicroTed Jan 15, 2022
b88049a
Update progcld6 call for NSSL microphysics
MicroTed Jan 15, 2022
91b8bae
Merge branch 'feature/nsslmicro_rebase2_merge23dec' into feature/nssl…
MicroTed Jan 15, 2022
2808afc
Merge remote-tracking branch 'origin/main' into feature/nsslmicro
MicroTed Jan 27, 2022
6f43cc4
Update errflg
MicroTed Jan 27, 2022
86592d1
Remove extra blank lines and unneeded check for imp_physics=18
MicroTed Jan 27, 2022
be6335a
standard name bugfixes for mp_nssl.meta and module_MYNNPBL_wrapper.meta
grantfirl Jan 31, 2022
59885ea
change dimensions of flag_convective_tracer_transport_interstitial to…
grantfirl Jan 31, 2022
f1d49d1
Tweaks to snow aggregation (slight reduction to help reduce excess r…
MicroTed Feb 1, 2022
94db3c0
Merge branch 'feature/nsslmicro' into feature/nsslmicro_gjf
grantfirl Feb 1, 2022
a51c4a2
Merge pull request #1 from grantfirl/feature/nsslmicro_gjf
MicroTed Feb 1, 2022
1cd31f9
Reduced dtpmax to 60 to maintain stability based on new tests
MicroTed Feb 11, 2022
2c02bc5
Reduce potential sedimentation computation with interval_sedi_vt=2
MicroTed Feb 13, 2022
779c432
update some flag units and remove GFS_suite_interstitial dependency o…
grantfirl Feb 14, 2022
b104184
convert argument arrays in mp_nssl.F90 to assumed-shape
grantfirl Feb 14, 2022
a2a7f8b
Merge pull request #2 from grantfirl/feature/nsslmicro_gjf
MicroTed Feb 15, 2022
5da3050
Merge branch 'main' into feature/nsslmicro
MicroTed Feb 17, 2022
a9349ed
Added internal documentation (for doxygen).
MicroTed Feb 24, 2022
580df44
Merge branch 'main' into feature/nsslmicro
MicroTed Feb 24, 2022
44a2bd9
Add logic to reduce optimization for multiple files, independent of t…
climbfuji Mar 3, 2022
4d808f8
No optimization for GFS_typedefs.F90
climbfuji Mar 3, 2022
dc5ed83
Merge branch 'feature/reduce_opt_gfs_typedefs' into feature/nsslmicro
MicroTed Mar 3, 2022
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
33 changes: 28 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ else(TYPEDEFS)
include(${CMAKE_CURRENT_BINARY_DIR}/CCPP_TYPEDEFS.cmake)
message(STATUS "Got CCPP TYPEDEFS from cmakefile include file")
endif(TYPEDEFS)
list(REMOVE_DUPLICATES TYPEDEFS)

# Generate list of Fortran modules from the CCPP type
# definitions that need need to be installed
Expand All @@ -58,6 +59,7 @@ else(SCHEMES)
include(${CMAKE_CURRENT_BINARY_DIR}/CCPP_SCHEMES.cmake)
message(STATUS "Got CCPP SCHEMES from cmakefile include file")
endif(SCHEMES)
list(REMOVE_DUPLICATES SCHEMES)

# Set the sources: physics scheme caps
set(CAPS $ENV{CCPP_CAPS})
Expand All @@ -67,6 +69,7 @@ else(CAPS)
include(${CMAKE_CURRENT_BINARY_DIR}/CCPP_CAPS.cmake)
message(STATUS "Got CCPP CAPS from cmakefile include file")
endif(CAPS)
list(REMOVE_DUPLICATES CAPS)

# Schemes and caps from the CCPP code generator use full paths with symlinks
# resolved, we need to do the same here for the below logic to work
Expand Down Expand Up @@ -141,12 +144,32 @@ endif()
SET_PROPERTY(SOURCE ${SCHEMES} ${CAPS}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PHYSICS} ${OpenMP_Fortran_FLAGS}")

# Reduce optimization for module_sf_mynn.F90 (to avoid an apparent compiler bug with Intel 18 on Hera)
if(${LOCAL_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90 IN_LIST SCHEMES AND
(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "Bitforbit") AND
# Lower optimization for certain schemes when compiling with Intel in Release mode
if((CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "Bitforbit") AND
${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
# Define a list of schemes that need lower optimization with Intel in Release mode
set(SCHEME_NAMES_LOWER_OPTIMIZATION module_sf_mynn.F90)
foreach(SCHEME_NAME IN LISTS SCHEME_NAMES_LOWER_OPTIMIZATION)
set(SCHEMES_TMP ${SCHEMES})
# Need to determine the name of the scheme with its path
list(FILTER SCHEMES_TMP INCLUDE REGEX ".*${SCHEME_NAME}$")
SET_SOURCE_FILES_PROPERTIES(${SCHEMES_TMP}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PHYSICS} ${OpenMP_Fortran_FLAGS} -O1")
endforeach()
endif()

# No optimization for certain schemes when compiling with Intel in Release mode
if((CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "Bitforbit") AND
${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
SET_SOURCE_FILES_PROPERTIES(${LOCAL_CURRENT_SOURCE_DIR}/physics/module_sf_mynn.F90
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PHYSICS} ${OpenMP_Fortran_FLAGS} -O1")
# Define a list of schemes that can't be optimized with Intel in Release mode
set(SCHEME_NAMES_NO_OPTIMIZATION GFS_typedefs.F90)
foreach(SCHEME_NAME IN LISTS SCHEME_NAMES_NO_OPTIMIZATION)
set(SCHEMES_TMP ${SCHEMES})
# Need to determine the name of the scheme with its path
list(FILTER SCHEMES_TMP INCLUDE REGEX ".*${SCHEME_NAME}$")
SET_SOURCE_FILES_PROPERTIES(${SCHEMES_TMP}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PHYSICS} ${OpenMP_Fortran_FLAGS} -O0")
endforeach()
endif()

# Reduce optimization for mo_gas_optics_kernels.F90 (to avoid an apparent compiler bug with Intel 19+)
Expand Down
19 changes: 13 additions & 6 deletions physics/GFS_DCNV_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc
gu0, gv0, gt0, gq0, nsamftrac, ntqv, &
save_u, save_v, save_t, save_q, clw, &
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, &
ntgnc, cscnv, satmedmf, trans_trac, ras, ntrac, &
ntgnc, nthl, nthnc, nthv, ntgv, &
cscnv, satmedmf, trans_trac, ras, ntrac, &
dtidx, index_of_process_dcnv, errmsg, errflg)

use machine, only: kind_phys

implicit none

integer, intent(in) :: im, levs, nsamftrac, ntqv, index_of_process_dcnv, dtidx(:,:), &
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntrac,ntgnc
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntrac,ntgnc,nthl,nthnc,nthv,ntgv
logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm
real(kind=kind_phys), dimension(:,:), intent(in) :: gu0
real(kind=kind_phys), dimension(:,:), intent(in) :: gv0
Expand Down Expand Up @@ -71,7 +72,9 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc
do n=2,ntrac
if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. &
n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. &
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc) then
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc .and. &
n /= nthl .and. n /= nthnc .and. n /= nthv .and. &
n /= ntgv ) then
tracers = tracers + 1
if(dtidx(100+n,index_of_process_dcnv)>0) then
save_q(:,:,n) = clw(:,:,tracers)
Expand Down Expand Up @@ -111,7 +114,8 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, &
rainc, cldwrk, upd_mf, dwn_mf, det_mf, dtend, dtidx, index_of_process_dcnv, &
index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gq0, save_q, &
cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, flag_for_dcnv_generic_tend, &
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc, ntrac,clw, &
ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, &
ntgnc, nthl, nthnc, nthv, ntgv, ntrac,clw, &
satmedmf, trans_trac, errmsg, errflg)


Expand Down Expand Up @@ -140,7 +144,8 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, &
real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend
integer, intent(in) :: dtidx(:,:), index_of_process_dcnv, index_of_temperature, &
index_of_x_wind, index_of_y_wind, ntqv
integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntrac,ntgnc
integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, &
ntgnc, nthl, nthnc, nthv, ntgv, ntrac
real(kind=kind_phys), dimension(:,:,:), intent(in) :: clw


Expand Down Expand Up @@ -205,7 +210,9 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, &
do n=2,ntrac
if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. &
n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. &
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc) then
n /= ntsnc .and. n /= ntgl .and. n /= ntgnc .and. &
n /= nthl .and. n /= nthnc .and. n /= nthv .and. &
n /= ntgv ) then
tracers = tracers + 1
idtend = dtidx(100+n,index_of_process_dcnv)
if(idtend>0) then
Expand Down
56 changes: 56 additions & 0 deletions physics/GFS_DCNV_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,34 @@
dimensions = ()
type = integer
intent = in
[nthl]
standard_name = index_of_hail_mixing_ratio_in_tracer_concentration_array
long_name = tracer index for hail
units = index
dimensions = ()
type = integer
intent = in
[nthnc]
standard_name = index_of_mass_number_concentration_of_hail_in_tracer_concentration_array
long_name = tracer index for hail number concentration
units = index
dimensions = ()
type = integer
intent = in
[ntgv]
standard_name = index_of_graupel_volume_in_tracer_concentration_array
long_name = tracer index for graupel particle volume
units = index
dimensions = ()
type = integer
intent = in
[nthv]
standard_name = index_of_hail_volume_in_tracer_concentration_array
long_name = tracer index for hail particle volume
units = index
dimensions = ()
type = integer
intent = in
[clw]
standard_name = convective_transportable_tracers
long_name = array to contain cloud water and other convective trans. tracers
Expand Down Expand Up @@ -684,6 +712,34 @@
dimensions = ()
type = integer
intent = in
[nthl]
standard_name = index_of_hail_mixing_ratio_in_tracer_concentration_array
long_name = tracer index for hail
units = index
dimensions = ()
type = integer
intent = in
[nthnc]
standard_name = index_of_mass_number_concentration_of_hail_in_tracer_concentration_array
long_name = tracer index for hail number concentration
units = index
dimensions = ()
type = integer
intent = in
[ntgv]
standard_name = index_of_graupel_volume_in_tracer_concentration_array
long_name = tracer index for graupel particle volume
units = index
dimensions = ()
type = integer
intent = in
[nthv]
standard_name = index_of_hail_volume_in_tracer_concentration_array
long_name = tracer index for hail particle volume
units = index
dimensions = ()
type = integer
intent = in
[clw]
standard_name = convective_transportable_tracers
long_name = array to contain cloud water and other convective trans. tracers
Expand Down
11 changes: 6 additions & 5 deletions physics/GFS_MP_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ end subroutine GFS_MP_generic_post_init
!> \section gfs_mp_gen GFS MP Generic Post General Algorithm
!> @{
subroutine GFS_MP_generic_post_run( &
im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, &
im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, &
imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, con_g, rainmin, dtf, frain, rainc, &
rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0,&
graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, &
Expand All @@ -103,6 +103,7 @@ subroutine GFS_MP_generic_post_run(

integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires
integer, intent(in) :: imp_physics_nssl
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm
integer, intent(in) :: index_of_temperature,index_of_process_mp

Expand Down Expand Up @@ -193,12 +194,11 @@ subroutine GFS_MP_generic_post_run(
ice = ice0
snow = snow0
! Do it right from the beginning for Thompson
else if (imp_physics == imp_physics_thompson) then
else if (imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_nssl ) then
tprcp = max (zero, rainc + frain * rain1) ! time-step convective and explicit precip
graupel = frain*graupel0 ! time-step graupel
ice = frain*ice0 ! time-step ice
snow = frain*snow0 ! time-step snow

else if (imp_physics == imp_physics_fer_hires) then
tprcp = max (zero, rain) ! time-step convective and explicit precip
ice = frain*rain1*sr ! time-step ice
Expand Down Expand Up @@ -233,7 +233,7 @@ subroutine GFS_MP_generic_post_run(
!
! HCHUANG: use new precipitation type to decide snow flag for LSM snow accumulation

if (imp_physics /= imp_physics_gfdl .and. imp_physics /= imp_physics_thompson) then
if (imp_physics /= imp_physics_gfdl .and. imp_physics /= imp_physics_thompson .and. imp_physics /= imp_physics_nssl) then
do i=1,im
tprcp(i) = max(zero, rain(i) )
if(doms(i) > zero .or. domip(i) > zero) then
Expand Down Expand Up @@ -320,7 +320,8 @@ subroutine GFS_MP_generic_post_run(
!! and convective rainfall from the cumulus scheme if the surface temperature is below
!! \f$0^oC\f$.

if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson) then
if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson .or. &
imp_physics == imp_physics_nssl ) then

! determine convective rain/snow by surface temperature
! determine large-scale rain/snow by rain/snow coming out directly from MP
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_MP_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@
dimensions = ()
type = integer
intent = in
[imp_physics_nssl]
standard_name = identifier_for_nssl_microphysics_scheme
long_name = choice of NSSL 2-moment microphysics scheme
units = flag
dimensions = ()
type = integer
intent = in
[cal_pre]
standard_name = flag_for_dominant_precipitation_type_partition
long_name = flag controls precip type algorithm
Expand Down
Loading