derived_requires_fail Subroutine

private 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.

Arguments

Type IntentOptional 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.


Calls

proc~~derived_requires_fail~~CallsGraph proc~derived_requires_fail derived_requires_fail error error proc~derived_requires_fail->error proc~error_ring_push error_ring_push proc~derived_requires_fail->proc~error_ring_push

Called by

proc~~derived_requires_fail~~CalledByGraph proc~derived_requires_fail derived_requires_fail proc~register_derived register_derived proc~register_derived->proc~derived_requires_fail proc~apply_diag_selection apply_diag_selection proc~apply_diag_selection->proc~register_derived proc~engine_configure_diag engine_configure_diag proc~engine_configure_diag->proc~apply_diag_selection proc~engine_setup engine_setup proc~engine_setup->proc~engine_configure_diag proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup

Variables

Type Visibility Attributes Name Initial
character(len=:), private, allocatable :: msg

Source Code

   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