Reads bathymetry (bottom elevation) from a NetCDF file and populates the state%barotropic%b array. Expects a 2D variable on a structured grid. If no file is configured, falls back to flat bottom.
Translate a raw nc_check-style status (0 = ok) from one of the
nc_* reader calls in load_bathymetry_into_array into the
caller’s ierr contract: .true. on success; on failure,
.false. with ierr = OCEAN_STATUS_ERR_IO when ierr is
present (closing ncid first, when given, so a mid-read failure
does not leak the file handle), or error stops with the SAME
generic text nc_check itself would have used had ierr never
been threaded through — keeps the legacy (no ierr) behaviour
byte-identical while unblocking the ierr-present return path
(F1/F2 of the P0.1 review).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | local_ierr | |||
| integer, | intent(out), | optional | :: | ierr | ||
| integer, | intent(in), | optional | :: | ncid |
Fill ghost cell bathymetry by constant extrapolation from the nearest interior cell. This ensures boundary flux computations see a consistent bottom elevation across the ghost-interior interface. Works on a target 2D array directly so both the coastal and ocean barotropic slots can reuse it.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | b(:,:) | |||
| type(hgrid_t), | intent(in) | :: | grid |
Load bathymetry from a NetCDF file into a target 2D array
shaped (grid%nx_total, grid%ny_total).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| real(kind=wp), | intent(inout) | :: | b(:,:) | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(out), | optional | :: | ierr |
Non-zero on a missing/unreadable file or a dimension mismatch
when present; absent behaves as today ( |
Try to find the bathymetry variable by common names
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ncid | |||
| integer, | intent(out) | :: | varid | |||
| integer, | intent(out), | optional | :: | ierr |
Non-zero when none of the recognised variable names is found,
when present; absent behaves as today (leaves |