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

BUFR Message decoder. More...

Go to the source code of this file.

Functions/Subroutines

subroutine fi7801 (iptr, ident, msga, istack, iwork, aname, kdata, ivals, mstack, aunits, kdesc, mwidth, mref, mscale, knr, index, maxr, maxd, iunitb, iunitd)
 Data extraction.
 
subroutine fi7802 (iptr, ident, msga, kdata, kdesc, ll, mstack, aunits, mwidth, mref, mscale, jdesc, ivals, j, maxr, maxd)
 Process standard descriptor.
 
subroutine fi7803 (iptr, ident, msga, kdata, ivals, mstack, mwidth, mref, mscale, j, jdesc, maxr, maxd)
 Process compressed data.
 
subroutine fi7804 (iptr, msga, kdata, ivals, mstack, mwidth, mref, mscale, j, ll, jdesc, maxr, maxd)
 Process serial data.
 
subroutine fi7805 (iptr, ident, msga, iwork, lx, ly, kdata, ll, knr, mstack, maxr, maxd)
 Process a replication descriptor.
 
subroutine fi7806 (iptr, lx, ly, ident, msga, kdata, ivals, mstack, mwidth, mref, mscale, j, ll, kdesc, iwork, jdesc, maxr, maxd)
 Process operator descriptors.
 
subroutine fi7807 (iptr, iwork, itbld, jdesc, maxd)
 Process queue descriptor.
 
subroutine fi7808 (iptr, iwork, lf, lx, ly, jdesc, maxd)
 Program history log:
 
subroutine fi7809 (ident, mstack, kdata, iptr, maxr, maxd)
 Reformat profiler w hgt increments.
 
subroutine fi7810 (ident, mstack, kdata, iptr, maxr, maxd)
 Reformat profiler edition 2 data.
 
subroutine w3fi78 (iptr, ident, msga, istack, mstack, kdata, knr, index, maxr, maxd, iunitb, iunitd)
 This set of routines will decode a BUFR message and place information extracted from the BUFR message into selected arrays for the user.The array kdata can now be sized by the user by indicating the maximum number of substes and the maximum number of descriptors that are expected in the course of decoding selected input data.
 

Detailed Description

BUFR Message decoder.

Author
Bill Cavanaugh
Date
1988-08-31

Definition in file w3fi78.f.

Function/Subroutine Documentation

◆ fi7801()

subroutine fi7801 ( integer, dimension(*)  iptr,
integer, dimension(*)  ident,
integer, dimension(*)  msga,
integer, dimension(*)  istack,
integer, dimension(*)  iwork,
character*40, dimension(*)  aname,
integer, dimension(maxr,maxd)  kdata,
integer, dimension(*)  ivals,
integer, dimension(2,maxd)  mstack,
character*24, dimension(*)  aunits,
integer, dimension(*)  kdesc,
integer, dimension(*)  mwidth,
integer, dimension(700,3)  mref,
integer, dimension(*)  mscale,
integer, dimension(maxr)  knr,
integer  index,
  maxr,
  maxd,
  iunitb,
  iunitd 
)

Data extraction.

Author
Bill Cavanaugh
Date
1988-09-01 Control the extraction of data from section 4 based on data descriptors.

Program history log:

  • Bill Cavanaugh 1988-09-01
  • Bill Cavanaugh 1991-01-18 Corrections to properly handle non-compressed data.
  • Bill Cavanaugh 1991-09-23 Coding added to handle single subsets with delayed replication.
  • Bill Cavanaugh 1992-01-24 Modified to echo descriptors to mstack(1,n)
Parameters
[in]IPTRSee w3fi78() routine docblock
[in]IDENTSee w3fi78() routine docblock
[in]MSGAArray containing bufr message
[in,out]ISTACKOriginal array of descriptors extracted from source bufr message.
[in]MSTACKWorking array of descriptors (expanded)and scaling factor
[in,out]KDESCImage of current descriptor
[in]INDEX
[in]MAXRmaximum number of reports/subsets that may be contained in a bufr message
[in]MAXDMaximum number of descriptor combinations that may be processed; upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice
[in]IUNITBUnit number of data set holding table b
[in]IUNITDUnit number of data set holding table d
[out]IWORKWorking descriptor list
[out]KDATAArray containing decoded reports from bufr message. KDATA(Report number,parameter number) (report number limited to value of input argument maxr and parameter number limited to value of input argument maxd) arrays containing data from table b
[out]ANAMEDescriptor name
[out]AUNITSUnits for descriptor
[out]MSCALEScale for value of descriptor
[out]MREFReference value for descriptor
[out]MWIDTHBit width for value of descriptor
IVALS
KNR

