Pick the heat/salt destination for this run and reject the freshwater tags when the component set they need is absent.
ocean_surface_flux_assemble rebuilds Q_heat/Q_salt from
the components on every thermo step when use_components is
on, so a file write straight into Q_heat would be overwritten
before it was ever read. With components off there is no
component to write, so Q_heat is both correct and the only
option. evap/lprec exist only in the component set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_dataovr_config_t), | intent(in) | :: | cfg | |||
| type(ocean_surface_flux_t), | intent(in) | :: | sf | |||
| type(ocean_data_forcing_t), | intent(inout) | :: | this | |||
| integer, | intent(out), | optional | :: | ierr |
subroutine resolve_flux_targets(cfg, sf, this, ierr) !! Pick the heat/salt destination for this run and reject the !! freshwater tags when the component set they need is absent. !! !! `ocean_surface_flux_assemble` rebuilds `Q_heat`/`Q_salt` from !! the components on every thermo step when `use_components` is !! on, so a file write straight into `Q_heat` would be overwritten !! before it was ever read. With components off there is no !! component to write, so `Q_heat` is both correct and the only !! option. `evap`/`lprec` exist only in the component set. type(ocean_dataovr_config_t), intent(in) :: cfg type(ocean_surface_flux_t), intent(in) :: sf type(ocean_data_forcing_t), intent(inout) :: this integer, intent(out), optional :: ierr if (present(ierr)) ierr = OCEAN_STATUS_OK this%heat_to_component = sf%use_components this%salt_to_component = sf%use_components if (sf%use_components) return if (len_trim(cfg%evap%file) > 0 .or. len_trim(cfg%lprec%file) > 0) then call fail("&ocean_dataovr_nml: evap/lprec file forcing needs the surface-flux "// & "component set — set &ocean_forcing_nml enable_components = .true. "// & "(there is no non-component freshwater slot to write into)", & ierr, OCEAN_STATUS_ERR_SETUP) end if end subroutine resolve_flux_targets