NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
iw3unp29.f File Reference

Reads and unpacks one report into the unpacked office note 29/124 format. More...

Go to the source code of this file.

Functions/Subroutines

character *6 function c01o29 (subset)
 This function read subset and returns group name.
 
character *8 function c02o29 ()
 
function i01o29 (lunit, hdr, ier)
 This function read obs files and returns error message.
 
function i02o29 (lunit, obs, ier)
 This function read obs files and returns error message.
 
function i03o29 (nunit, obs, ier)
 This function reads a true (see *) on29/124 data set and unpacks one report into the unpacked office note 29/124 format.
 
function i04o29 (p)
 
function i05o29 (string, num, char)
 This function finds the location of the next numeric character in a string of characters.
 
function iw3unp29 (lunit, obs, ier)
 This routine has not been tested reading input data from any dump type in ON29/124 format on WCOSS.
 
logical function l01o29 ()
 
function r01o29 (subset, lunit, obs)
 This function read subset and returns corresponding file data.
 
function r02o29 ()
 
function r03o29 (lunit, obs)
 
function r04o29 (lunit, obs)
 
function r05o29 (lunit, obs)
 
function r06o29 (lunit, obs)
 
function r07o29 (lunit, obs)
 
subroutine s01o29 (sid, xob, yob, rhr, rch, rsv, rsv2, elv, itp, rtp)
 
subroutine s02o29 (icat, n,)
 
subroutine s03o29 (unp, subset,,)
 
subroutine s04o29
 
subroutine s05o29
 
subroutine s06o29 (iden, id)
 This subrountine modifies amdar reports so that last character ends with 'Z'.
 

Detailed Description

Reads and unpacks one report into the unpacked office note 29/124 format.

Author
Dennis Keyser
Date
2013-03-20

Definition in file iw3unp29.f.

Function/Subroutine Documentation

◆ c01o29()

character*6 function c01o29 ( character*(*)  subset)

This function read subset and returns group name.

Parameters
SUBSETsubset
Returns
group name
Author
Dennis Keyser
Date
2013-03-20

Definition at line 929 of file iw3unp29.f.

◆ c02o29()

character*8 function c02o29

Definition at line 2021 of file iw3unp29.f.

◆ i01o29()

function i01o29 (   lunit,
dimension(*)  hdr,
  ier 
)

This function read obs files and returns error message.

Parameters
LUNITfull path of file
HDRheader of file
IERmissing or invalid data indicator
Returns
Y2K COMPLIANT
Author
Dennis Keyser
Date
2013-03-20

Definition at line 476 of file iw3unp29.f.

◆ i02o29()

function i02o29 (   lunit,
dimension(1608)  obs,
  ier 
)

This function read obs files and returns error message.

Parameters
LUNITfull path of file
OBSdata output
IERmissing or invalid data indicator
Returns
Y2K COMPLIANT
Author
Dennis Keyser
Date
2013-03-20

Definition at line 545 of file iw3unp29.f.

◆ i03o29()

function i03o29 (   nunit,
integer, dimension(*)  obs,
  ier 
)

This function reads a true (see *) on29/124 data set and unpacks one report into the unpacked office note 29/124 format.

the input and output arguments here have the same meaning as for iw3unp29. repeated calls of function will return a sequence of unpacked on29/124 reports. * - unlike original "true" on29/124 data sets, the "expected" file header label is a y2k compliant 40-byte pseudo-on85 version - if this is not encountered this code, as a temporary measure during the y2k transition period, will look for the original non-y2k compliant 32-byte on85 header label and use the "windowing" technique to convert the 2-digit year to a 4-digit year in preparation for returning a 40-byte pseudo-on85 label in the first C call. (see iw3unp29 docblock for format of 40-byte pseudo-on85 header label.)

Program History Log: -1991-07-23 Dennis Keyser w3fi64 (f77) internal read error no longer causes calling program to fail but will move to next record if can't recover to next report -1993-10-07 Dennis Keyser – adapted for use on cray (added save statement, removed ibm-specific code, etc.) -1993-10-15 R. E. Jones added code so if file is ebcdic it converts it to ascii -1996-10-04 Jack Woollen changed name to i03gad and incorporated into new w3lib routine iw3gad -2013-03-20 Dennis Keyser changes to run on wcoss