Error return: IPTR(1)

  • = 8 Error reading table b
  • = 9 Error reading table d
  • = 11 Error opening table b
Author
Bill Cavanaugh
Date
1988-09-01

Definition at line 675 of file w3fi78.f.

◆ fi7802()

subroutine fi7802 ( integer, dimension(*)  iptr,
integer, dimension(*)  ident,
integer, dimension(*)  msga,
integer, dimension(maxr,maxd)  kdata,
integer, dimension(*)  kdesc,
  ll,
integer, dimension(2,maxd)  mstack,
character*24, dimension(*)  aunits,
integer, dimension(*)  mwidth,
integer, dimension(700,3)  mref,
integer, dimension(*)  mscale,
integer  jdesc,
integer, dimension(*)  ivals,
integer  j,
  maxr,
  maxd 
)

Process standard descriptor.

Author
Bill Cavanaugh
Date
1988-09-01 Process a standard descriptor (f = 0) and store data in output array.

Program history log:

  • Bill Cavanaugh 1988-09-01
  • Bill Cavanaugh 1991-04-04 Changed to pass width of text fields in bytes
Parameters
[in]IPTRSee w3fi78 routine docblock
[in]IDENTSee w3fi78 routine docblock
[in]MSGAArray containing bufr message
[in,out]KDATAArray containing decoded reports from bufr message. KDATA(Report number,parameter number) (report number limited to value of input argument maxr and parameter number limited to value of input argument maxd)
[in,out]KDESCImage of current descriptor
[in]MSTACK
[in]MAXRmaximum number of reports/subsets that may be contained in a bufr message
[in]MAXDMaximum number of descriptor combinations that may be processed; upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice Arrays containing data from table B
[out]AUNITSUnits for descriptor
[out]MSCALEScale for value of descriptor
[out]MREFReference value for descriptor
[out]MWIDTHBit width for value of descriptor
LL
JDESC
IVALS
J

Error return: IPTR(1) = 3 - Message contains a descriptor with f=0 that does not exist in table b.

Author
Bill Cavanaugh
Date
1988-09-01

Definition at line 993 of file w3fi78.f.

◆ fi7803()

subroutine fi7803 ( integer, dimension(*)  iptr,
integer, dimension(*)  ident,
integer, dimension(*)  msga,
integer, dimension(maxr,maxd)  kdata,
integer, dimension(*)  ivals,
integer, dimension(2,maxd)  mstack,
integer, dimension(*)  mwidth,
integer, dimension(700,3)  mref,
integer, dimension(*)  mscale,
integer  j,
integer  jdesc,
  maxr,
  maxd 
)

Process compressed data.

Author
Bill Cavanaugh
Date
1988-09-01 Process compressed data and place individual elements into output array.

PROGRAM HISTORY LOG:

  • Bill Cavanaugh 1988-09-01
  • Bill Cavanaugh 1991-04-04 Text handling portion of this routine modified to hanle width of fields in bytes.
  • Bill Cavanaugh 1991-04-17 Tests showed that the same data in compressed and uncompressed form gave different results. This has been corrected.
  • Bill Cavanaugh 1991-06-21 Processing of text data has been changed to provide exact reproduction of all characters.
Parameters
[in]IPTRSee w3fi78() routine docblock
[in]IDENTSee w3fi78() routine docblock
[in]MSGAArray containing bufr message,mstack,
[in]IVALSArray of single parameter values
[in,out]J
[in]MAXRMaximum number of reports/subsets that may be contained in a bufr message.
[in]MAXDMaximum number of descriptor combinations that may be processed; Upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice.
[out]KDATAArray containing decoded reports from bufr message. KDATA(Report number,parameter number) (report number limited to value of input argument maxr and parameter number limited to value of input argument maxd) Arrays containing data from table B.
[out]MSCALEScale for value of descriptor
[out]MREFReference value for descriptor
[out]MWIDTHBit width for value of descriptor
MSTACK
JDESC
Author
Bill Cavanaugh
Date
1988-09-01

