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