Parameters
[in]nunitfortran unit number for sequential data set containing packed and blocked office note 29/124 reports
[out]obsarray containing one report in unpacked office note
  • 29/124 format is mixed, user must equivalence
  • integer and character arrays to this array (see
  • docblock for w3fi64 in /nwprod/lib/sorc/w3nco
  • or writeups on w3fi64, on29, on124 for help)
  • the length of the array should be at least 1608
[out]ierreturn flag (equal to function value) in iw3unp29 docblock
Returns
Y2K COMPLIANT
Note
aa unit number specified by input argument "nunit") called by subprogram iw3unp29.
Author
keyser
Date
2013-03-20

Definition at line 695 of file iw3unp29.f.

◆ i04o29()

function i04o29 (   p)

Definition at line 1603 of file iw3unp29.f.

◆ i05o29()

function i05o29 ( character*1, dimension(1)  string,
  num,
character*1  char 
)

This function finds the location of the next numeric character in a string of characters.

Parameters
[in]STRINGCharacter array.
[in]NUMNumber of characters to search in string.
[out]CHARCharacter found.
Returns
I05O29 Integer*4 location of alphanumeric character, = 0 if not found.
Author
Ray Crayton
Date
1989-07-07

Definition at line 4584 of file iw3unp29.f.

◆ iw3unp29()

function iw3unp29 (   lunit,
dimension(*)  obs,
  ier 
)

This routine has not been tested reading input data from any dump type in ON29/124 format on WCOSS.

It likely will not work when attempting to read ON29/124 format dumps on WCOSS. It has also not been tested reading any dump file other than ADPUPA (BUFR input only) on WCOSS. It does work reading BUFR ADPUPA dump files on WCOSS. It will hopefully working reading other BUFR (only) dump files on WCOSS. Also, this routine is only known to work correctly when compiled using 8 byte machine words (real and integer).

Reads and unpacks one report into the unpacked office note 29/124 format. The input data may be packed into either bufr or true on29/124 format with a y2k compliant pseudo-on85 header label. (Note: as a temporary measure, this code will still operate on a true on29/124 format file with a non-y2k compliant on85 header label. The code will use the "windowing" technique to obtain a 4-digit year.) This routine will determine the format of the input data and take the appropriate action. It returns the unpacked report to the calling program in the array 'obs'. Various contingencies are covered by return value of the function and parameter 'ier' - function and ier have same value. Repeated calls of function will return a sequence of unpacked on29/124 reports. The calling program may switch to a new 'nunit' at any time, that dataset will then be read in sequence. If user switches back to a previous 'nunit', that data set will be read from the beginning, not from where the user left off (this is a 'software tool', not an entire i/o system).