Definition at line 1149 of file w3fi78.f.

◆ fi7804()

subroutine fi7804 ( integer, dimension(*)  iptr,
integer, dimension(*)  msga,
integer, dimension(maxr,maxd)  kdata,
integer, dimension(*)  ivals,
integer, dimension(2,maxd)  mstack,
integer, dimension(*)  mwidth,
integer, dimension(700,3)  mref,
integer, dimension(*)  mscale,
integer  j,
integer  ll,
integer  jdesc,
  maxr,
  maxd 
)

Process serial data.

Author
Bill Cavanaugh
Date
1988-09-01 Process data that is not compressed.

Program history log:

  • Bill Cavanaugh 1988-09-01
  • Bill Cavanaugh 1991-01-18 Modified to properly handle non-compressed data.
  • Bill Cavanaugh 1991-04-04 Text handling portion of this routine modified to handle field width in bytes.
  • Bill Cavanaugh 1991-04-17 Tests showed that the same data in compressed and uncompressed form gave different results. this has been corrected.
Parameters
[in]IPTRSee w3fi78 routine docblock
[in]MSGAArray containing bufr message
[in,out]IVALSArray of single parameter values
[in,out]J
[in]MAXRMaximum number of reports/subsets that may be contained in a bufr message
[in]MAXDMaximum number of descriptor combinations that may be processed; upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice
[out]KDATAArray containing decoded reports from bufr message. KDATA(report number,parameter number) (report number limited to value of input argument maxr and parameter number limited to value of input argument maxd) arrays containing data from table B
[out]MSCALEScale for value of descriptor
[out]MREFReference value for descriptor
[out]MWIDTHBit width for value of descriptor
MSTACK
LL
JDESC

Error return: IPTR(1) = 13 - Bit width on ascii chars not a multiple of 8

Author
Bill Cavanaugh
Date
1988-09-01

Definition at line 1418 of file w3fi78.f.

◆ fi7805()

subroutine fi7805 ( integer, dimension(*)  iptr,
integer, dimension(*)  ident,
integer, dimension(*)  msga,
integer, dimension(maxd)  iwork,
integer  lx,
integer  ly,
integer, dimension(maxr,maxd)  kdata,
integer  ll,
integer, dimension(maxr)  knr,
integer, dimension(2,maxd)  mstack,
  maxr,
  maxd 
)

Process a replication descriptor.

Author
Bill Cavanaugh
Date
1988-09-01 Process a replication descriptor, must extract number of replications of n descriptors from the data stream.

Program history log:

  • Bill Cavanaugh 1988-09-01
Parameters
[in]IWORKWorking descriptor list
[in]IPTRSee w3fi78 routine docblock
[in]IDENTSee w3fi78 routine docblock
[in,out]LXX portion of current descriptor
[in,out]LYY portion of current descriptor
[in]MAXRMaximum number of reports/subsets that may be contained in a bufr message.
[in]MAXDMaximum number of descriptor combinations that may be processed; upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice
[out]KDATAArray containing decoded reports from bufr message. KDATA(report number,parameter number) (report number limited to value of input argument maxr and parameter number limited to value of input argument maxd)
MSGA
LL
KNR
MSTACK

Error return: IPTR(1):

  • = 12 Data descriptor qualifier does not follow delayed replication descriptor
  • = 20 Exceeded count for delayed replication pass
Author
Bill Cavanaugh
Date
1988-09-01

Definition at line 1587 of file w3fi78.f.

◆ fi7806()

subroutine fi7806 ( integer, dimension(*)  iptr,
integer  lx,
integer  ly,
integer, dimension(*)  ident,
integer, dimension(*)  msga,
integer, dimension(maxr,maxd)  kdata,
integer, dimension(*)  ivals,
integer, dimension(2,maxd)  mstack,
integer, dimension(*)  mwidth,
integer, dimension(700,3)  mref,
integer, dimension(*)  mscale,
integer  j,
integer  ll,
integer, dimension(*)  kdesc,
integer, dimension(*)  iwork,
integer  jdesc,
  maxr,
  maxd 
)

