Grow the z-level closed-face masks from their (1,1,1)
placeholder to full face size. Call ONLY when
&vcoord_nml zfixed_closed_faces is on, at configure time —
after init and BEFORE ocean_state_enter_data, so the device
map captures the final shapes (a realloc after enter_data
would leave the device pointing at freed host memory).
Seeded fully OPEN (1) so a stage that somehow reads them before the builder runs sees an inert mask.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_metrics_t), | intent(inout) | :: | this | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in) | :: | nz |
Number of layers ( |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | nx | ||||
| integer, | private | :: | ny |
subroutine metrics_closed_faces_alloc(this, grid, nz) !! Grow the z-level closed-face masks from their `(1,1,1)` !! placeholder to full face size. Call ONLY when !! `&vcoord_nml zfixed_closed_faces` is on, at configure time — !! after `init` and BEFORE `ocean_state_enter_data`, so the device !! map captures the final shapes (a realloc after `enter_data` !! would leave the device pointing at freed host memory). !! !! Seeded fully OPEN (1) so a stage that somehow reads them before !! the builder runs sees an inert mask. type(ocean_metrics_t), intent(inout) :: this type(hgrid_t), intent(in) :: grid integer, intent(in) :: nz !! Number of layers (`multilayer%nz_ml`). integer :: nx, ny nx = grid%nx_total ny = grid%ny_total if (allocated(this%open_u)) deallocate (this%open_u) if (allocated(this%open_v)) deallocate (this%open_v) allocate (this%open_u(nx + 1, ny, nz), source=1.0_wp) allocate (this%open_v(nx, ny + 1, nz), source=1.0_wp) end subroutine metrics_closed_faces_alloc