Skip to content

Commit

Permalink
Merge pull request NCAR#350 from climbfuji/ozphys_guard_based_on_dtc_…
Browse files Browse the repository at this point in the history
…develop

dtc/develop: prevent mismatch of namelist and suite definition file settings for ozone physics
  • Loading branch information
grantfirl authored Nov 7, 2019
2 parents 6d0a40c + 291153c commit 333980d
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 2 deletions.
19 changes: 18 additions & 1 deletion physics/ozphys.f
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions physics/ozphys.meta
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
19 changes: 18 additions & 1 deletion physics/ozphys_2015.f
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions physics/ozphys_2015.meta
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit 333980d

Please sign in to comment.