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

Convert every GRIB1 field in a file to a GRIB2 field. More...

Go to the source code of this file.

Functions/Subroutines

subroutine cnv12 (ifl1, ifl2, ipack, usemiss, imiss, uvvect, table_ver)
 This subroutine converts every GRIB1 field in a file to a GRIB2 field.
 
subroutine cnvlevel (ltype, lval, ipdstmpl)
 This routine converts a GRIB1 Level type and Level value to GRIB2 values and fills in the appropriate PDT values for the level/layer information.
 
subroutine gds2gdt (kgds, igds, igdstmpl, idefnum, ideflist, iret)
 This routine converts a GRIB1 GDS (in format specfied in w3fi63.f) to necessary info for a GRIB2 Grid Definition Section.
 
subroutine pds2pdt (kpds, ipdsnum, ipdstmpl, numcoord, coordlist, iret)
 This routine converts a GRIB1 PDS (Section 1) info to a GRIB2 PDS (Section 4) info with appropriate Product Definition Template.
 
subroutine pds2pdtens (kpds, kens, kprob, xprob, kclust, kmember, ipdsnum, ipdstmpl, numcoord, coordlist, iret)
 This routine converts a GRIB1 PDS (Section 1) that includes NCEP ensemble PDS extensions to a GRIB2 PDS (Section 4) info with appropriate Product Definition Template.
 

Detailed Description

Convert every GRIB1 field in a file to a GRIB2 field.

Author
Stephen Gilbert
Date
2003-06-11

Definition in file cnv12.F90.

Function/Subroutine Documentation

◆ cnv12()

subroutine cnv12 ( integer, intent(in)  ifl1,
integer, intent(in)  ifl2,
integer, intent(in)  ipack,
logical, intent(in)  usemiss,
integer  imiss,
logical, intent(in)  uvvect,
integer  table_ver 
)

This subroutine converts every GRIB1 field in a file to a GRIB2 field.

U and V wind component fields are combined into a single GRIB2 message.

Program History Log

Date Programmer Comments
2003-06-11 Gilbert Initial
2003-05-19 Gilbert Changed Master Table Version Number from 1 to 2. Added check for grib1 table version with params 191 and 192 for ensemble probs.
2007-03-26 Gordon Added check for ECMWF data to reference ECMWF Conversion tables.
2007-10-11 Vuong Added check for ensemble probs if the kpds > 28
2008-01-28 Vuong Fixed the V-GRD BY SETTING THE LPDS(22) = -1 and increase the array size MAXPTS
2008-05-14 Vuong Add option -m0 No explicit missing values included within data values
2010-12-02 Vuong Changed Master Table Version Number from 2 to 6. - Add option -mastertable_ver_x where x is mater table version 2 to 10
2011-07-22 Vuong Changed variable kprob(1) to kpds(5) in calling routine param_g1_to_g2
2012-03-21 Vuong Set the Shape of Earth to 2 (oblate spheroid earth) for IMSSNOW (Polar Stereo graphic) Grid.
Parameters
[in]ifl1Fortran unit number of input GRIB1 file.
[in]ifl2Fortran unit number of output GRIB2 file.
[in]ipackGRIB2 packing option:
value option
0 simple packing
2 group packing
31 group pack with 1st order differencing
32 group pack with 2nd order differencing
40 JPEG2000 encoding
40000 JPEG2000 encoding (obsolete)
41 PNG encoding
40010 PNG encoding (obsolete)
If ipack .ne. one of the values above, 31 is used as a default.
[in]usemissuses missing value management (instead of bitmaps), for use ipack options 2, 31, and 32.
[in]imissMissing value management:
  • 0 No explicit missing values included within data values
  • 1 Primary missing values included within data values
[in]uvvectU/V vector control:
  • .true. combine U and V wind components into one GRIB2 msg.
  • .flase. does not combine U and V wind components
table_verMaster Table version where x is number from 2 to 10.
Author
Stephen Gilbert
Date
2003-06-11

