NCEPLIBS-g2 4.0.0
Loading...
Searching...
No Matches
tocgrib.F90 File Reference

Create new GRIB2 file from exiting GRIB2 file. More...

Go to the source code of this file.

Functions/Subroutines

subroutine mkfldsep (csep, iopt, lenin, lenbull, lenout)
 Generates a TOC Flag Field Separator Block used to separate WMO Bulletins within a transmission file to be ingested in TOC's FTP Input Service, which can be used to disseminate WMO buletins (see http://weather.gov/tg/ftpingest.html).
 
program tocgrib
 Create new GRIB2 file from exiting GRIB2 file.
 

Detailed Description

Create new GRIB2 file from exiting GRIB2 file.

Author
Gilbert
Date
2003-03-28

Definition in file tocgrib.F90.

Function/Subroutine Documentation

◆ mkfldsep()

subroutine mkfldsep ( character*(*), intent(out)  csep,
integer, intent(in)  iopt,
integer, intent(in)  lenin,
integer, intent(in)  lenbull,
integer, intent(out)  lenout 
)

Generates a TOC Flag Field Separator Block used to separate WMO Bulletins within a transmission file to be ingested in TOC's FTP Input Service, which can be used to disseminate WMO buletins (see http://weather.gov/tg/ftpingest.html).

This routine can generate different flag field separator blocks depending on the value of variable iopt.

Bulletin "Flag Field Separator" block - OPTION 1 (old)

Bytes Description
1 - 4 marker string (####)
5 - 7 block length [018 fixed value]
8 - 13 total length of bulletin in bytes [octets] (not including the flag field block)
14 - 17 marker string (####)
18 line Feed (ASCII "0A")

Bulletin "Flag Field Separator" block - OPTION 1a (new)

Bytes Description
1 - 4 marker string (####)
5 - 7 block length (nnn) - value always greater than 018
8 - 18 total length of bulletin in bytes [octets] (not including the flag field block)
19 - nnn-5 reserved for future use
nnn-4 - nnn-1 marker string (####)
nnn line Feed (ASCII "0A")

Bulletin "Flag Field Separator" block - OPTION 2 (limited)

Bytes Description
1 - 4 marker string (****)
5 - 14 total length of bulletin in bytes [octets] (not including the flag field block)
15 - 18 marker string (****)
19 line Feed (ASCII "0A")
Parameters
[out]csep*(*)Character array containing the flag field separator.
[in]ioptFlag Field Separator block option:
  • 1 Separator block for use with alphanumeric bulletins.
    • if lenin <= 18 and lenbull <= 999999, OPTION 1 block will be generated.
    • if lenin > 18 or lenbull > 999999, OPTION 1a block will be generated.
  • 2 Separator block for use with GRIB/BUFR bulletins.
[in]leninDesired length of the flag field separator block. ignored, if iopt=2.
[in]lenbullInteger length of the bulletin (in bytes) that will follow this separator block.
[out]lenoutInteger length of the flag field separator block.
Author
Gilbert
Date
2002-09-16

Definition at line 297 of file tocgrib.F90.

Referenced by tocgrib(), tocgrib2(), and tocgrib2super().

◆ tocgrib()

program tocgrib

Create new GRIB2 file from exiting GRIB2 file.

This program reads selected GRIB2 fields from a file, adds a TOC Flag Field separator block and WMO Header in front of each GRIB2 field, and writes them out to a new file. The output file is in the format required for TOC's FTP Input Service, which can be used to disseminate the GRIB bulletins. This service is described at http://weather.gov/tg/ftpingest.html.

Input Files

  • 5 list of grib fields and associated wmo headers.
  • 11 input grib file.
  • 31 corresponding input grib index file.
  • parm pass in 4 characters 'kwbx' with parm field

Output Files (Including Scratch Files)

  • 6 standard fortran print file
  • 51 output grib bulletin file in toc format
Returns
  • 0 Successful run
  • 10 Error opening input GRIB data file
  • 20 Error opening output GRIB transmission file
  • 19 Error reading control card file - all bulletins missing
  • 30 Some BULLETINS ARE MISSING
Author
Gilbert
Date
2003-03-28

Definition at line 32 of file tocgrib.F90.

References makwmo(), and mkfldsep().