CFIO_PutCharAtt Subroutine

public subroutine CFIO_PutCharAtt(fid, name, count, buf, rc)

CFIO_PutCharAtt – Write a user-defined character attribute

This routine allows the user to define a character (string) attribute in an open CFIO file.

History

  • 1998.07.30 Lucchesi Initial interface design.
  • 1998.07.30 Lucchesi Initial coding.
  • 1998.09.24 Lucchesi Changed error handling.

Arguments

Type IntentOptional 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)


Calls

proc~~cfio_putcharatt~~CallsGraph proc~cfio_putcharatt CFIO_PutCharAtt nf90_enddef nf90_enddef proc~cfio_putcharatt->nf90_enddef nf90_put_att nf90_put_att proc~cfio_putcharatt->nf90_put_att nf90_redef nf90_redef proc~cfio_putcharatt->nf90_redef proc~err err proc~cfio_putcharatt->proc~err

Called by

proc~~cfio_putcharatt~~CalledByGraph proc~cfio_putcharatt CFIO_PutCharAtt proc~esmf_cfiosdffilecreate ESMF_CFIOSdfFileCreate proc~esmf_cfiosdffilecreate->proc~cfio_putcharatt proc~esmf_cfiofilecreate ESMF_CFIOFileCreate proc~esmf_cfiofilecreate->proc~esmf_cfiosdffilecreate proc~mapl_cfiocreatewrite MAPL_CFIOCreatewrite proc~mapl_cfiocreatewrite->proc~esmf_cfiofilecreate program~test~10 test program~test~10->proc~esmf_cfiofilecreate program~test~11 test program~test~11->proc~esmf_cfiofilecreate program~test~12 test program~test~12->proc~esmf_cfiofilecreate program~test~13 test program~test~13->proc~esmf_cfiofilecreate program~test~14 test program~test~14->proc~esmf_cfiofilecreate program~test~3 test program~test~3->proc~esmf_cfiofilecreate program~test~5 test program~test~5->proc~esmf_cfiofilecreate program~test~7 test program~test~7->proc~esmf_cfiofilecreate program~test~8 test program~test~8->proc~esmf_cfiofilecreate program~test~9 test program~test~9->proc~esmf_cfiofilecreate

Source Code

      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