Process operator descriptors.

Author
Bill Cavanaugh
Date
1988-09-01 Extract and save indicated change values for use until changes are rescinded, or extract text strings indicated through 2 05 yyy.

Program history log:

  • Bill Cavanaugh 1988-09-01
  • Bill Cavanaugh 1991-04-04 Modified to handle descriptor 2 05 yyy
  • Bill Cavanaugh 1991-05-10 Coding has been added to process proposed table c descriptor 2 06 yyy.
  • Bill Cavanaugh 1991-11-21 Coding has been added to properly process table c descriptor 2 03 yyy, the change to new reference value for selected descriptors.
Parameters
[in]IPTRSee w3fi78 routine docblock
[in]LXX portion of current descriptor
[in]LYY portion of current descriptor
[in]MAXRMaximum number of reports/subsets that may be contained in a bufr message
[in]MAXDMaximum number of descriptor combinations that may be processed; upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice
[out]KDATAArray containing decoded reports from bufr message. KDATA(Report number,parameter number) (report number limited to value of input argument maxr and parameter number limited to value of input argument maxd) Arrays containing data from table b
[out]MSCALEScale for value of descriptor
[out]MREFReference value for descriptor
[out]MWIDTHBit width for value of descriptor
IDENT
MSGA
IVALS
MSTACK
J
LL
KDESC
JDESC
IWORK

Error return: IPTR(1) = 5 - Erroneous X value in data descriptor operator

Author
Bill Cavanaugh
Date
1988-09-01

Definition at line 1760 of file w3fi78.f.

◆ fi7807()

subroutine fi7807 ( integer, dimension(*)  iptr,
integer, dimension(*)  iwork,
integer, dimension(500,11)  itbld,
integer  jdesc,
  maxd 
)

Process queue descriptor.

Author
Bill Cavanaugh
Date
1988-09-01 Substitute descriptor queue for queue descriptor.

Program history log:

  • Bill Cavanaugh 1988-09-01
  • Bill Cavanaugh 1991-04-17 Improved handling of nested queue descriptors.
  • Bill Cavanaugh 1991-05-28 Improved handling of nested queue descriptors. based on tests with live data.
Parameters
[in]IWORKWorking descriptor list
[in]IPTRSee w3fi78 routine docblock
MAXD
[in]ITBLDArray containing descriptor queues
[in]JDESCQueue descriptor to be expanded

Definition at line 1902 of file w3fi78.f.

◆ fi7808()

subroutine fi7808 ( integer, dimension(*)  iptr,
integer, dimension(*)  iwork,
integer  lf,
integer  lx,
integer  ly,
integer  jdesc,
  maxd 
)

Program history log:

Author
Bill Cavanaugh
Date
1988-09-01 - Bill Cavanaugh 1988-09-01
Parameters
[in,out]IPTRSee w3fi78() routine docblock
[in]IWORKWorking descriptor list
LF
LX
LY
JDESC
MAXD
Author
Bill Cavanaugh
Date
1988-09-01

Definition at line 2008 of file w3fi78.f.

◆ fi7809()

subroutine fi7809 ( integer, dimension(*)  ident,
integer, dimension(2,maxd)  mstack,
integer, dimension(maxr,maxd)  kdata,
integer, dimension(*)  iptr,
  maxr,
  maxd 
)

Reformat profiler w hgt increments.

Author
Bill Cavanaugh
Date
1990-02-14 Reformat decoded profiler data to show heights instead of height increments.

Program history log:

  • Bill Cavanaugh 1990-02-14
Parameters
[in]IDENTArray contains message information extracted from BUFR message:
  • IDENT(1)- Edition number (byte 4, section 1)
  • IDENT(2)- Originating center (bytes 5-6, section 1)
  • IDENT(3)- Update sequence (byte 7, section 1)
  • IDENT(4)- (byte 8, section 1)
  • IDENT(5)- Bufr message type (byte 9, section 1)
  • IDENT(6)- Bufr msg sub-type (byte 10, section 1)
  • IDENT(7)- (bytes 11-12, section 1)
  • IDENT(8)- Year of century (byte 13, section 1)
  • IDENT(9)- Month of year (byte 14, section 1)
  • IDENT(10)- Day of month (byte 15, section 1)
  • IDENT(11)- Hour of day (byte 16, section 1)
  • IDENT(12)- Minute of hour (byte 17, section 1)
  • IDENT(13)- Rsvd by adp centers(byte 18, section 1)
  • IDENT(14)- Nr of data subsets (byte 5-6, section 3)
  • IDENT(15)- Observed flag (byte 7, bit 1, section 3)
  • IDENT(16)- Compression flag (byte 7, bit 2, section 3)
