NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
bufrlib.h
Go to the documentation of this file.
1 
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <string.h>
19 #include <ctype.h>
20 
21 #ifdef DYNAMIC_ALLOCATION
22 # define NFILES 32
23 # define MAXCD 250
24 #else
25 # define NFILES 32
26 # define MAXCD 250
27 #endif
28 
29 #define MAXNC 600
30 #define MXNAF 4
31 
32 /*
33 ** On certain operating systems, the FORTRAN compiler appends an underscore
34 ** to subprogram names in its object namespace. Therefore, on such systems,
35 ** a matching underscore must be appended to any C language references to
36 ** the same subprogram names so that the linker can correctly resolve such
37 ** references across the C <-> FORTRAN interface at link time. This needs
38 ** to be done for any subprogram that is either:
39 ** 1) a C function, or
40 ** 2) a FORTRAN subprogram called from C
41 */
42 #ifdef UNDERSCORE
43 #define arallocc arallocc_
44 #define ardllocc ardllocc_
45 #define bort bort_
46 #define bort_exit bort_exit_
47 #define bvers bvers_
48 #define cadn30 cadn30_
49 #define cmpia cmpia_
50 #define elemdx elemdx_
51 #define gets1loc gets1loc_
52 #define ichkstr ichkstr_
53 #define icvidx icvidx_
54 #define ifxy ifxy_
55 #define igetntbi igetntbi_
56 #define igetprm igetprm_
57 #define igettdi igettdi_
58 #define imrkopr imrkopr_
59 #define ipkm ipkm_
60 #define istdesc istdesc_
61 #define iupbs01 iupbs01_
62 #define iupm iupm_
63 #define nemtab nemtab_
64 #define nemtbb nemtbb_
65 #define nummtb nummtb_
66 #define numtbd numtbd_
67 #define pktdd pktdd_
68 #define restd restd_
69 #define stntbi stntbi_
70 #define strnum strnum_
71 #define stseq stseq_
72 #define uptdd uptdd_
73 #define wrdesc wrdesc_
74 #define wrdlen wrdlen_
75 #endif
76 
77 /*
78 ** In order to ensure that the C <-> FORTRAN interface works properly (and
79 ** portably!), the default size of an "INTEGER" declared in FORTRAN must be
80 ** identical to that of an "int" declared in C. If this is not the case (e.g.
81 ** some FORTRAN compilers, most notably AIX via the -qintsize= option, allow the
82 ** sizes of INTEGERs to be definitively prescribed outside of the source code
83 ** itself!), then the following conditional directive (or a variant of it) can
84 ** be used to ensure that the size of an "int" in C remains identical to that
85 ** of an "INTEGER" in FORTRAN.
86 */
87 #ifdef F77_INTSIZE_8
88  typedef long f77int;
89 #else
90  typedef int f77int;
91 #endif
92 
93 /*
94 ** Declare prototypes for ANSI C compatibility. This should be done for any
95 ** subprogram that is either:
96 ** 1) a C function, or
97 ** 2) a FORTRAN subprogram called from C
98 */
99 void arallocc( void );
100 void ardllocc( void );
101 void bort( char *, f77int );
102 void bort_exit( void );
103 void bvers( char *, f77int );
104 void cadn30( f77int *, char *, f77int );
105 int cmpia( const void *, const void * );
106 void elemdx( char *, f77int *, f77int );
107 void gets1loc( char *, f77int *, f77int *, f77int *, f77int *, f77int );
108 f77int ichkstr ( char *, char *, f77int *, f77int, f77int );
109 f77int icvidx ( f77int *, f77int *, f77int * );
110 f77int ifxy( char *, f77int );
111 f77int igetntbi( f77int *, char *, f77int );
112 f77int igetprm( char *, f77int );
113 f77int igettdi( f77int * );
114 f77int imrkopr( char *, f77int );
115 void ipkm( char *, f77int *, f77int *, f77int );
116 f77int istdesc( f77int * );
117 f77int iupbs01 ( f77int *, char *, f77int );
118 f77int iupm ( char *, f77int *, f77int );
119 void nemtab( f77int *, char *, f77int *, char *, f77int *, f77int, f77int );
120 void nemtbb( f77int *, f77int *, char *, f77int *, f77int *, f77int *, f77int );
121 void nummtb( f77int *, char *, f77int * );
122 void numtbd( f77int *, f77int *, char *, char *, f77int *, f77int, f77int );
123 void pktdd( f77int *, f77int *, f77int *, f77int * );
124 void restd( f77int *, f77int *, f77int *, f77int * );
125 void stntbi( f77int *, f77int *, char *, char *, char *, f77int, f77int, f77int );
126 void strnum( char *, f77int *, f77int );
127 void stseq( f77int *, f77int *, f77int *, char *, char *, f77int *, f77int * );
128 void uptdd( f77int *, f77int *, f77int *, f77int * );
129 void wrdesc( f77int, f77int *, f77int * );
130 void wrdlen( void );
void stseq(f77int *lun, f77int *irepct, f77int *idn, char nemo[8], char cseq[55], f77int cdesc[], f77int *ncdesc)
C C SUBPROGRAM: STSEQ C PRGMMR: ATOR ORG: NP12 DATE: 2009-03-23 C C ABSTRACT: USING THE BUFR MASTER T...
Definition: stseq.c:64
void arallocc(void)
For dynamic allocation builds of the library, this subroutine is called internally during the first c...
Definition: arallocc.c:34
void restd(f77int *lun, f77int *tddesc, f77int *nctddesc, f77int ctddesc[])
C C SUBPROGRAM: RESTD C PRGMMR: ATOR ORG: NP12 DATE: 2004-08-18 C C ABSTRACT: GIVEN THE BIT-WISE REPR...
Definition: restd.c:55
function istdesc(IDN)
GIVEN THE BIT-WISE REPRESENTATION OF THE FXY VALUE FOR A DESCRIPTOR, THIS FUNCTION DETERMINES WHETHER...
Definition: istdesc.f:27
void nummtb(f77int *idn, char *tab, f77int *ipt)
C C SUBPROGRAM: NUMMTB C PRGMMR: ATOR ORG: NP12 DATE: 2009-03-23 C C ABSTRACT: THIS ROUTINE SEARCHES ...
Definition: nummtb.c:43
function iupm(CBAY, NBITS)
THIS FUNCTION UNPACKS AND RETURNS A BINARY INTEGER WORD CONTAINED WITHIN NBITS BITS OF A CHARACTER ST...
Definition: iupm.f:40
subroutine strnum(STR, NUM)
THIS SUBROUTINE DECODES AN INTEGER FROM A CHARACTER STRING.
Definition: strnum.f:33
function ichkstr(STR, CHR, N)
THIS FUNCTION COMPARES A SPECIFIED NUMBER OF CHARACTERS FROM AN INPUT CHARACTER ARRAY AGAINST THE SAM...
Definition: ichkstr.f:32
void ardllocc(void)
This subroutine frees any memory that was dynamically allocated during a previous call to subroutine ...
Definition: ardllocc.c:21
subroutine bvers(CVERSTR)
This subroutine returns a character string containing the version number of the BUFRLIB software...
Definition: bvers.f:32
INTEGER function igetprm(CPRMNM)
This function returns the current value of a parameter used for allocating one or more internal array...
Definition: igetprm.f:81
subroutine gets1loc(S1MNEM, IBEN, ISBYT, IWID, IRET)
THIS SUBROUTINE RETURNS THE LOCATION (I.E.
Definition: gets1loc.f:80
function igettdi(IFLAG)
DEPENDING ON THE VALUE OF THE INPUT FLAG, THIS FUNCTION EITHER RETURNS THE NEXT USABLE SCRATCH TABLE ...
Definition: igettdi.f:30
subroutine nemtbb(LUN, ITAB, UNIT, ISCL, IREF, IBIT)
THIS SUBROUTINE CHECKS ALL OF THE PROPERTIES (E.G.
Definition: nemtbb.f:49
subroutine numtbd(LUN, IDN, NEMO, TAB, IRET)
THIS SUBROUTINE SEARCHES FOR AN INTEGER IDN, CONTAINING THE BIT-WISE REPRESENTATION OF A DESCRIPTOR (...
Definition: numtbd.f:54
function ifxy(ADSC)
THIS FUNCTION RETURNS THE INTEGER CORRESPONDING TO THE BIT-WISE REPRESENTATION OF AN INPUT CHARACTER ...
Definition: ifxy.f:49
subroutine wrdlen
This subroutine figures out some important information about the local machine on which the BUFRLIB s...
Definition: wrdlen.F:43
subroutine ipkm(CBAY, NBYT, N)
This subroutine encodes an integer value within a specified number of bytes of a character string...
Definition: ipkm.f:29
subroutine cadn30(IDN, ADN)
GIVEN THE BIT-WISE REPRESENTATION OF THE FXY VALUE FOR A DESCRIPTOR, THIS ROUTINE CALLS FUNCTION ADN3...
Definition: cadn30.f:29
function igetntbi(LUN, CTB)
THIS FUNCTION RETURNS THE NEXT AVAILABLE INDEX FOR STORING AN ENTRY WITHIN INTERNAL BUFR TABLE CTB...
Definition: igetntbi.f:26
subroutine pktdd(ID, LUN, IDN, IRET)
THIS SUBROUTINE STORES INFORMATION ABOUT A &quot;CHILD&quot; MNEMONIC WITHIN THE INTERNAL BUFR TABLE D ENTRY (I...
Definition: pktdd.f:54
void wrdesc(f77int desc, f77int descary[], f77int *ndescary)
C C SUBPROGRAM: WRDESC C PRGMMR: ATOR ORG: NP12 DATE: 2004-08-18 C C ABSTRACT: GIVEN THE BIT-WISE REP...
Definition: wrdesc.c:46
subroutine stntbi(N, LUN, NUMB, NEMO, CELSQ)
THIS SUBROUTINE STORES A NEW ENTRY WITHIN INTERNAL BUFR TABLE B OR D, DEPENDING ON THE VALUE OF NUMB...
Definition: stntbi.f:27
void bort_exit(void)
This subroutine terminates the application program with a non-zero status code.
Definition: bort_exit.c:21
subroutine nemtab(LUN, NEMO, IDN, TAB, IRET)
THIS SUBROUTINE SEARCHES FOR MNEMONIC NEMO WITHIN THE INTERNAL TABLE B AND D ARRAYS HOLDING THE DICTI...
Definition: nemtab.f:66
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23
subroutine elemdx(CARD, LUN)
THIS SUBROUTINE DECODES THE SCALE FACTOR, REFERENCE VALUE, BIT WIDTH AND UNITS (I.E., THE &quot;ELEMENTS&quot;) FROM A TABLE B MNEMONIC DEFINITION CARD THAT WAS PREVIOUSLY READ FROM A USER-SUPPLIED BUFR DICTIONARY TABLE FILE IN CHARACTER FORMAT BY BUFR ARCHIVE LIBRARY SUBROUTINE RDUSDX.
Definition: elemdx.f:46
subroutine uptdd(ID, LUN, IENT, IRET)
THIS SUBROUTINE RETURNS THE BIT-WISE REPRESENTATION OF THE FXY VALUE CORRESPONDING TO...
Definition: uptdd.f:60
int cmpia(const void *pf1, const void *pf2)
C C SUBPROGRAM: CMPIA C PRGMMR: ATOR ORG: NP12 DATE: 2009-03-23 C C ABSTRACT: THIS ROUTINE DEFINES A ...
Definition: cmpia.c:41
INTEGER function imrkopr(NEMO)
This function determines whether a specified mnemonic is a Table C marker operator.
Definition: imrkopr.f:19
f77int icvidx(f77int *ii, f77int *jj, f77int *numjj)
C C SUBPROGRAM: ICVIDX C PRGMMR: ATOR ORG: NP12 DATE: 2009-03-23 C C ABSTRACT: THIS ROUTINE COMPUTES ...
Definition: icvidx.c:41
function iupbs01(MBAY, S01MNEM)
This function returns a specified value from within Section 0 or Section 1 of a BUFR message...
Definition: iupbs01.f:72