CFIO_PutCharAtt
– Write a user-defined character attribute
This routine allows the user to define a character (string) attribute in an open CFIO file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | fid |
File handle |
|||
character(len=*) | :: | name |
Name of attribute |
|||
integer | :: | count |
Number of characters to write |
|||
character(len=MLEN) | :: | buf |
Buffer containing string |
|||
integer | :: | rc |
Error return code: rc = 0 all is well NetCDF Errors rc = -36 error from NF90_PUT_ATT (global attribute) rc = -55 error from NF90_REDEF (enter define mode) rc = -56 error from NF90_ENDDEF (exit define mode) |
subroutine CFIO_PutCharAtt ( fid, name, count, buf, rc ) ! ! !USES: ! Implicit NONE ! ! !INPUT PARAMETERS: ! integer fid !! File handle character(len=*) name !! Name of attribute integer count !! Number of characters to write character(len=MLEN) :: buf !! Buffer containing string ! ! !OUTPUT PARAMETERS: ! integer rc !! Error return code: !! rc = 0 all is well !! !! NetCDF Errors !! ------------- !! rc = -36 error from NF90_PUT_ATT (global attribute) !! rc = -55 error from NF90_REDEF (enter define mode) !! rc = -56 error from NF90_ENDDEF (exit define mode) ! !------------------------------------------------------------------------- _UNUSED_DUMMY(count) rc = NF90_REDEF ( fid ) if (err("PutCharAtt: could not enter define mode",rc,-55) .NE. 0) & return rc = NF90_PUT_ATT ( fid, NF90_GLOBAL, name, buf ) if (err("PutCharAtt: error writing attribute",rc,-36) .NE. 0) & return rc = NF90_ENDDEF(fid) if (err("PutCharAtt: could not exit define mode",rc,-56) .NE. 0) & return rc = 0 return end subroutine CFIO_PutCharAtt