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.
| Type | Intent | Optional | 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
( |
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