nc_get_var_slab_2d Subroutine

public subroutine nc_get_var_slab_2d(ncid, varid, start, count, data, ierr)

Windowed read of a 2D variable: start/count (length 2, FORTRAN dimension order) select the block that lands in data, whose shape must equal count. The per-rank readers (bathymetry, supergrid) use it to load only the rows their tile needs.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ncid
integer, intent(in) :: varid
integer, intent(in) :: start(2)
integer, intent(in) :: count(2)
real(kind=wp), intent(inout) :: data(:,:)
integer, intent(out), optional :: ierr

Non-zero on failure when present; absent behaves as today (error stop).


Calls

proc~~nc_get_var_slab_2d~~CallsGraph proc~nc_get_var_slab_2d nc_get_var_slab_2d nf90_get_var nf90_get_var proc~nc_get_var_slab_2d->nf90_get_var proc~nc_check nc_check proc~nc_get_var_slab_2d->proc~nc_check nf90_strerror nf90_strerror proc~nc_check->nf90_strerror proc~fail fail proc~nc_check->proc~fail error error proc~fail->error proc~error_ring_push error_ring_push proc~fail->proc~error_ring_push

Called by

proc~~nc_get_var_slab_2d~~CalledByGraph proc~nc_get_var_slab_2d nc_get_var_slab_2d proc~load_bathymetry_into_array load_bathymetry_into_array proc~load_bathymetry_into_array->proc~nc_get_var_slab_2d proc~metrics_fill_from_supergrid metrics_fill_from_supergrid proc~metrics_fill_from_supergrid->proc~nc_get_var_slab_2d proc~configure_ocean_metrics configure_ocean_metrics proc~configure_ocean_metrics->proc~metrics_fill_from_supergrid proc~ocean_state_seed_from_cfg ocean_state_seed_from_cfg proc~ocean_state_seed_from_cfg->proc~load_bathymetry_into_array proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_metrics proc~engine_setup->proc~ocean_state_seed_from_cfg proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Source Code

   subroutine nc_get_var_slab_2d(ncid, varid, start, count, data, ierr)
      !! Windowed read of a 2D variable: `start`/`count` (length 2, FORTRAN
      !! dimension order) select the block that lands in `data`, whose
      !! shape must equal `count`.  The per-rank readers (bathymetry,
      !! supergrid) use it to load only the rows their tile needs.
      integer, intent(in) :: ncid, varid
      integer, intent(in) :: start(2), count(2)
      real(wp), intent(inout) :: data(:, :)
      integer, intent(out), optional :: ierr
         !! Non-zero on failure when present; absent behaves as today
         !! (`error stop`).

      call nc_check(nf90_get_var(ncid, varid, data, start=start, count=count), &
                    "reading NetCDF 2D window", ierr)

   end subroutine nc_get_var_slab_2d