nc_get_var_3d Subroutine

public subroutine nc_get_var_3d(ncid, varid, data, ierr)

Read a full 3D array. Mirrors nc_get_var_2d; the target’s shape must match the file variable’s Fortran storage order (the caller handles any C/Fortran dimension reversal, as rdb_bathymetry does for 2D).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ncid
integer, intent(in) :: varid
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_3d~~CallsGraph proc~nc_get_var_3d nc_get_var_3d nf90_get_var nf90_get_var proc~nc_get_var_3d->nf90_get_var proc~nc_check nc_check proc~nc_get_var_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

Source Code

   subroutine nc_get_var_3d(ncid, varid, data, ierr)
      !! Read a full 3D array.  Mirrors `nc_get_var_2d`; the target's
      !! shape must match the file variable's Fortran storage order
      !! (the caller handles any C/Fortran dimension reversal, as
      !! `rdb_bathymetry` does for 2D).
      integer, intent(in) :: ncid
      integer, intent(in) :: varid
      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), "reading 3D variable", ierr)

   end subroutine nc_get_var_3d