Definition at line 47 of file cnv12.F90.

References addfield(), addgrid(), g2_gbytec(), gds2gdt(), gribcreate(), gribend(), mkieee(), params_ecmwf::param_ecmwf_g1_to_g2(), params::param_g1_to_g2(), pds2pdt(), pds2pdtens(), and skgb().

Referenced by cnvgrib().

◆ cnvlevel()

subroutine cnvlevel ( integer, intent(in)  ltype,
integer, intent(in)  lval,
integer, dimension(*), intent(inout)  ipdstmpl 
)

This routine converts a GRIB1 Level type and Level value to GRIB2 values and fills in the appropriate PDT values for the level/layer information.

Program History Log

Date Programmer Comments
2003-06-12 Gilbert Initial.
2011-01-13 Boi Vuong Added level/layer values from 235 to 239
Parameters
[in]ltypeGRIB1 level type (PDS octet 10)
[in]lvalGRIB1 level/layer value(s) (PDS octets 11 and 12)
[out]ipdstmplGRIB2 Product Definition Template values.
Author
Stephen Gilbert
Date
2003-06-12

Definition at line 1098 of file cnv12.F90.

Referenced by pds2pdt(), and pds2pdtens().

◆ gds2gdt()

subroutine gds2gdt ( integer, dimension(*), intent(in)  kgds,
integer, dimension(*), intent(out)  igds,
integer, dimension(*), intent(out)  igdstmpl,
integer, intent(out)  idefnum,
integer, dimension(*), intent(out)  ideflist,
integer, intent(out)  iret 
)

This routine converts a GRIB1 GDS (in format specfied in w3fi63.f) to necessary info for a GRIB2 Grid Definition Section.

Program History Log

Date Programmer Comments
2003-06-17 Gilbert Initial.
2004-04-27 Gilbert Added support for Gaussian grids.
2007-04-16 Vuong Added Curvilinear Orthogonal grids.
2007-05-29 Vuong Added Rotate Lat/Lon E-grid (203)
2010-05-10 Vuong Added Rotate Lat/Lon for Non-E Stagger grid (205)
2011-05-04 Vuong Corrected Arakawa Lat/Lon of grid points for Non-E Stagger grid (205)
Parameters
[in]kgdsGRIB1 GDS info as returned by w3fi63.f.
[out]igdsContains information read from the appropriate GRIB Grid Definition Section 3 for the field being returned. Must be dimensioned >= 5.
  • igds(1) Source of grid definition (see Code Table 3.0)
  • igds(2) Number of grid points in the defined grid.
  • igds(3) Number of octets needed for each additional grid points definition. Used to define number of points in each row (or column) for non-regular grids. = 0, if using regular grid.
  • igds(4) Interpretation of list for optional points definition. (Code Table 3.11)
  • igds(5) Grid Definition Template Number (Code Table 3.1)
[out]igdstmplGrid Definition Template values for GDT 3.igds(5)
[out]idefnumThe number of entries in array ideflist. i.e. number of rows (or columns) for which optional grid points are defined.
[out]ideflistOptional integer array containing the number of grid points contained in each row (or column).
[out]iretError return value:
  • 0 Successful
  • 1 Unrecognized GRIB1 grid data representation type
Author
Stephen Gilbert
Date
2003-06-17

Definition at line 406 of file cnv12.F90.

Referenced by cnv12().

◆ pds2pdt()

subroutine pds2pdt ( integer, dimension(*), intent(in)  kpds,
integer, intent(out)  ipdsnum,
integer, dimension(*), intent(out)  ipdstmpl,
integer, intent(out)  numcoord,
real, dimension(*), intent(out)  coordlist,
integer, intent(out)  iret 
)

This routine converts a GRIB1 PDS (Section 1) info to a GRIB2 PDS (Section 4) info with appropriate Product Definition Template.

Note
Use pds2pdtens for ensemble related PDS.

