nc_put_var_3d_slice_r4 Subroutine

public subroutine nc_put_var_3d_slice_r4(ncid, varid, data, time_index, ierr)

Write a 32-bit 2D slice into a 3D variable at a given time index. The real32 twin of nc_put_var_3d_slice: handing real64 data to an NF90_FLOAT variable is legal (netcdf converts) but writes the same bytes at twice the host->library traffic, so the diag writer stages the conversion itself and calls this.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ncid
integer, intent(in) :: varid
real(kind=real32), intent(in) :: data(:,:)
integer, intent(in) :: time_index
integer, intent(out), optional :: ierr

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


Calls

proc~~nc_put_var_3d_slice_r4~~CallsGraph proc~nc_put_var_3d_slice_r4 nc_put_var_3d_slice_r4 nf90_put_var nf90_put_var proc~nc_put_var_3d_slice_r4->nf90_put_var proc~nc_check nc_check proc~nc_put_var_3d_slice_r4->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_put_var_3d_slice_r4~~CalledByGraph proc~nc_put_var_3d_slice_r4 nc_put_var_3d_slice_r4 proc~nc_emit_post_fire nc_emit_post_fire proc~nc_emit_post_fire->proc~nc_put_var_3d_slice_r4

Source Code

   subroutine nc_put_var_3d_slice_r4(ncid, varid, data, time_index, ierr)
      !! Write a 32-bit 2D slice into a 3D variable at a given time index.
      !! The real32 twin of `nc_put_var_3d_slice`: handing real64 data to
      !! an `NF90_FLOAT` variable is legal (netcdf converts) but writes the
      !! same bytes at twice the host->library traffic, so the diag writer
      !! stages the conversion itself and calls this.
      integer, intent(in) :: ncid
      integer, intent(in) :: varid
      real(real32), intent(in) :: data(:, :)
      integer, intent(in) :: time_index
      integer, intent(out), optional :: ierr
         !! Non-zero on failure when present; absent behaves as today
         !! (`error stop`).

      call nc_check(nf90_put_var(ncid, varid, data, &
                                 start=[1, 1, time_index], &
                                 count=[size(data, 1), size(data, 2), 1]), &
                    "writing 3D slice (real32)", ierr)

   end subroutine nc_put_var_3d_slice_r4