Write a 32-bit real attribute to a variable. NetCDF rejects a
_FillValue whose type differs from the variable’s, so a variable
defined with NC_R4 must have its _FillValue / missing_value
written through here, not through nc_put_att_real (real64).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ncid | |||
| integer, | intent(in) | :: | varid | |||
| character(len=*), | intent(in) | :: | name | |||
| real(kind=real32), | intent(in) | :: | value | |||
| integer, | intent(out), | optional | :: | ierr |
Non-zero on failure when present; absent behaves as today
( |
subroutine nc_put_att_real_r4(ncid, varid, name, value, ierr) !! Write a 32-bit real attribute to a variable. NetCDF rejects a !! `_FillValue` whose type differs from the variable's, so a variable !! defined with `NC_R4` must have its `_FillValue` / `missing_value` !! written through here, not through `nc_put_att_real` (real64). integer, intent(in) :: ncid integer, intent(in) :: varid character(len=*), intent(in) :: name real(real32), intent(in) :: value integer, intent(out), optional :: ierr !! Non-zero on failure when present; absent behaves as today !! (`error stop`). call nc_check(nf90_put_att(ncid, varid, name, value), & "writing real32 attribute "//trim(name), ierr) end subroutine nc_put_att_real_r4