diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 9d0e42643..aa5f3f4ca 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -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 ================ ! ! ! @@ -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(:,:,:,:) @@ -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 diff --git a/physics/GFS_rrtmg_setup.meta b/physics/GFS_rrtmg_setup.meta index 513594ab2..b75c8b044 100644 --- a/physics/GFS_rrtmg_setup.meta +++ b/physics/GFS_rrtmg_setup.meta @@ -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 diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index a55c84ae7..ff82ba779 100644 --- a/physics/GFS_rrtmgp_setup.F90 +++ b/physics/GFS_rrtmgp_setup.F90 @@ -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 @@ -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 diff --git a/physics/GFS_rrtmgp_setup.meta b/physics/GFS_rrtmgp_setup.meta index 7890d3d48..8c436fe62 100644 --- a/physics/GFS_rrtmgp_setup.meta +++ b/physics/GFS_rrtmgp_setup.meta @@ -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 diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 8f06b5401..38496eeb7 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -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 @@ -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 @@ -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, & diff --git a/physics/cires_ugwp.meta b/physics/cires_ugwp.meta index e2afbf70f..cf9992624 100644 --- a/physics/cires_ugwp.meta +++ b/physics/cires_ugwp.meta @@ -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 diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 27165e067..c17aaec76 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -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 @@ -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() diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta index f27b2cc91..73ce19754 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/cu_gf_driver.meta @@ -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 diff --git a/physics/cu_ntiedtke.F90 b/physics/cu_ntiedtke.F90 index 0fab755dc..c9b95a816 100644 --- a/physics/cu_ntiedtke.F90 +++ b/physics/cu_ntiedtke.F90 @@ -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 @@ -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() diff --git a/physics/cu_ntiedtke.meta b/physics/cu_ntiedtke.meta index 70e977eed..4d4c6597a 100644 --- a/physics/cu_ntiedtke.meta +++ b/physics/cu_ntiedtke.meta @@ -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 diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 index 92a1c0bd3..1d83fec1c 100644 --- a/physics/drag_suite.F90 +++ b/physics/drag_suite.F90 @@ -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 diff --git a/physics/drag_suite.meta b/physics/drag_suite.meta index 26912cee4..28b0269e9 100644 --- a/physics/drag_suite.meta +++ b/physics/drag_suite.meta @@ -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 diff --git a/physics/gcm_shoc.F90 b/physics/gcm_shoc.F90 index 97d12c3f6..4852310fc 100644 --- a/physics/gcm_shoc.F90 +++ b/physics/gcm_shoc.F90 @@ -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 () diff --git a/physics/gcm_shoc.meta b/physics/gcm_shoc.meta index 047286317..b021fa306 100644 --- a/physics/gcm_shoc.meta +++ b/physics/gcm_shoc.meta @@ -3,6 +3,36 @@ type = scheme dependencies = funcphys.f90,machine.F +######################################################################## +[ccpp-arg-table] + name = shoc_init + type = scheme +[do_shoc] + standard_name = flag_for_shoc + long_name = flag for SHOC + units = flag + dimensions = () + type = logical + 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 = shoc_run diff --git a/physics/gscond.f b/physics/gscond.f index 6466d989d..1606bc93a 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -5,14 +5,50 @@ !> This module contains the CCPP-compliant zhao_carr_gscond scheme. module zhaocarr_gscond - contains + + implicit none + public :: zhaocarr_gscond_init, zhaocarr_gscond_run, & + & zhaocarr_gscond_finalize + private + logical :: is_initialized = .False. + contains ! \brief Brief description of the subroutine ! !> \section arg_table_zhaocarr_gscond_init Argument Table !! - subroutine zhaocarr_gscond_init + subroutine zhaocarr_gscond_init (imp_physics, & + & imp_physics_zhao_carr, & + & imp_physics_zhao_carr_pdf, & + & errmsg, errflg) + implicit none + + ! Interface variables + integer, intent(in ) :: imp_physics + integer, intent(in ) :: imp_physics_zhao_carr, & + & imp_physics_zhao_carr_pdf + + ! CCPP error handling + character(len=*), intent( out) :: errmsg + integer, intent( out) :: errflg + + ! Initialize the CCPP error handling variables + errmsg = '' + errflg = 0 + + if (is_initialized) return + + ! Consistency checks + if (imp_physics/=imp_physics_zhao_carr .and. & + & imp_physics/=imp_physics_zhao_carr_pdf) then + write(errmsg,'(*(a))') "Logic error: namelist choice of & + & microphysics is different from Zhao-Carr MP" + errflg = 1 + return + end if + + is_initialized = .true. end subroutine zhaocarr_gscond_init ! \brief Brief description of the subroutine diff --git a/physics/gscond.meta b/physics/gscond.meta index d8eb2f01e..006fe4472 100644 --- a/physics/gscond.meta +++ b/physics/gscond.meta @@ -7,6 +7,47 @@ [ccpp-arg-table] name = zhaocarr_gscond_init type = scheme +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr] + standard_name = flag_for_zhao_carr_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr_pdf] + standard_name = flag_for_zhao_carr_pdf_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme with PDF clouds + 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] diff --git a/physics/h2ophys.f b/physics/h2ophys.f index 502ef9796..863f4f45a 100644 --- a/physics/h2ophys.f +++ b/physics/h2ophys.f @@ -12,7 +12,22 @@ module h2ophys contains - subroutine h2ophys_init() + subroutine h2ophys_init(h2o_phys, errmsg, errflg) + + implicit none + logical, intent(in) :: h2o_phys + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not.h2o_phys) then + write (errmsg,'(*(a))') 'Logic error: h2o_phys == .false.' + errflg = 1 + return + endif end subroutine h2ophys_init !>\defgroup GFS_h2ophys GFS Water Vapor Photochemical Production and Loss Module diff --git a/physics/h2ophys.meta b/physics/h2ophys.meta index 62db330f4..76451d537 100644 --- a/physics/h2ophys.meta +++ b/physics/h2ophys.meta @@ -3,6 +3,36 @@ type = scheme dependencies = machine.F +######################################################################## +[ccpp-arg-table] + name = h2ophys_init + type = scheme +[h2o_phys] + standard_name = flag_for_stratospheric_water_vapor_physics + long_name = flag for stratospheric water vapor physics + units = flag + dimensions = () + type = logical + 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 = h2ophys_run diff --git a/physics/module_MYJPBL_wrapper.F90 b/physics/module_MYJPBL_wrapper.F90 index e789ac035..11cbde679 100644 --- a/physics/module_MYJPBL_wrapper.F90 +++ b/physics/module_MYJPBL_wrapper.F90 @@ -8,7 +8,22 @@ MODULE myjpbl_wrapper contains - subroutine myjpbl_wrapper_init () + subroutine myjpbl_wrapper_init (do_myjpbl,errmsg,errflg) + + logical, intent(in) :: do_myjpbl + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Consistency checks + if (.not. do_myjpbl) then + write(errmsg,fmt='(*(a))') 'Logic error: do_myjpbl=.false.' + errflg = 1 + return + end if end subroutine myjpbl_wrapper_init subroutine myjpbl_wrapper_finalize () diff --git a/physics/module_MYJPBL_wrapper.meta b/physics/module_MYJPBL_wrapper.meta index d241c6f7e..9d70397e7 100644 --- a/physics/module_MYJPBL_wrapper.meta +++ b/physics/module_MYJPBL_wrapper.meta @@ -3,6 +3,36 @@ type = scheme dependencies = module_BL_MYJPBL.F90 +######################################################################## +[ccpp-arg-table] + name = myjpbl_wrapper_init + type = scheme +[do_myjpbl] + standard_name = do_myjpbl + long_name = flag to activate MYJ PBL scheme + units = flag + dimensions = () + type = logical + 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 = myjpbl_wrapper_run diff --git a/physics/module_MYJSFC_wrapper.F90 b/physics/module_MYJSFC_wrapper.F90 index d908900c4..3d2b2e017 100644 --- a/physics/module_MYJSFC_wrapper.F90 +++ b/physics/module_MYJSFC_wrapper.F90 @@ -8,7 +8,23 @@ MODULE myjsfc_wrapper contains - subroutine myjsfc_wrapper_init () + subroutine myjsfc_wrapper_init (do_myjsfc, & + & errmsg,errflg) + + logical, intent(in) :: do_myjsfc + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Consistency checks + if (.not. do_myjsfc) then + write(errmsg,fmt='(*(a))') 'Logic error: do_myjsfc = .false.' + errflg = 1 + return + end if end subroutine myjsfc_wrapper_init subroutine myjsfc_wrapper_finalize () diff --git a/physics/module_MYJSFC_wrapper.meta b/physics/module_MYJSFC_wrapper.meta index f3ec33193..828e584e1 100644 --- a/physics/module_MYJSFC_wrapper.meta +++ b/physics/module_MYJSFC_wrapper.meta @@ -3,6 +3,36 @@ type = scheme dependencies = module_SF_JSFC.F90 +######################################################################## +[ccpp-arg-table] + name = myjsfc_wrapper_init + type = scheme +[do_myjsfc] + standard_name = do_myjsfc + long_name = flag to activate MYJ surface layer scheme + units = flag + dimensions = () + type = logical + 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 = myjsfc_wrapper_run diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 837cf8594..3101f79e3 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -13,9 +13,10 @@ MODULE mynnedmf_wrapper !> \section arg_table_mynnedmf_wrapper_init Argument Table !! \htmlinclude mynnedmf_wrapper_init.html !! - subroutine mynnedmf_wrapper_init (lheatstrg, errmsg, errflg) + subroutine mynnedmf_wrapper_init (do_mynnedmf, lheatstrg, errmsg, errflg) implicit none - + + logical, intent(in) :: do_mynnedmf logical, intent(in) :: lheatstrg character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -24,6 +25,13 @@ subroutine mynnedmf_wrapper_init (lheatstrg, errmsg, errflg) errmsg = '' errflg = 0 + ! Consistency checks + if (.not. do_mynnedmf) then + errmsg = 'Logic error: do_mynnedmf = .false.' + errflg = 1 + return + end if + if (lheatstrg) then errmsg = 'Logic error: lheatstrg not implemented for MYNN PBL' errflg = 1 diff --git a/physics/module_MYNNPBL_wrapper.meta b/physics/module_MYNNPBL_wrapper.meta index 36ff3b067..de24fcbef 100644 --- a/physics/module_MYNNPBL_wrapper.meta +++ b/physics/module_MYNNPBL_wrapper.meta @@ -7,6 +7,14 @@ [ccpp-arg-table] name = mynnedmf_wrapper_init type = scheme +[do_mynnedmf] + standard_name = do_mynnedmf + long_name = flag to activate MYNN-EDMF + units = flag + dimensions = () + type = logical + intent = in + optional = F [lheatstrg] standard_name = flag_for_canopy_heat_storage long_name = flag for canopy heat storage parameterization diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 index 2de8cd408..a27b02e0d 100644 --- a/physics/module_MYNNSFC_wrapper.F90 +++ b/physics/module_MYNNSFC_wrapper.F90 @@ -15,8 +15,10 @@ MODULE mynnsfc_wrapper !! \htmlinclude mynnsfc_wrapper_init.html !! - subroutine mynnsfc_wrapper_init(errmsg, errflg) + subroutine mynnsfc_wrapper_init(do_mynnsfclay, & + & errmsg, errflg) + logical, intent(in) :: do_mynnsfclay character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -24,6 +26,13 @@ subroutine mynnsfc_wrapper_init(errmsg, errflg) errmsg = '' errflg = 0 + ! Consistency checks + if (.not. do_mynnsfclay) then + write(errmsg,fmt='(*(a))') 'Logic error: do_mynnsfclay = .false.' + errflg = 1 + return + end if + ! initialize tables for psih and psim (stable and unstable) CALL PSI_INIT(psi_opt,errmsg,errflg) diff --git a/physics/module_MYNNSFC_wrapper.meta b/physics/module_MYNNSFC_wrapper.meta index 1f16ff161..0bb56a07b 100644 --- a/physics/module_MYNNSFC_wrapper.meta +++ b/physics/module_MYNNSFC_wrapper.meta @@ -7,6 +7,14 @@ [ccpp-arg-table] name = mynnsfc_wrapper_init type = scheme +[do_mynnsfclay] + standard_name = do_mynnsfclay + long_name = flag to activate MYNN surface layer + units = flag + dimensions = () + type = logical + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 2abd2226c..326a96953 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -11,16 +11,26 @@ module hedmf !> \section arg_table_hedmf_init Argument Table !! \htmlinclude hedmf_init.html !! - subroutine hedmf_init (moninq_fac,errmsg,errflg) + subroutine hedmf_init (hybedmf,moninq_fac,errmsg,errflg) use machine, only : kind_phys implicit none - real(kind=kind_phys), intent(in ) :: moninq_fac + + logical, intent(in) :: hybedmf + + real(kind=kind_phys), intent(in) :: moninq_fac character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + ! Consistency checks + if (.not. hybedmf) then + errflg = 1 + write(errmsg,'(*(a))') 'Logic error: hybedmf = .false.' + return + end if + if (moninq_fac == 0) then errflg = 1 write(errmsg,'(*(a))') 'Logic error: moninq_fac == 0', diff --git a/physics/moninedmf.meta b/physics/moninedmf.meta index 7cda18a5c..24096cbe6 100644 --- a/physics/moninedmf.meta +++ b/physics/moninedmf.meta @@ -7,6 +7,14 @@ [ccpp-arg-table] name = hedmf_init type = scheme +[hybedmf] + standard_name = flag_for_hedmf + long_name = flag for hybrid edmf pbl scheme (moninedmf) + units = flag + dimensions = () + type = logical + intent = in + optional = F [moninq_fac] standard_name = atmosphere_diffusivity_coefficient_factor long_name = multiplicative constant for atmospheric diffusivities diff --git a/physics/moninshoc.f b/physics/moninshoc.f index 7fe652d1b..199c85aa2 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -6,7 +6,24 @@ module moninshoc contains - subroutine moninshoc_init () + subroutine moninshoc_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 moninshoc_init subroutine moninshoc_finalize () diff --git a/physics/moninshoc.meta b/physics/moninshoc.meta index 5cff902d7..51f2c4536 100644 --- a/physics/moninshoc.meta +++ b/physics/moninshoc.meta @@ -3,6 +3,36 @@ type = scheme dependencies = funcphys.f90,machine.F,tridi.f +######################################################################## +[ccpp-arg-table] + name = moninshoc_init + type = scheme +[do_shoc] + standard_name = flag_for_shoc + long_name = flag for SHOC + units = flag + dimensions = () + type = logical + 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 = moninshoc_run diff --git a/physics/precpd.f b/physics/precpd.f index 2cc2e169a..2279356b3 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -4,9 +4,44 @@ !> This module contains the CCPP-compliant zhao_carr_precpd scheme. module zhaocarr_precpd + + implicit none + public :: zhaocarr_precpd_init, zhaocarr_precpd_run, & + & zhaocarr_precpd_finalize + private + logical :: is_initialized = .False. contains - subroutine zhaocarr_precpd_init () + subroutine zhaocarr_precpd_init (imp_physics, & + & imp_physics_zhao_carr, & + & imp_physics_zhao_carr_pdf, & + & errmsg, errflg) + implicit none + + ! Interface variables + integer, intent(in ) :: imp_physics + integer, intent(in ) :: imp_physics_zhao_carr, & + & imp_physics_zhao_carr_pdf + ! CCPP error handling + character(len=*), intent( out) :: errmsg + integer, intent( out) :: errflg + + ! Initialize the CCPP error handling variables + errmsg = '' + errflg = 0 + + if (is_initialized) return + + ! Consistency checks + if (imp_physics/=imp_physics_zhao_carr .and. & + & imp_physics/=imp_physics_zhao_carr_pdf) then + write(errmsg,'(*(a))') "Logic error: namelist choice of & + & microphysics is different from Zhao-Carr MP" + errflg = 1 + return + end if + + is_initialized = .true. end subroutine zhaocarr_precpd_init !> \defgroup precip GFS precpd Main diff --git a/physics/precpd.meta b/physics/precpd.meta index 715991990..4a8009113 100644 --- a/physics/precpd.meta +++ b/physics/precpd.meta @@ -3,6 +3,52 @@ type = scheme dependencies = funcphys.f90,machine.F,physcons.F90 +######################################################################## +[ccpp-arg-table] + name = zhaocarr_precpd_init + type = scheme +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr] + standard_name = flag_for_zhao_carr_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr_pdf] + standard_name = flag_for_zhao_carr_pdf_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme with PDF clouds + 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 = zhaocarr_precpd_run diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index a0d884e03..425aa92a9 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -10,7 +10,23 @@ module samfdeepcnv contains - subroutine samfdeepcnv_init() + subroutine samfdeepcnv_init(imfdeepcnv,imfdeepcnv_samf, & + & errmsg, errflg) + + integer, intent(in) :: imfdeepcnv + integer, intent(in) :: imfdeepcnv_samf + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + + ! Consistency checks + if (imfdeepcnv/=imfdeepcnv_samf) then + write(errmsg,'(*(a))') 'Logic error: namelist choice of', & + & ' deep convection is different from SAMF scheme' + errflg = 1 + return + end if + end subroutine samfdeepcnv_init subroutine samfdeepcnv_finalize() diff --git a/physics/samfdeepcnv.meta b/physics/samfdeepcnv.meta index 802aeb50a..ff3c0d115 100644 --- a/physics/samfdeepcnv.meta +++ b/physics/samfdeepcnv.meta @@ -3,6 +3,44 @@ type = scheme dependencies = funcphys.f90,machine.F,samfaerosols.F +######################################################################## +[ccpp-arg-table] + name = samfdeepcnv_init + type = scheme +[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_samf] + standard_name = flag_for_samf_deep_convection_scheme + long_name = flag for SAMF deep convection 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 = samfdeepcnv_run diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index f2a22b38c..1697cfe35 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -9,7 +9,23 @@ module samfshalcnv contains - subroutine samfshalcnv_init() + subroutine samfshalcnv_init(imfshalcnv, imfshalcnv_samf, & + & errmsg, errflg) + + integer, intent(in) :: imfshalcnv + integer, intent(in) :: imfshalcnv_samf + + ! CCPP error handling + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Consistency checks + if (imfshalcnv/=imfshalcnv_samf) then + write(errmsg,'(*(a))') 'Logic error: namelist choice of', & + & ' shallow convection is different from SAMF' + errflg = 1 + return + end if end subroutine samfshalcnv_init subroutine samfshalcnv_finalize() diff --git a/physics/samfshalcnv.meta b/physics/samfshalcnv.meta index 7f5421b70..a454da3e7 100644 --- a/physics/samfshalcnv.meta +++ b/physics/samfshalcnv.meta @@ -3,6 +3,44 @@ type = scheme dependencies = funcphys.f90,machine.F,samfaerosols.F +######################################################################## +[ccpp-arg-table] + name = samfshalcnv_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_samf] + standard_name = flag_for_samf_shallow_convection_scheme + long_name = flag for SAMF shallow convection 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 = samfshalcnv_run diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index b3e9af21f..610d79bfe 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -10,9 +10,11 @@ module satmedmfvdif !> \section arg_table_satmedmfvdif_init Argument Table !! \htmlinclude satmedmfvdif_init.html !! - subroutine satmedmfvdif_init (isatmedmf,isatmedmf_vdif, + subroutine satmedmfvdif_init (satmedmf, + & isatmedmf,isatmedmf_vdif, & errmsg,errflg) + logical, intent(in) :: satmedmf integer, intent(in) :: isatmedmf,isatmedmf_vdif character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -21,6 +23,13 @@ subroutine satmedmfvdif_init (isatmedmf,isatmedmf_vdif, errmsg = '' errflg = 0 +! Consistency checks + if (.not. satmedmf) then + write(errmsg,fmt='(*(a))') 'Logic error: satmedmf = .false.' + errflg = 1 + return + end if + if (.not. isatmedmf==isatmedmf_vdif) then write(errmsg,fmt='(*(a))') 'Logic error: satmedmfvdif is ', & 'called, but isatmedmf/=isatmedmf_vdif.' diff --git a/physics/satmedmfvdif.meta b/physics/satmedmfvdif.meta index d860e3310..baea94ad5 100644 --- a/physics/satmedmfvdif.meta +++ b/physics/satmedmfvdif.meta @@ -7,6 +7,16 @@ [ccpp-arg-table] name = satmedmfvdif_init type = scheme +[satmedmf] + standard_name = flag_for_scale_aware_TKE_moist_EDMF_PBL + long_name = flag for scale-aware TKE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F + intent = in + optional = F [isatmedmf] standard_name = choice_of_scale_aware_TKE_moist_EDMF_PBL long_name = choice of scale-aware TKE moist EDMF PBL scheme diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 106c89377..4bbfe61cc 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -19,10 +19,13 @@ module satmedmfvdifq !> \section arg_table_satmedmfvdifq_init Argument Table !! \htmlinclude satmedmfvdifq_init.html !! - subroutine satmedmfvdifq_init (isatmedmf,isatmedmf_vdifq, + subroutine satmedmfvdifq_init (satmedmf, + & isatmedmf,isatmedmf_vdifq, & errmsg,errflg) + logical, intent(in ) :: satmedmf integer, intent(in) :: isatmedmf,isatmedmf_vdifq + character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -30,6 +33,13 @@ subroutine satmedmfvdifq_init (isatmedmf,isatmedmf_vdifq, errmsg = '' errflg = 0 +! Consistency checks + if (.not. satmedmf) then + write(errmsg,fmt='(*(a))') 'Logic error: satmedmf = .false.' + errflg = 1 + return + end if + if (.not. isatmedmf==isatmedmf_vdifq) then write(errmsg,fmt='(*(a))') 'Logic error: satmedmfvdif is ', & 'called, but isatmedmf/=isatmedmf_vdifq.' diff --git a/physics/satmedmfvdifq.meta b/physics/satmedmfvdifq.meta index a4a71eed5..fd2dbe887 100644 --- a/physics/satmedmfvdifq.meta +++ b/physics/satmedmfvdifq.meta @@ -7,6 +7,14 @@ [ccpp-arg-table] name = satmedmfvdifq_init type = scheme +[satmedmf] + standard_name = flag_for_scale_aware_TKE_moist_EDMF_PBL + long_name = flag for scale-aware TKE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F [isatmedmf] standard_name = choice_of_scale_aware_TKE_moist_EDMF_PBL long_name = choice of scale-aware TKE moist EDMF PBL scheme diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index 1f786b496..d50a8505e 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -21,10 +21,12 @@ module lsm_noah !! \section arg_table_lsm_noah_init Argument Table !! \htmlinclude lsm_noah_init.html !! - subroutine lsm_noah_init(me, isot, ivegsrc, nlunit, + subroutine lsm_noah_init(lsm, lsm_noah, me, isot, ivegsrc, nlunit, & pores, resid, errmsg, errflg) implicit none + integer, intent(in) :: lsm + integer, intent(in) :: lsm_noah integer, intent(in) :: me, isot, ivegsrc, nlunit @@ -37,6 +39,14 @@ subroutine lsm_noah_init(me, isot, ivegsrc, nlunit, errmsg = '' errflg = 0 + ! Consistency checks + if (lsm/=lsm_noah) then + write(errmsg,'(*(a))') 'Logic error: namelist choice of ', + & 'LSM is different from Noah' + errflg = 1 + return + end if + if (ivegsrc > 2) then errmsg = 'The NOAH LSM expects that the ivegsrc physics '// & 'namelist parameter is 0, 1, or 2. Exiting...' diff --git a/physics/sfc_drv.meta b/physics/sfc_drv.meta index 9f2e51df3..c68102e7e 100644 --- a/physics/sfc_drv.meta +++ b/physics/sfc_drv.meta @@ -7,6 +7,22 @@ [ccpp-arg-table] name = lsm_noah_init type = scheme +[lsm] + standard_name = flag_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F +[lsm_noah] + standard_name = flag_for_noah_land_surface_scheme + long_name = flag for NOAH land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F [me] standard_name = mpi_rank long_name = current MPI-rank diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 916144cf5..f2f0369c2 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -79,6 +79,14 @@ subroutine lsm_ruc_init (me, master, isot, ivegsrc, nlunit, & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + + ! Consistency checks + if (lsm/=lsm_ruc) then + write(errmsg,'(*(a))') 'Logic error: namelist choice of ', & + & 'LSM is different from RUC' + errflg = 1 + return + end if ipr = 10 debug_print = .false. diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index a1f65f26a..129601e94 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -25,7 +25,8 @@ module noahmpdrv !! \section arg_table_noahmpdrv_init Argument Table !! \htmlinclude noahmpdrv_init.html !! - subroutine noahmpdrv_init(me, isot, ivegsrc, nlunit, pores, resid, & + subroutine noahmpdrv_init(lsm, lsm_noahmp, me, isot, ivegsrc, & + nlunit, pores, resid, & errmsg, errflg) use machine, only: kind_phys @@ -33,7 +34,8 @@ subroutine noahmpdrv_init(me, isot, ivegsrc, nlunit, pores, resid, & use namelist_soilveg implicit none - + integer, intent(in) :: lsm + integer, intent(in) :: lsm_noahmp integer, intent(in) :: me, isot, ivegsrc, nlunit real (kind=kind_phys), dimension(:), intent(out) :: pores, resid @@ -45,6 +47,14 @@ subroutine noahmpdrv_init(me, isot, ivegsrc, nlunit, pores, resid, & errmsg = '' errflg = 0 + ! Consistency checks + if (lsm/=lsm_noahmp) then + write(errmsg,'(*(a))') 'Logic error: namelist choice of ', & + & 'LSM is different from Noah' + errflg = 1 + return + end if + if (ivegsrc /= 1) then errmsg = 'The NOAHMP LSM expects that the ivegsrc physics '// & 'namelist parameter is 1. Exiting...' diff --git a/physics/sfc_noahmp_drv.meta b/physics/sfc_noahmp_drv.meta index 76811a378..1e225ddf2 100644 --- a/physics/sfc_noahmp_drv.meta +++ b/physics/sfc_noahmp_drv.meta @@ -7,6 +7,22 @@ [ccpp-arg-table] name = noahmpdrv_init type = scheme +[lsm] + standard_name = flag_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F +[lsm_noahmp] + standard_name = flag_for_noahmp_land_surface_scheme + long_name = flag for NOAH MP land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F [me] standard_name = mpi_rank long_name = current MPI-rank diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index e93ad3245..5a3e52db3 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -11,7 +11,22 @@ module shinhongvdif contains - subroutine shinhongvdif_init () + subroutine shinhongvdif_init (shinhong,errmsg,errflg) + + logical, intent(in) :: shinhong + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Consistency checks + if (.not. shinhong) then + write(errmsg,fmt='(*(a))') 'Logic error: shinhong = .false.' + errflg = 1 + return + end if end subroutine shinhongvdif_init subroutine shinhongvdif_finalize () diff --git a/physics/shinhongvdif.meta b/physics/shinhongvdif.meta index 6783fd800..6b12b64f5 100644 --- a/physics/shinhongvdif.meta +++ b/physics/shinhongvdif.meta @@ -3,6 +3,36 @@ type = scheme dependencies = machine.F +######################################################################## +[ccpp-arg-table] + name = shinhongvdif_init + type = scheme +[shinhong] + standard_name = flag_for_scale_aware_Shinhong_PBL + long_name = flag for scale-aware Shinhong PBL scheme + units = flag + dimensions = () + type = logical + 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 = shinhongvdif_run diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index 288227c8c..7599874ce 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -63,7 +63,7 @@ subroutine unified_ugwp_init (me, master, nlunit, input_nml_file, logunit, & fn_nml2, jdat, lonr, latr, levs, ak, bk, dtp, cdmbgwd, cgwf, & con_pi, con_rerth, pa_rf_in, tau_rf_in, con_p0, do_ugwp, & do_ugwp_v0, do_ugwp_v0_orog_only, do_ugwp_v0_nst_only, & - do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, & + do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, gwd_opt, & errmsg, errflg) !---- initialization of unified_ugwp @@ -96,7 +96,8 @@ subroutine unified_ugwp_init (me, master, nlunit, input_nml_file, logunit, & logical :: exists real :: dxsg integer :: k - + + integer, intent(in) :: gwd_opt character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -104,6 +105,13 @@ subroutine unified_ugwp_init (me, master, nlunit, input_nml_file, logunit, & errmsg = '' errflg = 0 + ! Consistency checks + if (gwd_opt/=2 .and. gwd_opt/=22) then + write(errmsg,'(*(a))') "Logic error: namelist choice of gravity wave & + & drag is different from unified_ugwp scheme" + errflg = 1 + return + end if ! Test to make sure that at most only one large-scale/blocking ! orographic drag scheme is chosen diff --git a/physics/unified_ugwp.meta b/physics/unified_ugwp.meta index c51b35c91..f675d1131 100644 --- a/physics/unified_ugwp.meta +++ b/physics/unified_ugwp.meta @@ -238,6 +238,14 @@ type = logical 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 [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index e427eb0eb..d59ceb386 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -11,7 +11,22 @@ module ysuvdif contains - subroutine ysuvdif_init () + subroutine ysuvdif_init (do_ysu,errmsg,errflg) + + logical, intent(in) :: do_ysu + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Consistency checks + if (.not. do_ysu) then + write(errmsg,fmt='(*(a))') 'Logic error: do_ysu = .false.' + errflg = 1 + return + end if end subroutine ysuvdif_init subroutine ysuvdif_finalize () diff --git a/physics/ysuvdif.meta b/physics/ysuvdif.meta index bf684dcbe..1ee952d45 100644 --- a/physics/ysuvdif.meta +++ b/physics/ysuvdif.meta @@ -3,6 +3,36 @@ type = scheme dependencies = machine.F +######################################################################## +[ccpp-arg-table] + name = ysuvdif_init + type = scheme +[do_ysu] + standard_name = flag_for_ysu + long_name = flag for YSU PBL scheme + units = flag + dimensions = () + type = logical + 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 = ysuvdif_run