[in]MSTACKWorking descriptor list and scaling factor
[in]KDATAArray containing decoded reports from bufr message. KDATA(Report number,parameter number) (report number limited to value of input argument maxr and parameter number limited to value of input argument maxd)
[in]IPTRSee w3fi78
[in]MAXRMaximum number of reports/subsets that may be contained in a bufr message
[in]MAXDMaximum number of descriptor combinations that may be processed; upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice.
Author
Bill Cavanaugh
Date
1990-02-14

Definition at line 2066 of file w3fi78.f.

◆ fi7810()

subroutine fi7810 ( integer, dimension(*)  ident,
integer, dimension(2,maxd)  mstack,
integer, dimension(maxr,maxd)  kdata,
integer, dimension(*)  iptr,
  maxr,
  maxd 
)

Reformat profiler edition 2 data.

Author
Bill Cavanaugh
Date
1993-01-21 Reformat profiler data in edition 2.

Program history log:

  • Bill Cavanaugh 1993-01-27
Parameters
[in]IDENTArray contains message information extracted from bufr message:
  • IDENT(1) - Edition number (byte 4, section 1)
  • IDENT(2) - Originating center (bytes 5-6, section 1)
  • IDENT(3) - Update sequence (byte 7, section 1)
  • IDENT(4) - (byte 8, section 1)
  • IDENT(5) - Bufr message type (byte 9, section 1)
  • IDENT(6) - Bufr msg sub-type (byte 10, section 1)
  • IDENT(7) - (bytes 11-12, section 1)
  • IDENT(8) - Year of century (byte 13, section 1)
  • IDENT(9) - Month of year (byte 14, section 1)
  • IDENT(10) - Day of month (byte 15, section 1)
  • IDENT(11) - Hour of day (byte 16, section 1)
  • IDENT(12) - Minute of hour (byte 17, section 1)
  • IDENT(13) - Rsvd by adp centers (byte 18, section 1)
  • IDENT(14) - Nr of data subsets (byte 5-6, section 3)
  • IDENT(15) - Observed flag (byte 7, bit 1, section 3)
  • IDENT(16) - Compression flag (byte 7, bit 2, section 3)
[in]MSTACKWorking descriptor list and scaling factor
[in]KDATAArray containing decoded reports from bufr message. kdata(report number,parameter number) (report number limited to value of input argument maxr and parameter number limited to value of input argument maxd)
[in]IPTRSee w3fi78
[in]MAXRMaximum number of reports/subsets that may be contained in a bufr message
[in]MAXDMaximum number of descriptor combinations that may be processed; upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice
Author
Bill Cavanaugh
Date
1993-01-21

Definition at line 2459 of file w3fi78.f.

◆ w3fi78()

subroutine w3fi78 ( integer, dimension(*)  iptr,
integer, dimension(*)  ident,
integer, dimension(*)  msga,
integer, dimension(*)  istack,
integer, dimension(2,maxd)  mstack,
integer, dimension(maxr,maxd)  kdata,
integer, dimension(maxr)  knr,
integer  index,
  maxr,
  maxd,
  iunitb,
  iunitd 
)

This set of routines will decode a BUFR message and place information extracted from the BUFR message into selected arrays for the user.The array kdata can now be sized by the user by indicating the maximum number of substes and the maximum number of descriptors that are expected in the course of decoding selected input data.

This allows for realistic sizing of kdata and the mstack arrays. This version also allows for the inclusion of the unit numbers for tables b and d into the argument list. This routine does not include ifod processing.

