NCEPLIBS-bufr  12.1.0
misc.F90 File Reference

Miscellaneous subroutines and functions. More...

Go to the source code of this file.

Functions/Subroutines

subroutine bfrini
 Initialize numerous global variables and arrays within internal modules and COMMON blocks throughout the NCEPLIBS-bufr software. More...
 
subroutine bvers (cverstr)
 Get the version number of the NCEPLIBS-bufr software. More...
 
subroutine capit (str)
 Capitalize all of the alphabetic characters in a string. More...
 
recursive integer function igetsc (lunit)
 Check for an abnormal status code associated with the processing of a file. More...
 
integer function iokoper (nemo)
 Check whether a specified mnemonic is a Table C operator supported by the NCEPLIBS-bufr software. More...
 
integer function irev (n)
 Return a copy of an integer value with the bytes possibly reversed. More...
 
integer function isize (num)
 Compute the number of characters needed to encode an integer as a string. More...
 
subroutine jstnum (str, sign, iret)
 Left-justify a character string containing an encoded integer, by removing all leading blanks and any leading sign ('+' or '-') character. More...
 
subroutine mrginv
 Print a summary of merge activity. More...
 
recursive subroutine strnum (str, num, iret)
 Decode an integer from a character string. More...
 
subroutine strsuc (str1, str2, lens)
 Remove leading and trailing blanks from a character string. More...
 

Detailed Description

Miscellaneous subroutines and functions.

Author
J. Woollen
Date
1994-01-06

Definition in file misc.F90.

Function/Subroutine Documentation

◆ bfrini()

subroutine bfrini

Initialize numerous global variables and arrays within internal modules and COMMON blocks throughout the NCEPLIBS-bufr software.

This subroutine isn't normally called directly by any application program, because it's automatically called internally from within subroutine openbf() during the first time that subroutine is called by any application program.

Authors
J. Woollen J. Ator
Date
1994-01-06

Definition at line 15 of file misc.F90.

References moda_idrdm::idrdm, moda_stbfr::iolun, moda_stbfr::iomsg, ipkm(), moda_bufrsr::jsr, moda_bitbuf::maxbyt, moda_bufrmg::msglen, moda_msglim::msglim, mtinfo(), moda_dscach::ncnem, moda_tababd::ntba, moda_tababd::ntbb, moda_tababd::ntbd, and moda_usrint::nval.

Referenced by openbf().

◆ bvers()

subroutine bvers ( character*(*), intent(out)  cverstr)

Get the version number of the NCEPLIBS-bufr software.

Parameters
cverstr- Version string
Author
J. Ator
Date
2009-03-23

Definition at line 383 of file misc.F90.

References bort().

Referenced by bufr_c2f_interface::bvers_c().

◆ capit()

subroutine capit ( character*(*), intent(inout)  str)

Capitalize all of the alphabetic characters in a string.

The string is modified in place.

Parameters
str- String
Author
J. Woollen
Date
2002-05-14

Definition at line 354 of file misc.F90.

Referenced by cmpmsg(), codflg(), elemdx(), stbfdx(), stdmsg(), and strcpt().

◆ igetsc()

recursive integer function igetsc ( integer, intent(in)  lunit)

Check for an abnormal status code associated with the processing of a file.

Return a status code associated with any file that was previously opened via a call to subroutine openbf(), so that the application program can check whether the NCEPLIBS-bufr software encountered any specific problems while processing the file.

Parameters
lunit- Fortran logical unit number for BUFR file
Returns
- Return code:
  • 0 = no problems were encountered
  • 1 = replication factor overflow in subroutine usrtpl()
Remarks
  • Once subroutine openbf() has been called for lunit, this function can then be called any number of times and at any point throughout the remainder of the life of the application program.
Author
J. Ator
Date
2010-05-11

Definition at line 444 of file misc.F90.

References bort(), moda_stcode::iscodes, status(), and x84().

◆ iokoper()

integer function iokoper ( character*(*), intent(in)  nemo)

Check whether a specified mnemonic is a Table C operator supported by the NCEPLIBS-bufr software.

Parameters
nemo- Mnemonic
Returns
iokoper - Flag indicating whether nemo is a Table C operator supported by the NCEPLIBS-bufr software:
  • 0 = No
  • 1 = Yes