Program History Log

Date Programmer Comments
2003-06-12 Gilbert Initial.
2005-04-19 Gilbert Changed scaling factor used with potential vorticity surfaces.
2007-02-07 Gilbert fixed end date calculation
2007-03-26 Gordon Added check for ECMWF data to reference ECMWF Conversion tables.
2007-05-14 Boi Vuong Added Time Range Indicator 51 (Climatological Mean Value)
2009-05-20 Boi Vuong Added check for WAFS to use PDT 4.8 for Max Wind
2009-12-14 Boi Vuong Added check for WAFS to use PDT 4.15 for Icing, Turbulence and Cumulonimbus
2010-02-18 Boi Vuong Added Time Range Indicator 7
2010-08-10 Boi Vuong Removed check for WAFS to use PDT 4.8 for Max Wind
2011-10-24 Boi Vuong Added check for parameters (MAXUW, MAXVW, to set type of statistical processing (MIN and MAX)
Parameters
[in]kpdsGRIB1 PDS info as specified in W3FI63.
[out]ipdsnumGRIB2 Product Definition Template Number
[out]ipdstmplGRIB2 Product Definition Template entries for PDT 4.ipdsnum
[out]numcoordnumber of vertical discretisation values (not implemented)
[out]coordlistrtical discretisation values (not implemented)
[out]iretError return value:
  • 0 Successful
  • 1 Unrecognized GRIB1 Time Range Indicator
Author
Stephen Gilbert
Date
2003-06-12

Definition at line 788 of file cnv12.F90.

References cnvlevel(), params_ecmwf::param_ecmwf_g1_to_g2(), and params::param_g1_to_g2().

Referenced by cnv12().

◆ pds2pdtens()

subroutine pds2pdtens ( integer, dimension(*), intent(in)  kpds,
integer, dimension(*), intent(in)  kens,
integer, dimension(*), intent(in)  kprob,
real, dimension(*), intent(in)  xprob,
integer, dimension(*), intent(in)  kclust,
integer, dimension(*), intent(in)  kmember,
integer, intent(out)  ipdsnum,
integer, dimension(*), intent(out)  ipdstmpl,
integer, intent(out)  numcoord,
real, dimension(*), intent(out)  coordlist,
integer, intent(out)  iret 
)

This routine converts a GRIB1 PDS (Section 1) that includes NCEP ensemble PDS extensions to a GRIB2 PDS (Section 4) info with appropriate Product Definition Template.

Note
Use routine pds2pdt for non ensemble related PDS.

Program History Log

Date Programmer Comments
2003-06-12 Gilbert Initial.
2007-02-07 Gilbert fixed end date calculation
2007-05-14 Boi Vuong Added Time Range Indicator 51 (Climatological Mean Value)
Parameters
[in]kpdsGRIB1 PDS info as specified in W3FI63.
[in]kensEnsemble identification from PDS octets 41-45.
[in]kprobEnsemble probability info from PDS octets 46 & 47.
[in]xprobEnsemble probability info from PDS octets 48-55.
[in]kclustEnsemble cluster info from PDS octets 61-76.
[in]kmember-semble membership info from PDS octest 77-86.
[out]ipdsnumGRIB2 Product Definition Template Number.
[out]ipdstmplGRIB2 Product Definition Template entries for PDT 4.ipdsnum.
[out]numcoordnumber of vertical discretisation values (not implemented).
[out]coordlist-rtical discretisation values (not implemented).
[out]iretError return value:
  • 0 = Successful
  • 1 = Unrecognized GRIB1 Time Range Indicator for ensembles
  • 2 = Unrecognized GRIB1 Ensemble type
  • 10 = Unrecognized GRIB1 Time Range Indicator for probabilities
Author
Stephen Gilbert
Date
2003-06-12

Definition at line 1275 of file cnv12.F90.

References cnvlevel(), and params::param_g1_to_g2().

Referenced by cnv12().