Program history log:

  • Jack Woollen 1996-12-13 (gsc) Note this new version of iw3gad incorporates the earlier version which was written by j. stackpole and dealt only with true on29/124 data as input - this option is still available but is a small part of the new routine which was written from scratch to read in bufr data.
  • Dennis Keyser 1997-01-27 Changes to more closely duplicate format obtained when reading from true on29/124 data sets.
  • Dennis Keyser 1997-02-04 Drops with missing stnid get stnid set to "drp88a"; satwnds with zero pressure are tossed.
  • Dennis Keyser 1997-02-12 To get around the 3-bit limitation to the on29 pressure q.m. mnemonic "qmpr", an sdmedit/quips purge or reject flag on pressure is changed from 12 or 14 to 6 in order to fit into 3-bits, see function e35o29; interprets sdmedit and quips purge/keep/change flags properly for all data types; can now process cat. 6 and cat. 2/3 type flight-level reccos (before skipped these); tests for missing lat, lon, obtime decoded from bufr and retains missing value on these in unpacked on29/124 format (before no missing check, led to possible non- missing but incorrect values for these); the check for drops with missing stnid removed since decoder fixed for this.
  • Dennis Keyser 1997-05-01 Looks for duplicate levels when processing on29 cat. 2, 3, and 4 (in all data on level) and removes duplicate level; in processing on29 cat. 3 levels, removes all levels where wind is missing; fixed bug in aircraft (airep/pirep/amdar) quality mark assignment (was not assigning keep flag to report if pressure had a keep q.m. but temperature q.m. was missing).
  • Dennis Keyser 1997-05-30 For aircft: (only acars right now) - seconds are decoded (if avail.) and used to obtain report time; only asdar/amdar - new cat. 8 code figs. o-put 917 (char. 1 & 2 of actual stnid), 918 (char. 3 & 4 of actual stnid), 919 (char. 5 & 6 of actual stnid); asdar/amdar and acars - new cat. 8 code fig. o-put 920 (char. 7 & 8 of actual stnid); only acars - new cat. 8 code fig. o-put 921 (report time to nearest 1000'th of an hour); only some acars - new mnemonic "ialt" now exists and can (if line not commented out) be used to obtain unpacked on29 cat. 6.
  • Dennis Keyser 1997-07-02 Removed filtering of aircraft data as follows: air france amdars no longer filtered, amdar/ asdar below 7500 ft. no longer filtered, airep/pirep below 100 meters no longer filtered, all aircraft with missing wind but valid temperature are no longer filtered; reprocesses u.s. satwnd stn. ids to conform with previous on29 appearance except now 8-char (tag char. 1 & 6 not changed from bufr stn. id) - never any dupl. ids now for u.s. satwnds decoded from a single bufr file; streamlined/eliminated some do loops to speed up a bit.
  • Dennis Keyser 1997-09-18 Corrected errors in reformatting surface data into unpacked on124, specifically-header: inst. type (synoptic fmt flg, auto stn. type, converted hrly flg), indicators (precip., wind speed, wx/auto stn), cat51: p-tend, horiz. viz., present/past wx, cloud info, max/ min temp, cat52: precip., snow dpth, wave info, ship course/speed, cat8: code figs. 81-85,98; corrected problem which coded upper-air mandatory level winds as cat. 3 instead of cat. 1 when mass data (only) was reported on same mandatory level in a separate reported level in the raw bulletin.
  • Dennis Keyser 1997-10-06 Updated logic to read and process nesdis hi-density satellite winds properly.
  • Dennis Keyser 1997-10-30 Added gross check on u-air pressure, all levels with reported pressure .le. zero now tossed; sfc cat. 52 sea-sfc temperature now read from hierarchy of sst in bufr {1st choice - hi-res sst ('sst2'), 2nd choice - lo-res sst ('sst1'), 3rd choice - sea temp ('stmp')}, before only read 'sst1'.
  • Dennis Keyser 1998-01-26 Changed pqm processing for adpupa types such that sdmedit flags are now honored (before, pqm was always hardwired to 2 for adpupa types); bumped limit for number of levels that can be processed from 100 to 150 and added diagnostic print when the limit is exceeded.
  • Dennis Keyser 1998-05-19 Y2k compliant version of iw3gad routine accomplished by redefining original 32-character on85 header label to be a 40-character label that contains a full 4-digit year, can still read "true" on29/124 data sets provided their header label is in this modified form.
  • Dennis Keyser 1998-07-22 Minor modifications to account for corrections in y2k/f90 bufrlib (mainly related to bufrlib routine dumpbf).
  • Dennis Keyser 1998-08-04 Fixed a bug that resulted in code being clobbered in certain situations for recco reports; minor modifications to give same answers on cray as on sgi; allowed code to read true on29/124 files with non-y2k compliant on85 label (a temporary measure during transition of main programs to y2k); added call to "aea" which converts ebcdic characters to ascii for input true on29/124 data set processing of sgi (which does not support "-cebcdic" in assign statement).
  • Dennis Keyser 1999-02-25 Added ability to read reprocessed ssm/i bufr data set (spssmi); added ability to read mean sea-level pressure bogus (paobs) data set (sfcbog).
  • Dennis Keyser 1999-05-14 Made changes necessary to port this routine to the ibm sp.
  • Dennis Keyser 1999-06-18 Can now process water vapor satwnds from foreign producers; stn. id for foreign satwnds now reprocessed in same way as for nesdis/goes satwnds, character 1 of stn. id now defines even vs. odd satellite while character 6 of stn. id now defines ir cloud-drft vs. visible cloud drft vs. water vapor.
  • Dennis Keyser 2002-03-05 Removed entry "e02o29", now performs height to press. conversion directly in code for cat. 7; test for missing "rpid" corrected for adpupa data (now checks ufbint return code rather than value=bmiss); accounts for changes in input adpupa, adpsfc, aircft and aircar bufr dump files after 3/2002: cat. 7 and cat. 51 use mnemonic "hblcs" to get height of cloud base if mnemonic "hocb" not available (and it will not be for all cat. 7 and some cat. 51 reports); mnemonic "tiwm" replaces "suws" in header for surface data; mnemonic "borg" replaces "icli" in cat. 8 for aircraft data (will still work properly for input adpupa, adpsfc, aircft and aircar dump files prior to 3/2002).
  • Dennis Keyser 2013-03-20 Changes to run on wcoss, obtain value of bmiss set in calling program via call to bufrlib routine getbmiss rather than hardwiring it to 10e08 (or 10e10); use formatted print statements where previously unformatted print was used (wcoss splits unformatted print at 80 characters).
Parameters
[in]lunitfortran unit number for sequential data set containing packed bufr reports or packed and blocked office note 29/124 reports
[out]obsarray containing one report in unpacked office note 29/124 format. Format is mixed, user must equivalence integer and character arrays to this array (see docblock for w3fi64 in /nwprod/lib/sorc/w3nco or writeups on w3fi64, on29, on124 for help) the length of the array should be at least 1608.
[out]ierreturn flag (equal to function value)

Input files:

  • unit aa sequential bufr or office note 29/124 data set ("aa" is unit number specified by input argument "nunit")

Output files:

  • unit 06 printout
Note
  • if input data set is on29/124, it should be assigned in this way:
    • cray:
      • assign -a adpupa -fcos -cebcdic fort.xx
    • sgi:
      • assign -a adpupa -fcos fort.xx (note: -cebcdic is not possible on sgi, so call to w3nco routine "aea" takes care of the conversion as each on29 record is read in)
  • if input data set is bufr, it should be assigned in this way:
    • cray:
      • assign -a adpupa fort.xx
    • sgi:
      • assign -a adpupa -f cos fort.xx

For input on29/124 data sets, a contingency has been built into this subroutine to perform the conversion from ebcdic to ascii in the event the assign does not perform the conversion the return flags in ier (and function iw3unp29 itself) are:

  • 0 Observation read and unpacked into location 'obs'. see writeup of w3fi64 for contents. (all character words are left-justified.) Next call to iw3unp29 will return next observation in data set.
  • 1 A 40 byte header in the format described here (y2k compliant pseudo-office note 85) is returned in the first 10 words of 'obs' on a 4-byte machine (ibm) and in the first 5 words of 'obs' on an 8-byte machine (cray). Next call to iw3unp29 will return first obs. in this data set. (note: if input data set is a true on29/124 file with the y2k compliant pseudo-on85 header record, then the pseudo-on85 header record is actually read in and returned; if input data set is a true on29/124 file with a non-y2k compliant on85 header record, then a y2k compliant pseudo-on85 header record is constructed from it using the "windowing" technique to obtain a 4-digit year from a 2-digit year.) format for y2k compliant pseudo-on85 header record returned (40 bytes in character):
    • bytes 1- 8 – data set name (as defined in on85 except up to eight ascii char., left justified with blank fill)
    • bytes 9-10 – set type (as defined in on85)
    • bytes 11-20 – center (analysis) date for data set (ten ascii characters in form "yyyymmddhh")
    • bytes 21-24 – set initialize (dump) time, as dedined in on85)
    • bytes 25-34 – always "washington" (as in on85)
    • bytes 35-36 – source machine (as defined in on85)
    • bytes 37-40 – blank fill characters
  • 2 end-of-file (never an empty or null file):
    • input on29/124 data set: the "endof file" record is encountered - no useful information in 'obs' array. next call to iw3unp29 will return physical end of file for data set in 'nunit' (see ier=3 below).
    • input bufr data set: the physical end of file is encountered. -3 end-of-file: Physical end of file encountered on data set - this can only happen for an empty (null) data set or for a true on29/124 data set. There are no more reports (or never were any if null) associated with data set in this unit number - no useful information in 'obs' array. Either all done (if no more unit numbers are to be read in), or reset 'nunit' to point to a new data set (in which case next call to iw3unp29 should return with ier=1).
  • 4 only valid for input on29/124 data set - i/o error reading the next record of reports - no useful information in 'obs' array. Calling program can choose to stop or again call iw3unp29 which will attempt to unpack the first observation in the next record of reports.
  • 999 applies only to non-empty data sets:
    • input on29/124 data set: first choice y2k compliant pseudo-on85 file header label not encountered where expected, and second choice non-y2k compliant on85 file header label also not encountered.
    • input bufr data set either header label in format of pseudo-on85 could not be returned, or an abnormal error occurred in the attempt to decode an observation. For either input data set type, no useful information in 'obs' array. Calling program can choose to stop with non-zero condition code or reset 'nunit' to point to a new data set (in which case next call to iw3unp29 should return with ier=1).
    • input data set neither on29/124 nor bufr speaks for itself.
