Fail loud on a derived diagnostic whose prerequisite knob is
off. Same three-step shape register_derived uses for an
unknown name — error ring, logger, error stop — so the C ABI
and the console both see it.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Catalog name the user asked for. |
||
| character(len=*), | intent(in) | :: | knob |
The namelist key that has to be on. |
||
| character(len=*), | intent(in) | :: | what |
One phrase naming what that knob builds. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | private, | allocatable | :: | msg |
subroutine derived_requires_fail(name, knob, what) !! Fail loud on a derived diagnostic whose prerequisite knob is !! off. Same three-step shape `register_derived` uses for an !! unknown name — error ring, logger, `error stop` — so the C ABI !! and the console both see it. character(len=*), intent(in) :: name !! Catalog name the user asked for. character(len=*), intent(in) :: knob !! The namelist key that has to be on. character(len=*), intent(in) :: what !! One phrase naming what that knob builds. character(len=:), allocatable :: msg msg = "&ocean_diag_nml diags requested '"//name//"', which reads "//what// & " and therefore requires "//knob//"=.true. Refused rather than "// & "registered: the fill would be a plane of missing values, which is "// & "indistinguishable from a physical answer once it reaches a figure." call error_ring_push(msg) call global_logger%error(msg) error stop "register_derived: derived diagnostic requires a knob that is off" end subroutine derived_requires_fail