NCEPLIBS-bufr
12.1.0
|
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... | |
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.
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().
subroutine bvers | ( | character*(*), intent(out) | cverstr | ) |
Get the version number of the NCEPLIBS-bufr software.
cverstr | - Version string |
Definition at line 383 of file misc.F90.
References bort().
Referenced by bufr_c2f_interface::bvers_c().
subroutine capit | ( | character*(*), intent(inout) | str | ) |
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.
lunit | - Fortran logical unit number for BUFR file |
Definition at line 444 of file misc.F90.
References bort(), moda_stcode::iscodes, status(), and x84().
integer function iokoper | ( | character*(*), intent(in) | nemo | ) |
Check whether a specified mnemonic is a Table C operator supported by the NCEPLIBS-bufr software.
nemo | - Mnemonic |
Definition at line 483 of file misc.F90.
References imrkopr().
Referenced by istdesc().
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.
n | - Value with bytes ordered according to the "big-endian" numbering scheme |
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.
num | - number |
Definition at line 407 of file misc.F90.
References bort().
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().
str | - String |
sign | - Sign of encoded integer value:
|
iret | - Return code:
|
Definition at line 302 of file misc.F90.
References bort(), errwrt(), and strnum().
Referenced by elemdx().
subroutine mrginv |
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.
str | - String |
num | - Value decoded from str |
iret | - Return code: 0 = success -1 = string contained one or more illegal characters |
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().
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.
str1 | - String |
str2 | - Copy of str1 with leading and trailing blanks removed |
lens | - Length of str2 |
Definition at line 219 of file misc.F90.
Referenced by dxdump(), fdebufr_c(), gettagre(), hold4wlc(), mtfnam(), mtinfo(), nemspecs(), strnum(), and ufdump().