Program history log:

  • Bill Cavanaugh 88-08-31
  • Bill Cavanaugh 90-12-07 Now utilizing gbyte routines to gather and separate bit fields. This should improve (decrease) the time it takes to decode any BUFR message. Have entered coding that will permit processing BUFR editions 1 and 2. improved and corrected the conversion into ifod format of decoded BUFR messages.
  • Bill Cavanaugh 91-01-18 Program/routines modified to properly handle serial profiler data.
  • Bill Cavanaugh 91-04-04 Modified to handle text supplied thru descriptor 2 05 yyy.
  • Bill Cavanaugh 91-04-17 Errors in extracting and scaling data corrected. Improved handling of nested queue descriptors is added.
  • Bill Cavanaugh 91-05-10 Array 'data' has been enlarged to real*8 to better contain very large numbers more accurately. the preious size real*4 could not contain sufficient significant digits. Coding has been introduced to process new table c descriptor 2 06 yyy which permits in line processing of a local descriptor even if the descriptor is not contained in the users table b. A second routine to process ifod messages (ifod0) has been removed in favor of the improved processing of the one remaining (ifod1). New coding has been introduced to permit processing of BUFR messages based on BUFR edition up to and including edition 2. Please note increased size requirements for arrays ident(20) and iptr(40).
  • Bill Cavanaugh 91-07-26 Add array mtime to calling sequence to permit inclusion of receipt/transfer times to ifod messages.
  • Bill Cavanaugh 91-09-25 All processing of decoded BUFR data into ifod (a local use reformat of BUFR data) has been isolated from this set of routines. For those interested in the ifod form, see w3fl05() in the w3lib routines. Processing of BUFR messages containing delayed replication has been altered so that single subsets (reports) and and a matching descriptor list for that particular subset will be passed to the user will be passed to the user one at a time to assure that each subset can be fully defined with a minimum of reprocessing. Processing of associated fields has been tested with messages containing non-compressed data. In order to facilitate user processing a matching list of scale factors are included with the expanded descriptor list (mstack).
  • Bill Cavanaugh 91-11-21 Processing of descriptor 2 03 yyy has corrected to agree with fm94 standards.
  • Bill Cavanaugh 91-12-19 Calls to fi7803() and fi7804() have been corrected to agree called program argument list. Some additional entries have been included for communicating with data access routines. Additional error exit provided for the case where table b is damaged.
  • Bill Cavanaugh 92-01-24 Routines fi7801(), fi7803() and fi7804() have been modified to handle associated fields all descriptors are set to echo to mstack(1,n)
  • Bill Cavanaugh 92-05-21 Further expansion of information collected from within upper air soundings has produced the necessity to expand some of the processing and output arrays. (see remarks below)
  • Bill Cavanaugh 92-06-29 Corrected descriptor denoting height of each wind level for profiler conversions.
  • Bill Cavanaugh 92-07-23 Expansion of table b requires adjustment of arrays to contain table b values needed to assist in the decoding process. ARRAYS CONTAINING DATA FROM TABLE B
  • KDESC Descriptor
  • ANAME Descriptor name
  • AUNITS Units for descriptor
  • MSCALE Scale for value of descriptor
  • MREF Reference value for descriptor
  • MWIDTH Bit width for value of descriptor
  • Bill Cavanaugh 92-09-09 First encounter with operator descriptor 2 05 yyy showed error in decoding. That error is corrected with this implementation. Further testing of upper air data has encountered the condition of large (many level) soundings arrays in the decoder have been expanded (again) to allow for this condition.
  • Bill Cavanaugh 92-10-02 Modified routine to reformat profiler data (fi7809) to show descriptors, scale value and data in proper order. Corrected an error that prevented user from assigning the second dimension of kdata(500,*).
  • Bill Cavanaugh 92-10-20 Removed error that prevented full implementation of previous corrections and made corrections to table b to bring it up to date. changes include proper reformat of profiler data and user capability for assigning second dimension of kdata array.
  • Bill Cavanaugh 92-12-09 Thanks to dennis keyser for the suggestions and coding, this implementation will allow the inclusion of unit numbers for tables b & d, and in addition allows for realistic sizing of kdata and mstack arrays by the user. As of this implementation, the upper size limit for a BUFR message allows for a message size greater than 10000 bytes.
  • Bill Cavanaugh 93-01-26 Subroutine fi7810() has been added to permit reformatting of profiler data in edition 2.
