From c14375b3e648d0c2fb8086643b86a705ba916e96 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Tue, 27 Apr 2021 18:21:43 +0000 Subject: [PATCH 01/31] add imp_physics consistency check for Zhao-Carr under physics dir --- physics/gscond.f | 36 ++++++++++++++++++++++++++++++++++-- physics/gscond.meta | 38 ++++++++++++++++++++++++++++++++++++++ physics/precpd.f | 34 +++++++++++++++++++++++++++++++++- physics/precpd.meta | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 143 insertions(+), 3 deletions(-) diff --git a/physics/gscond.f b/physics/gscond.f index 28f24763c..c82508c8e 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -5,14 +5,46 @@ !> 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_gscond_init Argument Table !! - subroutine zhaocarr_gscond_init + subroutine zhaocarr_gscond_init (imp_physics, & + & imp_physics_zhao_carr, & + & errmsg, errflg) + implicit none + + ! Interface variables + integer, intent(in ) :: imp_physics + integer, intent(in ) :: imp_physics_zhao_carr + ! 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) 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 75b2d3a89..f13a41a74 100644 --- a/physics/gscond.meta +++ b/physics/gscond.meta @@ -3,6 +3,44 @@ type = scheme dependencies = funcphys.f90,machine.F,physcons.F90 +######################################################################## +[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 +[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_gscond_run diff --git a/physics/precpd.f b/physics/precpd.f index c64474c01..1ce8491ee 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -4,9 +4,41 @@ !> 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, & + & errmsg, errflg) + implicit none + + ! Interface variables + integer, intent(in ) :: imp_physics + integer, intent(in ) :: imp_physics_zhao_carr + ! 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) 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..bf78254f2 100644 --- a/physics/precpd.meta +++ b/physics/precpd.meta @@ -3,6 +3,44 @@ 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 +[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 From d39a04defd699db64d8c51db6e123d790c0d71a9 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 11:57:41 -0600 Subject: [PATCH 02/31] Consistency check for RRTMG scheme --- physics/GFS_rrtmg_setup.F90 | 10 +++++++++- physics/GFS_rrtmg_setup.meta | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 9d0e42643..84b2549f1 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 should be set 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 From e2b89742d2e30446518636b02f86ad0bb86584eb Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 11:58:29 -0600 Subject: [PATCH 03/31] Consistency check for RRTMGP scheme --- physics/GFS_rrtmgp_setup.F90 | 14 +++++++++++--- physics/GFS_rrtmgp_setup.meta | 8 ++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index a55c84ae7..2eb2e6933 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 should be set 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 From 0c7022d5926b9b669881e5147705541677ec2cda Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:02:47 -0600 Subject: [PATCH 04/31] Consistency check for G-F convection --- physics/cu_gf_driver.F90 | 21 +++++++++++++++++++-- physics/cu_gf_driver.meta | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 27165e067..758969fbd 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,20 @@ subroutine cu_gf_driver_init(mpirank, mpiroot, errmsg, errflg) end if ! *DH temporary + ! Consistency checks + if (imfshalcnv/=imfshalcnv_gf) then + write(errmsg,'(*(a))') 'Logic error: namelist choice of', & + & ' shallow convection is different from Grell-Freitas scheme' + errflg = 1 + return + end if + + if (imfdeepcnv/=imfdeepcnv_gf) then + write(errmsg,'(*(a))') 'Logic error: namelist choice of', & + & ' deep 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 From 5d70274607c421090fcb22a8422e366a78b000b9 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:03:30 -0600 Subject: [PATCH 05/31] Consistency check for ntiedke convection schemes --- physics/cu_ntiedtke.F90 | 20 +++++++++++++++++++- physics/cu_ntiedtke.meta | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) 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 From a30acf71f92829e7dcf329eb9053e297f5e0c682 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:04:08 -0600 Subject: [PATCH 06/31] Consistency check for GSL drag suite --- physics/drag_suite.F90 | 19 ++++++++++++++++++- physics/drag_suite.meta | 30 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 index 92a1c0bd3..8b8b16523 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 .or. 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 From 15f0002c9f749fd883272c74c1101fda7c3a4c1d Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:05:02 -0600 Subject: [PATCH 07/31] Consistency check for H2O physics --- physics/h2ophys.f | 17 ++++++++++++++++- physics/h2ophys.meta | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/physics/h2ophys.f b/physics/h2ophys.f index 502ef9796..40294184f 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.h2ophys) then + write (errmsg,'(*(a))') 'Logic error: h2ophys == .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 From 0cde3fba8d002506a9341fed33aa324218e49826 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:06:17 -0600 Subject: [PATCH 08/31] Consistency check for SAMF deep convection --- physics/samfdeepcnv.f | 18 +++++++++++++++++- physics/samfdeepcnv.meta | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) 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 From 9b0a91a5c628279223b9c1003a34e9e9681c7c13 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:06:51 -0600 Subject: [PATCH 09/31] Add consistency check for SAMF shallow convection --- physics/samfshalcnv.f | 18 +++++++++++++++++- physics/samfshalcnv.meta | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) 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 From 68b7b20fc1ee5be901c53b60cbcdd25a36ef8e13 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:08:30 -0600 Subject: [PATCH 10/31] Consistency check for Noah LSM --- physics/sfc_drv.f | 12 +++++++++++- physics/sfc_drv.meta | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) 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 From cb3567e6f601da666c34fe36358c505baf194d1a Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:08:49 -0600 Subject: [PATCH 11/31] Consistency check for RUC LSM --- physics/sfc_drv_ruc.F90 | 13 ++++++++++++- physics/sfc_drv_ruc.meta | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 916144cf5..655308d3a 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -25,7 +25,8 @@ module lsm_ruc !! \section arg_table_lsm_ruc_init Argument Table !! \htmlinclude lsm_ruc_init.html !! - subroutine lsm_ruc_init (me, master, isot, ivegsrc, nlunit, & + subroutine lsm_ruc_init (lsm, lsm_ruc, & + me, master, isot, ivegsrc, nlunit, & flag_restart, flag_init, & im, lsoil_ruc, lsoil, kice, nlev, & ! in lsm_ruc, lsm, slmsk, stype, vtype, & ! in @@ -36,6 +37,8 @@ subroutine lsm_ruc_init (me, master, isot, ivegsrc, nlunit, & implicit none ! --- in + integer, intent(in) :: lsm + integer, intent(in) :: lsm_ruc integer, intent(in) :: me, master, isot, ivegsrc, nlunit logical, intent(in) :: flag_restart logical, intent(in) :: flag_init @@ -79,6 +82,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_drv_ruc.meta b/physics/sfc_drv_ruc.meta index e504c0700..f085dd0bc 100644 --- a/physics/sfc_drv_ruc.meta +++ b/physics/sfc_drv_ruc.meta @@ -7,6 +7,22 @@ [ccpp-arg-table] name = lsm_ruc_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_ruc] + standard_name = flag_for_ruc_land_surface_scheme + long_name = flag for RUC land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F [me] standard_name = mpi_rank long_name = current MPI-rank From caa28fd48e9ea59986769556ec72da88f755cac1 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:09:35 -0600 Subject: [PATCH 12/31] Consistency check for Noah-MP LSM --- physics/sfc_noahmp_drv.F90 | 14 ++++++++++++-- physics/sfc_noahmp_drv.meta | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) 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 From f0e023a3f13a1d27821b49f63f989cc09a83adec Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 12:10:32 -0600 Subject: [PATCH 13/31] Consistency check for unified_ugwp --- physics/unified_ugwp.F90 | 12 ++++++++++-- physics/unified_ugwp.meta | 8 ++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index 288227c8c..c799f0384 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 .or. 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 From fe70d7b6040b1a86479c04bbe16260f176dcac87 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 13:47:09 -0600 Subject: [PATCH 14/31] Consistency check for SHOC PBL scheme --- physics/gcm_shoc.F90 | 17 ++++++++++++++++- physics/gcm_shoc.meta | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) 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 From 3da5e497f4ae1fa9e2ccfa3401078a73f9165717 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 13:54:21 -0600 Subject: [PATCH 15/31] Consistency check for MYJ PBL scheme --- physics/module_MYJPBL_wrapper.F90 | 17 ++++++++++++++++- physics/module_MYJPBL_wrapper.meta | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) 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 From ad1e4c8483724f7aa13ff6f701069ff7c3d6bfd0 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 13:54:48 -0600 Subject: [PATCH 16/31] Consistency check for MYMM PBL scheme --- physics/module_MYNNPBL_wrapper.F90 | 12 ++++++++++-- physics/module_MYNNPBL_wrapper.meta | 8 ++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) 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 From b8e35915c73f3cd59d8d0c78db5b43fac6e5a201 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 14:02:10 -0600 Subject: [PATCH 17/31] Consistency check for HEDMF PBL scheme --- physics/moninedmf.f | 14 ++++++++++++-- physics/moninedmf.meta | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) 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 From ab814f837db217d1c4d4d04c4ebab01327ef4397 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 14:02:31 -0600 Subject: [PATCH 18/31] Consistency check for SHOC PBL scheme --- physics/moninshoc.f | 19 ++++++++++++++++++- physics/moninshoc.meta | 30 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) 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 From a81e22fc8e024a4b769f8d5b3e1341eb1952d236 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 14:06:21 -0600 Subject: [PATCH 19/31] Consistency check for TKE-Based EDMF PBL scheme --- physics/satmedmfvdif.F | 11 ++++++++++- physics/satmedmfvdif.meta | 10 ++++++++++ physics/satmedmfvdifq.F | 12 +++++++++++- physics/satmedmfvdifq.meta | 8 ++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) 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 From 49561292837c8e5b2cc4d9fb0e0004092adcbb51 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 14:08:08 -0600 Subject: [PATCH 20/31] Consistency check for Shinhong PBL scheme --- physics/shinhongvdif.F90 | 17 ++++++++++++++++- physics/shinhongvdif.meta | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) 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 From 317e311e2ef2a507e5df65892af2752857bbf40a Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 14:10:05 -0600 Subject: [PATCH 21/31] Consistency check for YSU PBL scheme --- physics/ysuvdif.F90 | 17 ++++++++++++++++- physics/ysuvdif.meta | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index e427eb0eb..443137615 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) + + integer, 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 From fd48665ef3e8938891df52579db4fcca0223d7a7 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 14:12:40 -0600 Subject: [PATCH 22/31] Consistency check for MYJ sfclay scheme --- physics/module_MYJSFC_wrapper.F90 | 17 ++++++++++++++++- physics/module_MYJSFC_wrapper.meta | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/physics/module_MYJSFC_wrapper.F90 b/physics/module_MYJSFC_wrapper.F90 index d908900c4..c392e239e 100644 --- a/physics/module_MYJSFC_wrapper.F90 +++ b/physics/module_MYJSFC_wrapper.F90 @@ -8,7 +8,22 @@ 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 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 From 39e21ead70c81d09bf499bc385fd3dc3bce3ce49 Mon Sep 17 00:00:00 2001 From: Xia Sun Date: Mon, 10 May 2021 14:15:14 -0600 Subject: [PATCH 23/31] Consistency check for MYNN sfclay scheme --- physics/module_MYNNSFC_wrapper.F90 | 11 ++++++++++- physics/module_MYNNSFC_wrapper.meta | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) 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 From c88f128b1bf04e6e5c8ee56dbcb3a5c27d9c1e1d Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Tue, 11 May 2021 22:58:42 +0000 Subject: [PATCH 24/31] typo fixes --- physics/h2ophys.f | 4 ++-- physics/sfc_drv_ruc.F90 | 5 +---- physics/sfc_drv_ruc.meta | 16 ---------------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/physics/h2ophys.f b/physics/h2ophys.f index 40294184f..863f4f45a 100644 --- a/physics/h2ophys.f +++ b/physics/h2ophys.f @@ -23,8 +23,8 @@ subroutine h2ophys_init(h2o_phys, errmsg, errflg) errmsg = '' errflg = 0 - if (.not.h2ophys) then - write (errmsg,'(*(a))') 'Logic error: h2ophys == .false.' + if (.not.h2o_phys) then + write (errmsg,'(*(a))') 'Logic error: h2o_phys == .false.' errflg = 1 return endif diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 655308d3a..9ca6e8e10 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -25,8 +25,7 @@ module lsm_ruc !! \section arg_table_lsm_ruc_init Argument Table !! \htmlinclude lsm_ruc_init.html !! - subroutine lsm_ruc_init (lsm, lsm_ruc, & - me, master, isot, ivegsrc, nlunit, & + subroutine lsm_ruc_init (me, master, isot, ivegsrc, nlunit, & flag_restart, flag_init, & im, lsoil_ruc, lsoil, kice, nlev, & ! in lsm_ruc, lsm, slmsk, stype, vtype, & ! in @@ -37,8 +36,6 @@ subroutine lsm_ruc_init (lsm, lsm_ruc, & implicit none ! --- in - integer, intent(in) :: lsm - integer, intent(in) :: lsm_ruc integer, intent(in) :: me, master, isot, ivegsrc, nlunit logical, intent(in) :: flag_restart logical, intent(in) :: flag_init diff --git a/physics/sfc_drv_ruc.meta b/physics/sfc_drv_ruc.meta index f085dd0bc..e504c0700 100644 --- a/physics/sfc_drv_ruc.meta +++ b/physics/sfc_drv_ruc.meta @@ -7,22 +7,6 @@ [ccpp-arg-table] name = lsm_ruc_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_ruc] - standard_name = flag_for_ruc_land_surface_scheme - long_name = flag for RUC land surface model - units = flag - dimensions = () - type = integer - intent = in - optional = F [me] standard_name = mpi_rank long_name = current MPI-rank From 59452cb93c6d5d2252a54f5f26fcf9f3a0f6d1c9 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Tue, 11 May 2021 22:59:04 +0000 Subject: [PATCH 25/31] Consistency check for cires_ugwp --- physics/cires_ugwp.F90 | 11 ++++++++++- physics/cires_ugwp.meta | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) 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 From 1d8fa1b7bada95d5ba93ca24807c2a2bf101f295 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Wed, 12 May 2021 22:34:39 +0000 Subject: [PATCH 26/31] fix some err msg and if statements --- physics/GFS_rrtmg_setup.F90 | 2 +- physics/GFS_rrtmgp_setup.F90 | 2 +- physics/drag_suite.F90 | 2 +- physics/gscond.f | 3 ++- physics/gscond.meta | 8 ++++++++ physics/precpd.f | 3 ++- physics/precpd.meta | 8 ++++++++ physics/unified_ugwp.F90 | 2 +- 8 files changed, 24 insertions(+), 6 deletions(-) diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 84b2549f1..a933637ce 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -212,7 +212,7 @@ subroutine GFS_rrtmg_setup_init ( & if (is_initialized) return if (do_RRTMGP) then - write(errmsg,'(*(a))') "Logic error: do_RRTMGP should be set false" + write(errmsg,'(*(a))') "Logic error: do_RRTMGP must be set .false." errflg = 1 return end if diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index 2eb2e6933..d466e4e27 100644 --- a/physics/GFS_rrtmgp_setup.F90 +++ b/physics/GFS_rrtmgp_setup.F90 @@ -79,7 +79,7 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, ! Consistency checks if (.not. do_RRTMGP) then - write(errmsg,'(*(a))') "Logic error: do_RRTMGP should be set true" + write(errmsg,'(*(a))') "Logic error: do_RRTMGP must be set .true." errflg = 1 return end if diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 index 8b8b16523..1d83fec1c 100644 --- a/physics/drag_suite.F90 +++ b/physics/drag_suite.F90 @@ -19,7 +19,7 @@ subroutine drag_suite_init(gwd_opt, errmsg, errflg) errflg = 0 ! Consistency checks - if (gwd_opt/=3 .or. gwd_opt/=33) then + 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 diff --git a/physics/gscond.f b/physics/gscond.f index bc76e576d..124c0c40b 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -37,7 +37,8 @@ subroutine zhaocarr_gscond_init (imp_physics, & if (is_initialized) return ! Consistency checks - if (imp_physics/=imp_physics_zhao_carr) then + 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 diff --git a/physics/gscond.meta b/physics/gscond.meta index 0140b0a70..006fe4472 100644 --- a/physics/gscond.meta +++ b/physics/gscond.meta @@ -23,6 +23,14 @@ 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 diff --git a/physics/precpd.f b/physics/precpd.f index c75b920cb..11f4a64dd 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -31,7 +31,8 @@ subroutine zhaocarr_precpd_init (imp_physics, & if (is_initialized) return ! Consistency checks - if (imp_physics/=imp_physics_zhao_carr) then + 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 diff --git a/physics/precpd.meta b/physics/precpd.meta index bf78254f2..4a8009113 100644 --- a/physics/precpd.meta +++ b/physics/precpd.meta @@ -23,6 +23,14 @@ 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 diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index c799f0384..7599874ce 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -106,7 +106,7 @@ subroutine unified_ugwp_init (me, master, nlunit, input_nml_file, logunit, & errflg = 0 ! Consistency checks - if (gwd_opt/=2 .or. gwd_opt/=22) then + 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 From 50e46a1f6e685bd50198ffd5ec179efda7faac68 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Wed, 12 May 2021 22:39:33 +0000 Subject: [PATCH 27/31] minor msg fix --- physics/GFS_rrtmg_setup.F90 | 2 +- physics/GFS_rrtmgp_setup.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index a933637ce..aa5f3f4ca 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -212,7 +212,7 @@ subroutine GFS_rrtmg_setup_init ( & if (is_initialized) return if (do_RRTMGP) then - write(errmsg,'(*(a))') "Logic error: do_RRTMGP must be set .false." + write(errmsg,'(*(a))') "Logic error: do_RRTMGP must be set to .false." errflg = 1 return end if diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index d466e4e27..ff82ba779 100644 --- a/physics/GFS_rrtmgp_setup.F90 +++ b/physics/GFS_rrtmgp_setup.F90 @@ -79,7 +79,7 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, ! Consistency checks if (.not. do_RRTMGP) then - write(errmsg,'(*(a))') "Logic error: do_RRTMGP must be set .true." + write(errmsg,'(*(a))') "Logic error: do_RRTMGP must be set to .true." errflg = 1 return end if From e457e01208e2a5094bf46fe08c0e69bc316010be Mon Sep 17 00:00:00 2001 From: Xia Sun <58949533+XiaSun-Atmos@users.noreply.github.com> Date: Fri, 14 May 2021 10:27:28 -0600 Subject: [PATCH 28/31] Update ysuvdif.F90 --- physics/ysuvdif.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index 443137615..d59ceb386 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -13,7 +13,7 @@ module ysuvdif subroutine ysuvdif_init (do_ysu,errmsg,errflg) - integer, intent(in) :: do_ysu + logical, intent(in) :: do_ysu character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg From b80fe7090b143b5c538ae22a0293c4a65257fe01 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Fri, 14 May 2021 20:09:07 +0000 Subject: [PATCH 29/31] fix --- physics/gscond.f | 7 +++++-- physics/precpd.f | 4 +++- physics/sfc_drv_ruc.F90 | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/physics/gscond.f b/physics/gscond.f index 124c0c40b..1606bc93a 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -19,13 +19,16 @@ module zhaocarr_gscond !> \section arg_table_zhaocarr_gscond_init Argument Table !! subroutine zhaocarr_gscond_init (imp_physics, & - & imp_physics_zhao_carr, & + & 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 + integer, intent(in ) :: imp_physics_zhao_carr, & + & imp_physics_zhao_carr_pdf + ! CCPP error handling character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg diff --git a/physics/precpd.f b/physics/precpd.f index 11f4a64dd..2279356b3 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -14,12 +14,14 @@ module zhaocarr_precpd 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 + integer, intent(in ) :: imp_physics_zhao_carr, & + & imp_physics_zhao_carr_pdf ! CCPP error handling character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 9ca6e8e10..f2f0369c2 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -82,7 +82,7 @@ subroutine lsm_ruc_init (me, master, isot, ivegsrc, nlunit, & ! Consistency checks if (lsm/=lsm_ruc) then - write(errmsg,'(*(a))') 'Logic error: namelist choice of ', + write(errmsg,'(*(a))') 'Logic error: namelist choice of ', & & 'LSM is different from RUC' errflg = 1 return From a8500a8720f8b0edef969503390d0c5979e51959 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Fri, 14 May 2021 23:39:40 +0000 Subject: [PATCH 30/31] add end if in module_MYJSFC_wrapper --- physics/module_MYJSFC_wrapper.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/physics/module_MYJSFC_wrapper.F90 b/physics/module_MYJSFC_wrapper.F90 index c392e239e..3d2b2e017 100644 --- a/physics/module_MYJSFC_wrapper.F90 +++ b/physics/module_MYJSFC_wrapper.F90 @@ -24,6 +24,7 @@ subroutine myjsfc_wrapper_init (do_myjsfc, & write(errmsg,fmt='(*(a))') 'Logic error: do_myjsfc = .false.' errflg = 1 return + end if end subroutine myjsfc_wrapper_init subroutine myjsfc_wrapper_finalize () From b179486fda73f21d45c85cad20c6a8e713d2e323 Mon Sep 17 00:00:00 2001 From: Xia Sun <58949533+XiaSun-Atmos@users.noreply.github.com> Date: Wed, 19 May 2021 08:21:28 -0600 Subject: [PATCH 31/31] Update cu_gf_driver.F90 --- physics/cu_gf_driver.F90 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 758969fbd..c17aaec76 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -48,19 +48,14 @@ subroutine cu_gf_driver_init(imfshalcnv, imfshalcnv_gf, imfdeepcnv, & ! *DH temporary ! Consistency checks - if (imfshalcnv/=imfshalcnv_gf) then + if (.not. (imfshalcnv == imfshalcnv_gf .or. & + & imfdeepcnv == imfdeepcnv_gf)) then write(errmsg,'(*(a))') 'Logic error: namelist choice of', & - & ' shallow convection is different from Grell-Freitas scheme' + & ' convection is different from Grell-Freitas scheme' errflg = 1 return end if - if (imfdeepcnv/=imfdeepcnv_gf) then - write(errmsg,'(*(a))') 'Logic error: namelist choice of', & - & ' deep convection is different from Grell-Freitas scheme' - errflg = 1 - return - end if end subroutine cu_gf_driver_init subroutine cu_gf_driver_finalize()