KFWRITE()

Fortran version:

    INTEGER FUNCTION KFWRITE( FNAME, COL, ROW, SDATE, STIME, KFLEN, VBLES )
        CHARACTER*(*), INTENT(IN   ) :: FNAME      !  logical file name
        INTEGER      , INTENT(IN   ) :: COL        !  column number for this event
        INTEGER      , INTENT(IN   ) :: ROW        !  row    number for this event
        INTEGER      , INTENT(IN   ) :: SDATE      !  starting date, formatted YYYYDDD
        INTEGER      , INTENT(IN   ) :: STIME      !  starting time, formatted HHMMSS
        INTEGER      , INTENT(IN   ) :: KFLEN      !  event duration, formatted HHMMSS
        REAL         , INTENT(IN   ) :: VBLES(*)   !  output buffer array

C version:

not yet implemented

Summary:

Reads all data for the indicated event at COL:ROW:JDATE:JTIME and having duration KFLEN to the EDSS/Models-3 I/O API KF event file with logical name FNAME, along with writing the event's description:

KFWRITE() is OpenMP thread-safe.

Returns the record number at which the event is written (e.g., for further use with KFREAD()), or -1 if it fails. For failure, writes a log message indicating the nature of the failure.

Preconditions:

INCLUDE 'IODECL3.EXT' and INCLUDE 'FDESC3.EXT' for Fortran.

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

FNAME must have length at most 16.

FNAME must already have been opened by OPEN3() or KFOPEN().

Dimensionality of the VBLES argument should be VBLES(NLAYS3D,NVARS3D).

See Also:

Fortran Usage:

    ...
    INCLUDE 'IODECL3.EXT'
    INCLUDE 'PARMS3.EXT'
    ...
    INTEGER NCOLS, NROWS, NLAYS, NTHIK
    PARAMETER ( NCOLS = ??, NROWS = ??, NLAYS = ??, NTHIK = ?? )
    ...
        INTEGER       ECOUNT     !  # of events for this col-row
        INTEGER       SDATES(NTHIK)  !  starting date,  formatted YYYYDDD
        INTEGER       STIMES(NTHIK)  !  starting time,  formatted HHMMSS
        INTEGER       KFLENS(NTHIK)  !  event duration, formatted HHMMSS
        INTEGER       EVENTS(NTHIK)  !  event numbers
        REAL          TA(NLAYS)      !  buffer for variable 'TA'
        REAL          QV(NLAYS)      !  buffer for variable 'QV'
        REAL          PR(NLAYS)      !  buffer for variable 'PR'
        REAL          VBLES(NLAYS,3)
        EQUIVALENCE ( VBLES(1,1), TA(1) )
        EQUIVALENCE ( VBLES(1,2), QV(1) )
        EQUIVALENCE ( VBLES(1,3), PR(1) )
        INTEGER       C, R, IEVENT
        INTEGER       JDATE, JTIME, KFLEN
    ...
    !!  suppose MYFILE is opened, and has 3 vbles TA, QV, PR, etc.
    ...
    DO  R = 1, NROWS
    DO  C = 1, NCOLS
        ...     
            !!  suppose we want to write  a KF event at
            !!   C,R,JDATE;JTIME with duration KFLEN

        IEVENT =  KFWRITE( 'MYFILE', C, R, JDATE, JTIME, KFLEN, VBLES )
        IF ( IEVENT .LT. 0 ) THEN
             !!  Error:  see program log for further info.
             ...
        END IF              !  if KFWRITE() succeeded
        ...

    END DO
    END DO
    ...

C Usage:

Don't, unless you know what you're doing with multi-lingual programming.


Previous: KFREAD

Next: INQATT3

Up: I/O API: Public Routines

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