Parameters
[in]MSGAArray containing supposed BUFR message size is determined by user, can be greater than 10000 bytes.
[in]MAXRMaximum number of reports/subsets that may be contained in a BUFR message.
[in]MAXDMaximum number of descriptor combinations that may be processed; Upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice.
[in]IUNITBUnit number of data set holding table b
[in]IUNITDUnit number of data set holding table d
KNR
[out]ISTACKOriginal array of descriptors extracted from source BUFR message.
[out]MSTACK(A,B)
  • Level b - descriptor number (limited to value of input argument maxd)
  • level a = 1 descriptor = 2 10**N Scaling to return to original value
[out]IPTRUtility array
  • IPTR( 1)- Error return.
  • IPTR( 2)- Byte count section 1.
  • IPTR( 3)- Pointer to start of section 1.
  • IPTR( 4)- Byte count section 2.
  • IPTR( 5)- Pointer to start of section 2.
  • IPTR( 6)- Byte count section 3.
  • IPTR( 7)- Pointer to start of section 3.
  • IPTR( 8)- Byte count section 4.
  • IPTR( 9)- Pointer to start of section 4.
  • IPTR(10)- Start of requested subset, reserved for dar.
  • IPTR(11)- Current descriptor ptr in iwork.
  • IPTR(12)- Last descriptor pos in iwork.
  • IPTR(13)- Last descriptor pos in istack.
  • IPTR(14)- Number of table b entries.
  • IPTR(15)- Requested subset pointer, reserved for dar.
  • IPTR(16)- Indicator for existance of section 2.
  • IPTR(17)- Number of reports processed.
  • IPTR(18)- Ascii/text event.
  • IPTR(19)- Pointer to start of BUFR message.
  • IPTR(20)- Number of lines from table d.
  • IPTR(21)- Table b switch.
  • IPTR(22)- Table d switch.
  • IPTR(23)- Code/flag table switch.
  • IPTR(24)- Aditional words added by text info.
  • IPTR(25)- Current bit number.
  • IPTR(26)- Data width change.
  • IPTR(27)- Data scale change.
  • IPTR(28)- Data reference value change.
  • IPTR(29)- Add data associated field.
  • IPTR(30)- Signify characters.
  • IPTR(31)- Number of expanded descriptors in mstack.
  • IPTR(32)- Current descriptor segment f.
  • IPTR(33)- Current descriptor segment x.
  • IPTR(34)- Current descriptor segment y.
  • IPTR(35)- Unused.
  • IPTR(36)- Next descriptor may be undecipherable.
  • IPTR(37)- Unused.
  • IPTR(38)- Unused.
  • IPTR(39)- Delayed replication flag.
    • 0 No delayed replication.
    • 1 Message contains delayed replication.
  • IPTR(40)- Number of characters in text for curr descriptor.
[out]IDENTArray contains message information extracted from BUFR Message.
  • IDENT(1) Edition number (byte 4, section 1)
  • IDENT(2) Originating center (bytes 5-6, section 1)
  • IDENT(3) Update sequence (byte 7, section 1)
  • IDENT(4) Optional section (byte 8, section 1)
  • IDENT(5) BUFR message type (byte 9, section 1)
    • 0 = Surface (land).
    • 1 = Surface (ship).
    • 2 = Vertical soundings other than satellite.
    • 3 = Vertical soundings (satellite).
    • 4 = Sngl lvl upper-air other than satellite.
    • 5 = Sngl lvl upper-air (satellite).
    • 6 = Radar.
  • IDENT(6) BUFR msg sub-type (byte 10, section 1).
    TYPE SBTYP
    2 7 = PROFILER
  • IDENT(7) (bytes 11-12, section 1).
  • IDENT(8) Year of century (byte 13, section 1).
  • IDENT(9) Month of year (byte 14, section 1).
  • IDENT(10) Day of month (byte 15, section 1).
  • IDENT(11) Hour of day (byte 16, section 1).
  • IDENT(12) Minute of hour (byte 17, section 1).
  • IDENT(13) Rsvd by adp centers (byte 18, section 1).
  • IDENT(14) Nr of data subsets (byte 5-6, section 3).
  • IDENT(15) Observed flag (byte 7, bit 1, section 3).
  • IDENT(16) Compression flag (byte 7, bit 2, section 3).
  • IDENT(17) Master table number(byte 4, section 1, ed 2 or gtr).
