Setup-time entry point: registers the “pseudo_salt” passive
tracer (name/units/long_name copied verbatim from Shao 2016)
and records its slot on ms%idx_pseudo_salt. MUST be called
after ms%init and before enter_data — and, on the ocean
path, before ocean_bc_state_init sizes bc%n_tracers (the
register_passive_tracer contract). error stops on
refusal (mirrors rdb_state.F90’s treatment of a fatal setup
misconfiguration — a caller that reaches here has already
decided to register, so a silent no-op would be worse than a
loud abort).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(multilayer_state_t), | intent(inout) | :: | ms | |||
| type(hgrid_t), | intent(in) | :: | grid |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | idx |
subroutine ocean_pseudo_salt_register(ms, grid) !! Setup-time entry point: registers the "pseudo_salt" passive !! tracer (name/units/long_name copied verbatim from Shao 2016) !! and records its slot on `ms%idx_pseudo_salt`. MUST be called !! after `ms%init` and before `enter_data` — and, on the ocean !! path, before `ocean_bc_state_init` sizes `bc%n_tracers` (the !! `register_passive_tracer` contract). `error stop`s on !! refusal (mirrors `rdb_state.F90`'s treatment of a fatal setup !! misconfiguration — a caller that reaches here has already !! decided to register, so a silent no-op would be worse than a !! loud abort). type(multilayer_state_t), intent(inout) :: ms type(hgrid_t), intent(in) :: grid integer :: idx call ms%register_passive_tracer(grid, "pseudo_salt", "psu", & "Pseudo salt passive tracer", idx) if (idx <= 0) then call error_ring_push("ocean_pseudo_salt_register: "// & "register_passive_tracer refused (registry "// & "not initialised, or already locked by enter_data)") call global_logger%error("ocean_pseudo_salt_register: "// & "register_passive_tracer refused (registry "// & "not initialised, or already locked by enter_data)") error stop "ocean_pseudo_salt_register: registration refused" end if ms%idx_pseudo_salt = idx end subroutine ocean_pseudo_salt_register