Author
J. Ator
Date
2015-03-06

Definition at line 483 of file misc.F90.

References imrkopr().

Referenced by istdesc().

◆ irev()

integer function irev ( integer, intent(in)  n)

Return a copy of an integer value with the bytes possibly reversed.

Although, by definition (within WMO Manual 306), a BUFR message is a stream of individual octets (i.e., bytes) that is independent of any particular machine representation, the NCEPLIBS-bufr software often needs to interpret all or parts of two or more adjacent bytes as an integer. By default, the software uses the "big-endian" (left to right) scheme for numbering bytes within a machine word. By reversing the bytes, this routine allows an integer word to be properly read or written (depending on whether input or output operations, respectively, are being performed) on "little-endian" machines.

If the local machine is "little-endian" (i.e., if it uses a right to left scheme for numbering the bytes within a machine word), then this routine returns a copy of the input integer value with the bytes reversed. Otherwise, if the local machine is already "big-endian", then this routine simply returns a copy of the same integer value that was input.

Parameters
n- Value with bytes ordered according to the "big-endian" numbering scheme
Returns
- Copy of n with bytes ordered according to the numbering scheme of the local machine
Author
Woollen
Date
1994-01-06

Definition at line 256 of file misc.F90.

Referenced by ipkm(), and iupm().

◆ isize()

integer function isize ( integer, intent(in)  num)

Compute the number of characters needed to encode an integer as a string.

This function does not actually encode the string but rather only figures out the required size. num must be an integer in the range of 0 to 99999.

Parameters
num- number
Returns
- Number of characters necessary to encode num as a string
Author
Ator
Date
2009-03-23

Definition at line 407 of file misc.F90.

References bort().

Referenced by ufbdmp(), and ufdump().

◆ jstnum()

subroutine jstnum ( character*(*), intent(inout)  str,
character, intent(out)  sign,
integer, intent(out)  iret 
)

Left-justify a character string containing an encoded integer, by removing all leading blanks and any leading sign ('+' or '-') character.

The input string is modified in place, and the sign is returned as a separate parameter. If the input string contains only blank characters, then a call is made to subroutine bort().

Parameters
str- String
sign- Sign of encoded integer value:
  • '+' = positive value
  • '-' = negative value
iret- Return code:
  • 0 = normal return
  • -1 = input string contained non-blank characters which were also non-numeric
Author
J. Woollen
Date
1994-01-06

Definition at line 302 of file misc.F90.

References bort(), errwrt(), and strnum().

Referenced by elemdx().

◆ mrginv()

subroutine mrginv

Print a summary of merge activity.

Author
J. Woollen
Date
1996-10-09

Definition at line 513 of file misc.F90.

References errwrt().

◆ strnum()

recursive subroutine strnum ( character*(*), intent(in)  str,
integer, intent(out)  num,
integer, intent(out)  iret 
)

Decode an integer from a character string.

The string may contain leading or trailing blanks, but otherwise should contain only digits and an (optional) leading sign ('+' or '-') character. If the string is empty or contains all blank characters, then num is returned with a value of 0.

Parameters
str- String
num- Value decoded from str
iret- Return code: 0 = success -1 = string contained one or more illegal characters
Author
J. Woollen
Date
1994-01-06

Definition at line 176 of file misc.F90.

References strsuc(), and x48().

Referenced by fdebufr_c(), gettbh(), jstnum(), nemtbb(), parutg(), seqsdx(), sntbfe(), bufr_c2f_interface::strnum_c(), and upftbv().

◆ strsuc()

subroutine strsuc ( character*(*), intent(in)  str1,
character*(*), intent(out)  str2,
integer, intent(out)  lens 
)

Remove leading and trailing blanks from a character string.

The string may not contain any embedded blanks.

Parameters
str1- String
str2- Copy of str1 with leading and trailing blanks removed
lens- Length of str2
Author
J. Woollen
Date
1994-01-06

Definition at line 219 of file misc.F90.

Referenced by dxdump(), fdebufr_c(), gettagre(), hold4wlc(), mtfnam(), mtinfo(), nemspecs(), strnum(), and ufdump().