[out]KDATAArray containing decoded reports from BUFR message. KDATA(report number,parameter number) (Report number limited to value of input argument maxr and parameter number limited to value of input argument maxd) Arrays containing data from table b:
  • ANAME Descriptor name
  • AUNITS Units for descriptor
  • MSCALE Scale for value of descriptor
  • MREF Reference value for descriptor
  • MWIDTH Bit width for value of descriptor
[out]INDEXPointer to available subset

Error returns: IPTR(1):

  • 1 'BUFR' Not found in first 125 characters
  • 2 '7777' Not found in location determined by by using counts found in each section. one or more sections have an erroneous byte count or characters '7777' are not in test message.
  • 3 Message contains a descriptor with f=0 that does not exist in table b.
  • 4 Message contains a descriptor with f=3 that does not exist in table d.
  • 5 Message contains a descriptor with f=2 with the value of x outside the range 1-5.
  • 6 Descriptor element indicated to have a flag value does not have an entry in the flag table. (to be activated)
  • 7 Descriptor indicated to have a code value does not have an entry in the code table. (to be activated)
  • 8 Error reading table d
  • 9 Error reading table b
  • 10 Error reading code/flag table
  • 11 Descriptor 2 04 004 not followed by 0 31 021
  • 12 Data descriptor operator qualifier does not follow delayed replication descriptor.
  • 13 Bit width on ascii characters not a multiple of 8
  • 14 Subsets = 0, no content bulletin
  • 20 Exceeded count for delayed replication pass
  • 21 Exceeded count for non-delayed replication pass
  • 27 Non zero lowest on text data
  • 28 Nbinc not nr of characters
  • 29 Table b appears to be damaged
  • 99 No more subsets (reports) available in current BUFR mesage
  • 400 Number of subsets exceeds the value of input argument maxr; must increase maxr to value of ident(14) in calling program
  • 401 Number of parameters (and associated fields) exceeds limits of this program.
  • 500 Value for nbinc has been found that exceeds standard width plus any bit width change. check all bit widths up to point of error.
  • 501 Corrected width for descriptor is 0 or less

On the initial call to w3fi78() with a BUFR message the argument index must be set to zero (index = 0). On the return from w3fi78() 'index' will be set to the next available subset/report. When there are no more subsets available a 99 err return will occur.

If the original BUFR message does not contain delayed replication the BUFR message will be completely decoded and 'index' will point to the first decoded subset. The users will then have the option of indexing through the subsets on their own or by recalling this routine (without resetting 'index') to have the routine do the indexing.

If the original BUFR message does contain delayed replication one subset/report will be decoded at a time and passed back to the user. This is not an option.


TO USE THIS ROUTINE

  • 1. Read in BUFR message
  • 2. Set index = 0
  • 3. CALL W3FI78()
  • 4.
    IF (iptr(1).EQ.99) THEN
    no more subsets
    either GO TO 1
    or terminate in no more bufr messages
    END IF
  • 5.
    IF (iptr(1).NE.0) THEN
    error condition
    either GO TO 1
    or terminate in no more bufr messages
    END IF
  • 6. The value of index indicates the active subset so
    IF interested in generating an ifod message
    w3fl05( )
    ELSE
    process decoded information as required
    END IF
  • 7. GO TO 3

The arrays to contain the output information are defined as follows:

  • KDATA(A,B) Is the a data entry (integer value) where a is the maximum number of reports/subsets that may be contained in the bufr message (this is now set to "maxr" which is passed as an input argument to w3fi78()), and where b is the maximum number of descriptor combinations that may be processed (this is now set to "maxd" which is also passed as an input argument to w3fi78(); Upper air data and some satellite data require a value for maxd of 1600, but for most other data a value for maxd of 500 will suffice).
  • MSTACK(1,B) Contains the descriptor that matches the data entry (max. value for b is now "maxd" which is passed as an input argument to w3fi78())
  • MSTACK(2,B) Is the scale (power of 10) to be applied to the data (max. value for b is now "maxd" which is passed as an input argument to w3fi78())
Author
Bill Cavanaugh
Date
1988-08-31

Definition at line 307 of file w3fi78.f.