W3FI66

The W3FI66 routine blocks reports which have been packed into NMC Office
           Note 29 character format into fixed-length records.

USAGE:    CALL W3FI66(COCBUF,COCBLK,NFLAG,NSIZE)

   Input argument list:
      COCBUF   - CHARACTER*10 ARRAY CONTAINING A SINGLE PACKED REPORT
               - IN OFFICE NOTE 29/124 FORMAT.
      COCBLK   - CHARACTER*10 ARRAY HOLDING A BLOCK OF PACKED REPORTS
               - UP TO AND INCLUDING THE PREVIOUS ONE
      NFLAG    - MARKER INDICATING RELATIVE LOCATION (IN BYTES)
               - OF END OF LAST REPORT IN COCBLK.  EXCEPTION:
               - NFLAG MUST BE SET TO ZERO PRIOR TO BLOCKING THE FIRST
               - PACKED REPORT INTO A NEW BLOCK.  SUBSEQUENTLY, THE
               - VALUE OF NFLAG RETURNED BY THE PREVIOUS CALL TO W3FI66
               - SHOULD BE USED AS INPUT. (SEE OUTPUT ARGUMENT LIST
               - BELOW.)  IF NFLAG IS NEGATIVE, W3FI66 WILL RETURN
               - IMMEDIATELY WITHOUT ACTION.
      NSIZE    - MAXIMUM NUMBER OF CHARACTERS IN COCBLK ARRAY
                 (SHOULD BE A MULTIPLE OF 4)
 
   Output argument list:
      COCBLK   - CHARACTER*10 ARRAY HOLDING A BLOCK OF PACKED REPORTS
               - UP TO AND INCLUDING THE CURRENT ONE
      NFLAG    - MARKER INDICATING RELATIVE LOCATION (IN BYTES)
               - OF END OF CURRENT REPORT IN COCBLK.  NFLAG
               - WILL BE SET TO -1 IF W3FI66 CANNOT FIT THE CURRENT
               - PACKED REPORT INTO THE REMAINDER OF THE BLOCK (I.E.,
               - THE BLOCK IS FULL). NFLAG WILL NOT CHANGE FROM ITS
               - INPUT ARGUMENT VALUE IF THE STRING "END REPORT" IS
               - NOT FOUND AT THE END OF THE CURRENT REPORT. (CURRENT
               - PACKED REPORT HAS INVALID LENGTH AND IS NOT BLOCKED)
 
   Output files:
      FT06F001 - PRINTOUT
 
  REMARKS: 
          The user must set nflag to zero each time the array is
     to be filled with packed reports in Office Note 29/124 format.
     w3fi66 will then insert the first report and fill the remainder
     of the output array cocblk with the string 'end record'.
          An attempt is made to insert a report in the output array
     each time w3fi66 is called.  If the remaining portion of the
     output array is not large enough to hold the current report,
     w3fi66 sets nflag to -1.  The user should then output the
     blocked record, set nflag to zero, and call w3fi66 again with
     the same report in the input array.
         After a given report is successfully blocked into cocblk,
     w3fi66 sets nflag as a pointer for the next report to be blocked.
     This pointer is a relative address and a character count.
         The three characters specifying the length of the report
     are checked for valid character numbers and the value is tested
     for pointing to the end of the report (string "end report"). If
     invalid, the report is not inserted into the block and there is
     an immediate return to the user.  In this case, the value of
     nflag does not change from its input value.

 
W3lib.tar Library contains Fortran 90 decoder/encoder routines for GRIB edition 1. (Fortran90)
Date posted: 2/22/2007