nc_get_var_slab_3d Subroutine

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

Strided slab read: start/count are the NetCDF start/count vectors in FORTRAN dimension order, with length matching the target variable’s rank (3 for a 2D-field-plus-time variable, 4 for a 3D-field-plus-time variable). data is always a plain 3D Fortran array; for the 2D-plus-time case pass a target with a trailing singleton extent (data(:,:,1)) — the netcdf-fortran generic interface dispatches on the array RANK of data, not the length of start/count, so one routine covers both shapes. This is the first strided (non-full-variable) read in the tree — mirrors nc_put_var_4d_slice for the start/count shape, on the read side.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ncid
integer, intent(in) :: varid
integer, intent(in) :: start(:)
integer, intent(in) :: count(:)
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_3d~~CallsGraph proc~nc_get_var_slab_3d nc_get_var_slab_3d nf90_get_var nf90_get_var proc~nc_get_var_slab_3d->nf90_get_var proc~nc_check nc_check proc~nc_get_var_slab_3d->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_3d~~CalledByGraph proc~nc_get_var_slab_3d nc_get_var_slab_3d proc~data_input_read_slab_impl data_input_read_slab_impl proc~data_input_read_slab_impl->proc~nc_get_var_slab_3d proc~read_field_xyz read_field_xyz proc~read_field_xyz->proc~nc_get_var_slab_3d proc~data_input_refresh_brackets data_input_refresh_brackets proc~data_input_refresh_brackets->proc~data_input_read_slab_impl proc~register_common register_common proc~register_common->proc~data_input_read_slab_impl proc~seed_ts_from_zfile seed_ts_from_zfile proc~seed_ts_from_zfile->proc~read_field_xyz proc~ocean_data_input_register_2d ocean_data_input_register_2d proc~ocean_data_input_register_2d->proc~register_common proc~ocean_data_input_register_3d ocean_data_input_register_3d proc~ocean_data_input_register_3d->proc~register_common proc~ocean_data_input_register_segment_2d ocean_data_input_register_segment_2d proc~ocean_data_input_register_segment_2d->proc~register_common proc~ocean_data_input_register_segment_3d ocean_data_input_register_segment_3d proc~ocean_data_input_register_segment_3d->proc~register_common proc~ocean_data_input_update_all ocean_data_input_update_all proc~ocean_data_input_update_all->proc~data_input_refresh_brackets proc~seed_zinit_overlay seed_zinit_overlay proc~seed_zinit_overlay->proc~seed_ts_from_zfile proc~engine_step engine_step proc~engine_step->proc~ocean_data_input_update_all proc~ocean_data_input_load_static_2d ocean_data_input_load_static_2d proc~ocean_data_input_load_static_2d->proc~ocean_data_input_register_2d proc~ocean_state_seed_from_cfg ocean_state_seed_from_cfg proc~ocean_state_seed_from_cfg->proc~seed_zinit_overlay proc~register_tag register_tag proc~register_tag->proc~ocean_data_input_register_2d proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~engine_setup engine_setup proc~engine_setup->proc~ocean_state_seed_from_cfg proc~ocean_data_forcing_configure ocean_data_forcing_configure proc~ocean_data_forcing_configure->proc~register_tag proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~seed_cavity_draft seed_cavity_draft proc~seed_cavity_draft->proc~ocean_data_input_load_static_2d

Source Code

   subroutine nc_get_var_slab_3d(ncid, varid, start, count, data, ierr)
      !! Strided slab read: `start`/`count` are the NetCDF start/count
      !! vectors in FORTRAN dimension order, with length matching the
      !! target variable's rank (3 for a 2D-field-plus-time variable, 4
      !! for a 3D-field-plus-time variable).  `data` is always a plain
      !! 3D Fortran array; for the 2D-plus-time case pass a target with
      !! a trailing singleton extent (`data(:,:,1)`) — the netcdf-fortran
      !! generic interface dispatches on the array RANK of `data`, not
      !! the length of `start`/`count`, so one routine covers both
      !! shapes. This is the first strided (non-full-variable) read in
      !! the tree — mirrors `nc_put_var_4d_slice` for the start/count
      !! shape, on the read side.
      integer, intent(in) :: ncid, varid
      integer, intent(in) :: start(:), count(:)
      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 slab", ierr)

   end subroutine nc_get_var_slab_3d