Author
Dennis Keyser
Date
2013-03-20

Definition at line 270 of file iw3unp29.f.

◆ l01o29()

logical function l01o29

Definition at line 2065 of file iw3unp29.f.

◆ r01o29()

function r01o29 ( character*(*)  subset,
  lunit,
dimension(*)  obs 
)

This function read subset and returns corresponding file data.

Parameters
SUBSETsubset
LUNITfull path of file
OBSdata output
Returns
file data
Author
Dennis Keyser
Date
2013-03-20

Definition at line 981 of file iw3unp29.f.

◆ r02o29()

function r02o29

Definition at line 1651 of file iw3unp29.f.

◆ r03o29()

function r03o29 (   lunit,
dimension(*)  obs 
)

Definition at line 2092 of file iw3unp29.f.

◆ r04o29()

function r04o29 (   lunit,
dimension(*)  obs 
)

Definition at line 2897 of file iw3unp29.f.

◆ r05o29()

function r05o29 (   lunit,
dimension(*)  obs 
)

Definition at line 3369 of file iw3unp29.f.

◆ r06o29()

function r06o29 (   lunit,
dimension(*)  obs 
)

Definition at line 3871 of file iw3unp29.f.

◆ r07o29()

function r07o29 (   lunit,
dimension(*)  obs 
)

Definition at line 4156 of file iw3unp29.f.

◆ s01o29()

subroutine s01o29 ( character*8  sid,
  xob,
  yob,
  rhr,
  rch,
character*(*)  rsv,
character*(*)  rsv2,
  elv,
  itp,
  rtp 
)

Definition at line 1008 of file iw3unp29.f.

◆ s02o29()

subroutine s02o29 (   icat,
  n 
)

Definition at line 1106 of file iw3unp29.f.

◆ s03o29()

subroutine s03o29 ( dimension(*)  unp,
character*8  subset 
)

Definition at line 1382 of file iw3unp29.f.

◆ s04o29()

subroutine s04o29

Definition at line 1455 of file iw3unp29.f.

◆ s05o29()

subroutine s05o29

Definition at line 1575 of file iw3unp29.f.

◆ s06o29()

subroutine s06o29 ( character*8  iden,
character*8  id 
)

This subrountine modifies amdar reports so that last character ends with 'Z'.

Parameters
[in]IDENAcft id
[out]IDModified aircraft id.
Author
RAY CRAYTON
Date
1992-02-16

Definition at line 4481 of file iw3unp29.f.