Configure the atmospheric surface-pressure loading slot (PR-17):
copy enable, take ρ₀ from ocean_state%eos%rho0 (the single ρ₀
of record — NOT a namelist knob), and allocate the seam fields.
Host-side setup — runs BEFORE ocean_state_enter_data.
enable=.false. => no-op, bit-identical. The uniform-p_surf
inert warning is emitted in validate_config; here we only log the
enable on rank 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(config_t), | intent(in) | :: | cfg | |||
| type(ocean_state_t), | intent(inout) | :: | ocean_state | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in) | :: | compute_rank |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | nx | ||||
| integer, | private | :: | ny |
subroutine configure_ocean_p_surf(cfg, ocean_state, grid, compute_rank) !! Configure the atmospheric surface-pressure loading slot (PR-17): !! copy `enable`, take ρ₀ from `ocean_state%eos%rho0` (the single ρ₀ !! of record — NOT a namelist knob), and allocate the seam fields. !! Host-side setup — runs BEFORE `ocean_state_enter_data`. !! `enable=.false.` => no-op, bit-identical. The uniform-`p_surf` !! inert warning is emitted in `validate_config`; here we only log the !! enable on rank 0. type(config_t), intent(in) :: cfg type(ocean_state_t), intent(inout) :: ocean_state type(hgrid_t), intent(in) :: grid integer, intent(in) :: compute_rank integer :: nx, ny associate (ps => ocean_state%p_surf, pcfg => cfg%ocean%psurf) ps%enable = pcfg%enable if (.not. pcfg%enable) return ! Single ρ₀ of record: the model's own reference density, so the ! inverse barometer scales with whatever `&ocean_ic_nml rho_0` ! set. `eos%rho0` is assigned in `ocean_state_init_from_config` ! (runs earlier), so it is finalised here. ps%rho0 = ocean_state%eos%rho0 nx = grid%nx_total ny = grid%ny_total call p_surf_configure(ps, nx, ny) if (compute_rank == 0) then call logger%info("Surface pressure: inverse-barometer PGF enabled "// & "(eta_ib = -p_surf/(rho0*g_bt), rho0 = "// & to_string(ps%rho0)//" kg/m^3)") end if end associate end subroutine configure_ocean_p_surf