WRATT3() and WRATTC()

Fortran version:

    LOGICAL FUNCTION   WRATT3( FNAME, VNAME,
 &                             ANAME, ATYPE, ASIZE, AVAL )
    LOGICAL ENTRY      WRATTC( FNAME, VNAME, ANAME, CVAL )

        CHARACTER*(*), INTENT(IN   ) :: FNAME         !  logical file name
        CHARACTER*(*), INTENT(IN   ) :: VNAME         !  variable name, or ALLVARS3
        CHARACTER*(*), INTENT(IN   ) :: ANAME         !  attribute name
        INTEGER      , INTENT(IN   ) :: ATYPE         !  attribute type (M3CHAR, M3REAL, M3INT, M3INT8, M3DBLE)
        INTEGER      , INTENT(IN   ) :: ASIZE         !  attribute size
        REAL         , INTENT(IN   ) :: AVAL( AMAX )  !  attribute value (numeric)
        CHARACTER*(*), INTENT(IN   ) :: CVAL          !  attribute value (character-string)

C version:

wratt3c() is a C wrapper calling the Fortran WRATT3() and WRATTC():
    integer wratt3c( const char          * fname ,
                     const char          * vname ,
                     const char          * aname ,
                     int                   atype ,
                     int                   asize ,
                     void                * aval )

Summary:

WRATT3() writes the numeric (INTEGER, REAL, or DOUBLE attribute named ANAME for the variable VNAME to the file with logical name FNAME from the array AVAL(AMAX); WRATTC() writes the CHARACTER string valued attribute CVAL.

Returns .TRUE. (or 1) if the operation succeeds, .FALSE. (or 0) if it fails. For failure, writes a log message indicating the nature of the failure.

For Fortran-90 declarations:

    USE M3UTILIO
    

Preconditions:

USE M3UTILIO or INCLUDE 'IODECL3.EXT' for Fortran, or #include "iodecl3.h" and #include "fdesc3.h" for C.

I/O API must already be initialized by a call to INIT3().

Names FNAME and VNAME must have length at most 16, exclusive of trailing blanks.

File FNAME must be netCDF-based rather than "buffered" or "virtual"; it must already have been opened by OPEN3() or open3c().

There is a significant performance penalty if the WRATT*() routines are called after data has been written to the file, since in that case the underlying netCDF run-time will create a copy of the entire existing file that contains the new attribute, and then rename the copy to the original file name.

See Also:

Fortran Usage:

    ...
    USE M3UTILIO
    ...
    <under construction>
    ...

C Usage:

    ...
    #include "iodecl3.h"
    ...
    <under construction>
    ...


Previous: RDATT3 and RDATTC()

Next: FILCHK3()

Up: I/O API: Public Routines

To: Models-3/EDSS I/O API: The Help Pages