From 86276c1e3708fb5ec38113c1849bcf6808f25aea Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 5 Nov 2019 16:03:06 +0900 Subject: [PATCH] physics/ozphys.*, physics/ozphys_2015.*: add guard to prevent mismatch of namelist option for old/new ozphys and entry in suite definition file --- physics/ozphys.f | 19 ++++++++++++++++++- physics/ozphys.meta | 25 +++++++++++++++++++++++++ physics/ozphys_2015.f | 19 ++++++++++++++++++- physics/ozphys_2015.meta | 25 +++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 2 deletions(-) diff --git a/physics/ozphys.f b/physics/ozphys.f index 73f7d8b20..02296ee79 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -10,8 +10,25 @@ module ozphys ! \brief Brief description of the subroutine ! !> \section arg_table_ozphys_init Argument Table +!! \htmlinclude ozphys_init.html !! - subroutine ozphys_init() + subroutine ozphys_init(oz_phys, errmsg, errflg) + + implicit none + logical, intent(in) :: oz_phys + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not.oz_phys) then + write (errmsg,'(*(a))') 'Logic error: oz_phys == .false.' + errflg = 1 + return + endif + end subroutine ozphys_init ! \brief Brief description of the subroutine diff --git a/physics/ozphys.meta b/physics/ozphys.meta index 80ab9453e..9f7a3870d 100644 --- a/physics/ozphys.meta +++ b/physics/ozphys.meta @@ -1,6 +1,31 @@ [ccpp-arg-table] name = ozphys_init type = scheme +[oz_phys] + standard_name = flag_for_ozone_physics + long_name = flag for old (2006) ozone 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] diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index 6983f58e2..3126313dc 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -8,8 +8,25 @@ module ozphys_2015 contains !> \section arg_table_ozphys_2015_init Argument Table +!! \htmlinclude ozphys_2015_init.html !! - subroutine ozphys_2015_init() + subroutine ozphys_2015_init(oz_phys_2015, errmsg, errflg) + + implicit none + logical, intent(in) :: oz_phys_2015 + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not.oz_phys_2015) then + write (errmsg,'(*(a))') 'Logic error: oz_phys_2015 == .false.' + errflg = 1 + return + endif + end subroutine ozphys_2015_init ! \brief Brief description of the subroutine diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index e9eb7d5a5..51f8e76f4 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -1,6 +1,31 @@ [ccpp-arg-table] name = ozphys_2015_init type = scheme +[oz_phys_2015] + standard_name = flag_for_2015_ozone_physics + long_name = flag for new (2015) ozone 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]