rdb_bathymetry Module

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.


Uses

  • module~~rdb_bathymetry~~UsesGraph module~rdb_bathymetry rdb_bathymetry module~rdb_constants rdb_constants module~rdb_bathymetry->module~rdb_constants module~rdb_grid rdb_grid module~rdb_bathymetry->module~rdb_grid module~rdb_io_netcdf rdb_io_netcdf module~rdb_bathymetry->module~rdb_io_netcdf module~rdb_ocean_status rdb_ocean_status module~rdb_bathymetry->module~rdb_ocean_status netcdf netcdf module~rdb_bathymetry->netcdf pic_logger pic_logger module~rdb_bathymetry->pic_logger pic_strings pic_strings module~rdb_bathymetry->pic_strings pic_types pic_types module~rdb_constants->pic_types module~rdb_grid->module~rdb_constants module~rdb_io_netcdf->module~rdb_constants module~rdb_io_netcdf->netcdf module~rdb_io_netcdf->pic_logger module~rdb_io_netcdf->pic_strings iso_c_binding iso_c_binding module~rdb_io_netcdf->iso_c_binding iso_fortran_env iso_fortran_env module~rdb_io_netcdf->iso_fortran_env module~rdb_error_ring rdb_error_ring module~rdb_io_netcdf->module~rdb_error_ring module~rdb_error_ring->pic_logger

Used by

  • module~~rdb_bathymetry~~UsedByGraph module~rdb_bathymetry rdb_bathymetry module~rdb_ocean_state rdb_ocean_state module~rdb_ocean_state->module~rdb_bathymetry module~rdb_driver rdb_driver module~rdb_driver->module~rdb_ocean_state module~rdb_ocean_engine rdb_ocean_engine module~rdb_driver->module~rdb_ocean_engine module~rdb_handle rdb_handle module~rdb_handle->module~rdb_ocean_state module~rdb_handle->module~rdb_ocean_engine module~rdb_ocean_diag_derived rdb_ocean_diag_derived module~rdb_ocean_diag_derived->module~rdb_ocean_state module~rdb_ocean_diag_fills rdb_ocean_diag_fills module~rdb_ocean_diag_derived->module~rdb_ocean_diag_fills module~rdb_ocean_diag_fills->module~rdb_ocean_state module~rdb_ocean_engine->module~rdb_ocean_state module~rdb_ocean_engine->module~rdb_ocean_diag_derived module~rdb_ocean_engine->module~rdb_ocean_diag_fills module~rdb_ocean_setup rdb_ocean_setup module~rdb_ocean_engine->module~rdb_ocean_setup module~rdb_ocean_setup->module~rdb_ocean_state module~rdb_ocean_api rdb_ocean_api module~rdb_ocean_api->module~rdb_handle module~rdb_ocean_api->module~rdb_ocean_diag_derived module~rdb_ocean_api->module~rdb_ocean_diag_fills module~rdb_ocean_api->module~rdb_ocean_engine

Functions

private function bathy_io_ok(local_ierr, ierr, ncid) result(ok)

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).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: local_ierr
integer, intent(out), optional :: ierr
integer, intent(in), optional :: ncid

Return Value logical


Subroutines

public subroutine fill_bathymetry_ghosts_array(b, grid)

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.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: b(:,:)
type(hgrid_t), intent(in) :: grid

public subroutine load_bathymetry_into_array(filename, b, grid, ierr)

Load bathymetry from a NetCDF file into a target 2D array shaped (grid%nx_total, grid%ny_total).

Read more…

Arguments

Type IntentOptional 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 (error stop).

private subroutine try_get_bathymetry_var(ncid, varid, ierr)

Try to find the bathymetry variable by common names

Arguments

Type IntentOptional 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 varid unset and lets the caller’s next NetCDF call fail).