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

Ensure consistency between model namelist and CCPP suite definition file UPDATED with head of MAIN #661

Merged
merged 33 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c14375b
add imp_physics consistency check for Zhao-Carr under physics dir
XiaSun-Atmos Apr 27, 2021
d39a04d
Consistency check for RRTMG scheme
XiaSun-Atmos May 10, 2021
e2b8974
Consistency check for RRTMGP scheme
XiaSun-Atmos May 10, 2021
0c7022d
Consistency check for G-F convection
XiaSun-Atmos May 10, 2021
5d70274
Consistency check for ntiedke convection schemes
XiaSun-Atmos May 10, 2021
a30acf7
Consistency check for GSL drag suite
XiaSun-Atmos May 10, 2021
15f0002
Consistency check for H2O physics
XiaSun-Atmos May 10, 2021
0cde3fb
Consistency check for SAMF deep convection
XiaSun-Atmos May 10, 2021
9b0a91a
Add consistency check for SAMF shallow convection
XiaSun-Atmos May 10, 2021
68b7b20
Consistency check for Noah LSM
XiaSun-Atmos May 10, 2021
cb3567e
Consistency check for RUC LSM
XiaSun-Atmos May 10, 2021
caa28fd
Consistency check for Noah-MP LSM
XiaSun-Atmos May 10, 2021
f0e023a
Consistency check for unified_ugwp
XiaSun-Atmos May 10, 2021
fe70d7b
Consistency check for SHOC PBL scheme
XiaSun-Atmos May 10, 2021
3da5e49
Consistency check for MYJ PBL scheme
XiaSun-Atmos May 10, 2021
ad1e4c8
Consistency check for MYMM PBL scheme
XiaSun-Atmos May 10, 2021
b8e3591
Consistency check for HEDMF PBL scheme
XiaSun-Atmos May 10, 2021
ab814f8
Consistency check for SHOC PBL scheme
XiaSun-Atmos May 10, 2021
a81e22f
Consistency check for TKE-Based EDMF PBL scheme
XiaSun-Atmos May 10, 2021
4956129
Consistency check for Shinhong PBL scheme
XiaSun-Atmos May 10, 2021
317e311
Consistency check for YSU PBL scheme
XiaSun-Atmos May 10, 2021
fd48665
Consistency check for MYJ sfclay scheme
XiaSun-Atmos May 10, 2021
39e21ea
Consistency check for MYNN sfclay scheme
XiaSun-Atmos May 10, 2021
88387d5
Merge remote-tracking branch 'origin/mp_consistency' into consistency…
XiaSun-Atmos May 10, 2021
c88f128
typo fixes
XiaSun-Atmos May 11, 2021
59452cb
Consistency check for cires_ugwp
XiaSun-Atmos May 11, 2021
1d8fa1b
fix some err msg and if statements
XiaSun-Atmos May 12, 2021
50e46a1
minor msg fix
XiaSun-Atmos May 12, 2021
e457e01
Update ysuvdif.F90
XiaSun-Atmos May 14, 2021
b80fe70
fix
XiaSun-Atmos May 14, 2021
a8500a8
add end if in module_MYJSFC_wrapper
XiaSun-Atmos May 14, 2021
b179486
Update cu_gf_driver.F90
XiaSun-Atmos May 19, 2021
37c6b2e
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into HEAD
climbfuji May 19, 2021
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
10 changes: 9 additions & 1 deletion physics/GFS_rrtmg_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ subroutine GFS_rrtmg_setup_init ( &
icliq_sw, crick_proof, ccnorm, &
imp_physics, &
norad_precip, idate, iflip, &
im, faerlw, faersw, aerodp, & ! for consistency checks
do_RRTMGP, im, faerlw, faersw, aerodp, & ! for consistency checks
me, errmsg, errflg)
! ================= subprogram documentation block ================ !
! !
Expand Down Expand Up @@ -188,6 +188,8 @@ subroutine GFS_rrtmg_setup_init ( &
integer, intent(in) :: idate(:)
integer, intent(in) :: iflip
! For consistency checks

logical, intent(in) :: do_RRTMGP
integer, intent(in) :: im
real(kind_phys), intent(in) :: faerlw(:,:,:,:)
real(kind_phys), intent(in) :: faersw(:,:,:,:)
Expand All @@ -208,6 +210,12 @@ subroutine GFS_rrtmg_setup_init ( &
errflg = 0

if (is_initialized) return

if (do_RRTMGP) then
write(errmsg,'(*(a))') "Logic error: do_RRTMGP must be set to .false."
errflg = 1
return
end if

! Consistency checks for dimensions of arrays, this is required
! to detect differences in FV3's parameters that are used to
Expand Down
8 changes: 8 additions & 0 deletions physics/GFS_rrtmg_setup.meta
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@
type = integer
intent = in
optional = F
[do_RRTMGP]
standard_name = flag_for_rrtmgp_radiation_scheme
long_name = flag for RRTMGP scheme
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[im]
standard_name = horizontal_dimension
long_name = horizontal dimension
Expand Down
14 changes: 11 additions & 3 deletions physics/GFS_rrtmgp_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ module GFS_rrtmgp_setup
!! \section arg_table_GFS_rrtmgp_setup_init
!! \htmlinclude GFS_rrtmgp_setup_init.html
!!
subroutine GFS_rrtmgp_setup_init(imp_physics, imp_physics_fer_hires, imp_physics_gfdl, &
imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, &
subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, &
imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, &
imp_physics_zhao_carr_pdf, imp_physics_mg, si, levr, ictm, isol, ico2, iaer, ialb, &
iems, ntcw, num_p3d, ntoz, iovr, isubc_sw, isubc_lw, icliq_sw, crick_proof, ccnorm, &
norad_precip, idate, iflip, me, errmsg, errflg)

! Inputs
logical, intent(in) :: do_RRTMGP
integer, intent(in) :: &
imp_physics, & ! Flag for MP scheme
imp_physics_fer_hires, & ! Flag for fer-hires scheme
Expand Down Expand Up @@ -75,7 +76,14 @@ subroutine GFS_rrtmgp_setup_init(imp_physics, imp_physics_fer_hires, imp_physics
errflg = 0

if (is_initialized) return


! Consistency checks
if (.not. do_RRTMGP) then
write(errmsg,'(*(a))') "Logic error: do_RRTMGP must be set to .true."
errflg = 1
return
end if

! Set radiation parameters
isolar = isol ! solar constant control flag
ictmflg = ictm ! data ic time/date control flag
Expand Down
8 changes: 8 additions & 0 deletions physics/GFS_rrtmgp_setup.meta
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
[ccpp-arg-table]
name = GFS_rrtmgp_setup_init
type = scheme
[do_RRTMGP]
standard_name = flag_for_rrtmgp_radiation_scheme
long_name = flag for RRTMGP scheme
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[imp_physics]
standard_name = flag_for_microphysics_scheme
long_name = choice of microphysics scheme
Expand Down
11 changes: 10 additions & 1 deletion physics/cires_ugwp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module cires_ugwp
!
subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
fn_nml2, lonr, latr, levs, ak, bk, dtp, cdmbgwd, cgwf, &
pa_rf_in, tau_rf_in, con_p0, do_ugwp, errmsg, errflg)
pa_rf_in, tau_rf_in, con_p0, gwd_opt,do_ugwp, errmsg, errflg)

!---- initialization of cires_ugwp
implicit none
Expand All @@ -58,6 +58,7 @@ subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
real(kind=kind_phys), intent (in) :: cdmbgwd(:), cgwf(:) ! "scaling" controls for "old" GFS-GW schemes
real(kind=kind_phys), intent (in) :: pa_rf_in, tau_rf_in
real(kind=kind_phys), intent (in) :: con_p0
integer, intent(in) :: gwd_opt
logical, intent (in) :: do_ugwp

character(len=*), intent (in) :: fn_nml2
Expand All @@ -76,6 +77,14 @@ subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, &
errflg = 0

if (is_initialized) return

! Consistency checks
if (gwd_opt/=1) then
write(errmsg,'(*(a))') "Logic error: namelist choice of gravity wave &
& drag is different from cires_ugwp scheme"
errflg = 1
return
end if

if (do_ugwp .or. cdmbgwd(3) > 0.0) then
call cires_ugwpv0_mod_init (me, master, nlunit, input_nml_file, logunit, &
Expand Down
8 changes: 8 additions & 0 deletions physics/cires_ugwp.meta
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@
kind = kind_phys
intent = in
optional = F
[gwd_opt]
standard_name = gwd_opt
long_name = flag to choose gwd scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[do_ugwp]
standard_name = do_ugwp
long_name = flag to activate CIRES UGWP
Expand Down
16 changes: 14 additions & 2 deletions physics/cu_gf_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ module cu_gf_driver
!! \section arg_table_cu_gf_driver_init Argument Table
!! \htmlinclude cu_gf_driver_init.html
!!
subroutine cu_gf_driver_init(mpirank, mpiroot, errmsg, errflg)
subroutine cu_gf_driver_init(imfshalcnv, imfshalcnv_gf, imfdeepcnv, &
imfdeepcnv_gf,mpirank, mpiroot, errmsg, errflg)

implicit none


integer, intent(in) :: imfshalcnv, imfshalcnv_gf
integer, intent(in) :: imfdeepcnv, imfdeepcnv_gf
integer, intent(in) :: mpirank
integer, intent(in) :: mpiroot
character(len=*), intent( out) :: errmsg
Expand All @@ -44,6 +47,15 @@ subroutine cu_gf_driver_init(mpirank, mpiroot, errmsg, errflg)
end if
! *DH temporary

! Consistency checks
if (.not. (imfshalcnv == imfshalcnv_gf .or. &
& imfdeepcnv == imfdeepcnv_gf)) then
write(errmsg,'(*(a))') 'Logic error: namelist choice of', &
& ' convection is different from Grell-Freitas scheme'
errflg = 1
return
end if

end subroutine cu_gf_driver_init

subroutine cu_gf_driver_finalize()
Expand Down
32 changes: 32 additions & 0 deletions physics/cu_gf_driver.meta
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,38 @@
[ccpp-arg-table]
name = cu_gf_driver_init
type = scheme
[imfshalcnv]
standard_name = flag_for_mass_flux_shallow_convection_scheme
long_name = flag for mass-flux shallow convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[imfshalcnv_gf]
standard_name = flag_for_gf_shallow_convection_scheme
long_name = flag for Grell-Freitas shallow convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[imfdeepcnv]
standard_name = flag_for_mass_flux_deep_convection_scheme
long_name = flag for mass-flux deep convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[imfdeepcnv_gf]
standard_name = flag_for_gf_deep_convection_scheme
long_name = flag for Grell-Freitas deep convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[mpirank]
standard_name = mpi_rank
long_name = current MPI-rank
Expand Down
20 changes: 19 additions & 1 deletion physics/cu_ntiedtke.F90
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ module cu_ntiedtke
!! \section arg_table_cu_ntiedtke_init Argument Table
!! \htmlinclude cu_ntiedtke_init.html
!!
subroutine cu_ntiedtke_init(mpirank, mpiroot, errmsg, errflg)
subroutine cu_ntiedtke_init(imfshalcnv, imfshalcnv_ntiedtke, imfdeepcnv, &
imfdeepcnv_ntiedtke,mpirank, mpiroot, errmsg, errflg)

implicit none

integer, intent(in) :: imfshalcnv, imfshalcnv_ntiedtke
integer, intent(in) :: imfdeepcnv, imfdeepcnv_ntiedtke
integer, intent(in) :: mpirank
integer, intent(in) :: mpiroot
character(len=*), intent( out) :: errmsg
Expand All @@ -127,6 +130,21 @@ subroutine cu_ntiedtke_init(mpirank, mpiroot, errmsg, errflg)
end if
! *DH temporary

! Consistency checks
if (imfshalcnv/=imfshalcnv_ntiedtke) then
write(errmsg,'(*(a))') 'Logic error: namelist choice of', &
& ' shallow convection is different from new Tiedtke scheme'
errflg = 1
return
end if

if (imfdeepcnv/=imfdeepcnv_ntiedtke) then
write(errmsg,'(*(a))') 'Logic error: namelist choice of', &
& ' deep convection is different from new Tiedtke scheme'
errflg = 1
return
end if

end subroutine cu_ntiedtke_init

subroutine cu_ntiedtke_finalize()
Expand Down
32 changes: 32 additions & 0 deletions physics/cu_ntiedtke.meta
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,38 @@
[ccpp-arg-table]
name = cu_ntiedtke_init
type = scheme
[imfshalcnv]
standard_name = flag_for_mass_flux_shallow_convection_scheme
long_name = flag for mass-flux shallow convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[imfshalcnv_ntiedtke]
standard_name = flag_for_ntiedtke_shallow_convection_scheme
long_name = flag for new Tiedtke shallow convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[imfdeepcnv]
standard_name = flag_for_mass_flux_deep_convection_scheme
long_name = flag for mass-flux deep convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[imfdeepcnv_ntiedtke]
standard_name = flag_for_ntiedtke_deep_convection_scheme
long_name = flag for new Tiedtke deep convection scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[mpirank]
standard_name = mpi_rank
long_name = current MPI-rank
Expand Down
19 changes: 18 additions & 1 deletion physics/drag_suite.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,24 @@ module drag_suite

contains

subroutine drag_suite_init()
subroutine drag_suite_init(gwd_opt, errmsg, errflg)

integer, intent(in) :: gwd_opt
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg


! Initialize CCPP error handling variables
errmsg = ''
errflg = 0

! Consistency checks
if (gwd_opt/=3 .and. gwd_opt/=33) then
write(errmsg,'(*(a))') "Logic error: namelist choice of gravity wave &
& drag is different from drag_suite scheme"
errflg = 1
return
end if
end subroutine drag_suite_init

! \defgroup GFS_ogwd GFS Orographic Gravity Wave Drag
Expand Down
30 changes: 30 additions & 0 deletions physics/drag_suite.meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,36 @@
type = scheme
dependencies =

########################################################################
[ccpp-arg-table]
name = unified_ugwp_init
type = scheme
[gwd_opt]
standard_name = gwd_opt
long_name = flag to choose gwd scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
units = none
dimensions = ()
type = character
kind = len=*
intent = out
optional = F
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
dimensions = ()
type = integer
intent = out
optional = F

########################################################################
[ccpp-arg-table]
name = drag_suite_run
Expand Down
17 changes: 16 additions & 1 deletion physics/gcm_shoc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,22 @@ module shoc

contains

subroutine shoc_init ()
subroutine shoc_init (do_shoc, errmsg, errflg)
implicit none
logical, intent(in) :: do_shoc
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

! Initialize CCPP error handling variables
errmsg = ''
errflg = 0

! Consistency checks
if (.not. do_shoc) then
errflg = 1
write(errmsg,'(*(a))') 'Logic error: do_shoc == .false.'
return
end if
end subroutine shoc_init

subroutine shoc_finalize ()
Expand Down
Loading