Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
95670fda
Commit
95670fda
authored
Aug 06, 2019
by
Uwe Schulzweida
Browse files
make_fint: scan C++ comments.
parent
e7e629c9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
95670fda
This diff is collapsed.
Click to expand it.
src/cdi.inc
View file @
95670fda
...
...
@@ -312,6 +312,9 @@
!
key
-
value
pairs
in
combination
.
!
!
Currently
,
only
multiple
pairs
combined
by
AND
are
supported
.
!
!
!
TIME
types
!
INTEGER
TIME_CONSTANT
PARAMETER
(
TIME_CONSTANT
=
0
)
...
...
@@ -319,6 +322,9 @@
PARAMETER
(
TIME_VARYING
=
1
)
INTEGER
TIME_VARIABLE
PARAMETER
(
TIME_VARIABLE
=
1
)
!
!
TSTEP
types
!
INTEGER
TSTEP_INSTANT
PARAMETER
(
TSTEP_INSTANT
=
1
)
INTEGER
TSTEP_AVG
...
...
@@ -347,12 +353,18 @@
PARAMETER
(
TSTEP_INSTANT2
=
13
)
INTEGER
TSTEP_INSTANT3
PARAMETER
(
TSTEP_INSTANT3
=
14
)
!
!
TAXIS
types
!
INTEGER
TAXIS_ABSOLUTE
PARAMETER
(
TAXIS_ABSOLUTE
=
1
)
INTEGER
TAXIS_RELATIVE
PARAMETER
(
TAXIS_RELATIVE
=
2
)
INTEGER
TAXIS_FORECAST
PARAMETER
(
TAXIS_FORECAST
=
3
)
!
!
TUNIT
types
!
INTEGER
TUNIT_SECOND
PARAMETER
(
TUNIT_SECOND
=
1
)
INTEGER
TUNIT_MINUTE
...
...
@@ -375,6 +387,9 @@
PARAMETER
(
TUNIT_MONTH
=
10
)
INTEGER
TUNIT_YEAR
PARAMETER
(
TUNIT_YEAR
=
11
)
!
!
CALENDAR
types
!
INTEGER
CALENDAR_STANDARD
PARAMETER
(
CALENDAR_STANDARD
=
0
)
INTEGER
CALENDAR_GREGORIAN
...
...
@@ -733,6 +748,33 @@
!
File
driven
I
/
O
(
may
yield
better
performance
than
using
the
streamXXX
functions
)
!
!
!
Creation
&
Destruction
!
!
!
Advancing
an
iterator
!
!
!
Introspecting
metadata
!
!
!
All
outXXX
arguments
to
these
functions
may
be
NULL
.
!
!
!
Reading
data
!
!
!
TODO
[
NH
]
:
Add
functions
to
read
partial
fields
.
!
!
!
Direct
access
to
grib
fields
!
!
!
Callthroughs
to
GRIB
-
API
!
!
!
Convenience
functions
for
accessing
GRIB
-
API
keys
!
!
!
VLIST
routines
!
INTEGER
vlistCreate
...
...
@@ -1295,6 +1337,9 @@
!
CHARACTER
*
(
*
)
name
)
EXTERNAL
vlistInqVarIntKey
!
!
CDI
attributes
!
INTEGER
cdiInqNatts
!
(
INTEGER
cdiID
,
!
INTEGER
varID
,
...
...
@@ -1373,6 +1418,9 @@
!
CHARACTER
*
(
*
)
tp_cbuf
)
EXTERNAL
cdiInqAttTxt
!
!
GRID
routines
!
!
gridName
!
(
INTEGER
gridtype
,
!
CHARACTER
*
(
*
)
gridname
)
...
...
@@ -1509,6 +1557,9 @@
!
(
INTEGER
gridID
)
EXTERNAL
gridInqYIsc
!
!
CDI
var
keys
!
INTEGER
CDI_KEY_TABLESVERSION
PARAMETER
(
CDI_KEY_TABLESVERSION
=
801
)
INTEGER
CDI_KEY_LOCALTABLESVERSION
...
...
@@ -1596,6 +1647,9 @@
!
INTEGER
varID2
)
EXTERNAL
cdiCopyKeys
!
!
CDI
grid
keys
!
INTEGER
CDI_KEY_XNAME
PARAMETER
(
CDI_KEY_XNAME
=
901
)
INTEGER
CDI_KEY_XDIMNAME
...
...
@@ -1618,6 +1672,9 @@
PARAMETER
(
CDI_KEY_MAPPING
=
921
)
INTEGER
CDI_KEY_MAPNAME
PARAMETER
(
CDI_KEY_MAPNAME
=
922
)
!
!
CDI
zaxis
keys
!
INTEGER
CDI_KEY_NAME
PARAMETER
(
CDI_KEY_NAME
=
941
)
INTEGER
CDI_KEY_DIMNAME
...
...
@@ -2012,6 +2069,9 @@
!
(
INTEGER
gridID
)
EXTERNAL
gridInqScanningMode
!
!
ZAXIS
routines
!
!
zaxisName
!
(
INTEGER
zaxistype
,
!
CHARACTER
*
(
*
)
zaxisname
)
...
...
src/cdiFortran.c
View file @
95670fda
...
...
@@ -44,52 +44,67 @@ int size_t_c2f(size_t value_size_t)
}
/
*
Byte order
*/
/
/
Byte order
/
*
Error identifier
*/
/
/
Error identifier
/
*
File types
*/
/
/
File types
/
*
Compress types
*/
/
/
Compress types
/
*
external data types
*/
/
/
external data types
/
*
internal data types
*/
/
/
internal data types
/
*
Chunks
*/
/
/
Chunks
/
*
GRID types
*/
/
/
GRID types
/
*
ZAXIS types
*/
/
/
ZAXIS types
/
*
SUBTYPE types
*/
/
/
SUBTYPE types
/
*
Data structure defining a key-value search, possibly with multiple
/
/
Data structure defining a key-value search, possibly with multiple
key
-
value
pairs
in
combination
.
Currently, only multiple pairs combined by AND are supported.
*/
Currently
,
only
multiple
pairs
combined
by
AND
are
supported
.
/
* number of unsigned char needed to store UUID */
/
/ TIME types
/
*
Structs that are used to return data to the user */
/
/
TSTEP types
/
*
Opaque
types
*/
/
/
TAXIS
types
/* CDI control routines */
// TUNIT types
// CALENDAR types
// number of unsigned char needed to store UUID
// Structs that are used to return data to the user
// Opaque types
// CDI control routines
FCALLSCSUB0
(
cdiReset
,
CDIRESET
,
cdireset
)
FCALLSCFUN1
(
STRING
,
cdiStringError
,
CDISTRINGERROR
,
cdistringerror
,
INT
)
...
...
@@ -106,19 +121,19 @@ FCALLSCSUB1 (namespaceSetActive, NAMESPACESETACTIVE, namespacesetactive, INT)
FCALLSCFUN0
(
INT
,
namespaceGetActive
,
NAMESPACEGETACTIVE
,
namespacegetactive
)
FCALLSCSUB1
(
namespaceDelete
,
NAMESPACEDELETE
,
namespacedelete
,
INT
)
/
*
CDI converter routines
*/
/
/
CDI converter routines
/
*
parameter
*/
/
/
parameter
FCALLSCSUB3
(
cdiParamToString
,
CDIPARAMTOSTRING
,
cdiparamtostring
,
INT
,
PSTRING
,
INT
)
FCALLSCSUB4
(
cdiDecodeParam
,
CDIDECODEPARAM
,
cdidecodeparam
,
INT
,
PINT
,
PINT
,
PINT
)
FCALLSCFUN3
(
INT
,
cdiEncodeParam
,
CDIENCODEPARAM
,
cdiencodeparam
,
INT
,
INT
,
INT
)
/
*
date format: YYYYMMDD
*/
/
/
date format: YYYYMMDD
/
*
time format: hhmmss
*/
/
/
time format: hhmmss
static
void
cdiDecodeDate_fwrap
(
int
date
,
int
*
year
,
int
*
month
,
int
*
day
)
{
...
...
@@ -135,7 +150,7 @@ FCALLSCFUN3 (INT, cdiEncodeDate_fwrap, CDIENCODEDATE, cdiencodedate, INT, INT, I
FCALLSCSUB4
(
cdiDecodeTime
,
CDIDECODETIME
,
cdidecodetime
,
INT
,
PINT
,
PINT
,
PINT
)
FCALLSCFUN3
(
INT
,
cdiEncodeTime
,
CDIENCODETIME
,
cdiencodetime
,
INT
,
INT
,
INT
)
/
*
STREAM control routines
*/
/
/
STREAM control routines
FCALLSCFUN2
(
INT
,
cdiGetFiletype
,
CDIGETFILETYPE
,
cdigetfiletype
,
STRING
,
PINT
)
FCALLSCFUN1
(
INT
,
streamOpenRead
,
STREAMOPENREAD
,
streamopenread
,
STRING
)
...
...
@@ -167,7 +182,7 @@ static int streamNvals_fwrap(int streamID)
FCALLSCFUN1
(
INT
,
streamNvals_fwrap
,
STREAMNVALS
,
streamnvals
,
INT
)
FCALLSCFUN1
(
INT
,
streamInqNvars
,
STREAMINQNVARS
,
streaminqnvars
,
INT
)
/
*
STREAM var I/O routines (random access)
*/
/
/
STREAM var I/O routines (random access)
static
void
streamWriteVar_fwrap
(
int
streamID
,
int
varID
,
const
double
data
[],
int
nmiss
)
{
...
...
@@ -227,7 +242,7 @@ static void streamWriteVarChunk_fwrap(int streamID, int varID, const int rect[3]
}
FCALLSCSUB5
(
streamWriteVarChunk_fwrap
,
STREAMWRITEVARCHUNK
,
streamwritevarchunk
,
INT
,
INT
,
INTVV
,
DOUBLEV
,
INT
)
/
*
STREAM record I/O routines (sequential access)
*/
/
/
STREAM record I/O routines (sequential access)
FCALLSCSUB3
(
streamDefRecord
,
STREAMDEFRECORD
,
streamdefrecord
,
INT
,
INT
,
INT
)
FCALLSCSUB3
(
streamInqRecord
,
STREAMINQRECORD
,
streaminqrecord
,
INT
,
PINT
,
PINT
)
...
...
@@ -259,10 +274,37 @@ static void streamReadRecordF_fwrap(int streamID, float data[], int *nmiss)
FCALLSCSUB3
(
streamReadRecordF_fwrap
,
STREAMREADRECORDF
,
streamreadrecordf
,
INT
,
FLOATV
,
PINT
)
FCALLSCSUB2
(
streamCopyRecord
,
STREAMCOPYRECORD
,
streamcopyrecord
,
INT
,
INT
)
/* File driven I/O (may yield better performance than using the streamXXX functions) */
// File driven I/O (may yield better performance than using the streamXXX functions)
// Creation & Destruction
// Advancing an iterator
// Introspecting metadata
// All outXXX arguments to these functions may be NULL.
// Reading data
/* VLIST routines */
// TODO[NH]: Add functions to read partial fields.
// Direct access to grib fields
// Callthroughs to GRIB-API
// Convenience functions for accessing GRIB-API keys
// VLIST routines
FCALLSCFUN0
(
INT
,
vlistCreate
,
VLISTCREATE
,
vlistcreate
)
FCALLSCSUB1
(
vlistDestroy
,
VLISTDESTROY
,
vlistdestroy
,
INT
)
...
...
@@ -307,7 +349,7 @@ FCALLSCFUN1 (INT, vlistInqInstitut, VLISTINQINSTITUT, vlistinqinstitut, INT)
FCALLSCSUB2
(
vlistDefModel
,
VLISTDEFMODEL
,
vlistdefmodel
,
INT
,
INT
)
FCALLSCFUN1
(
INT
,
vlistInqModel
,
VLISTINQMODEL
,
vlistinqmodel
,
INT
)
/
*
VLIST VAR routines
*/
/
/
VLIST VAR routines
FCALLSCFUN5
(
INT
,
vlistDefVarTiles
,
VLISTDEFVARTILES
,
vlistdefvartiles
,
INT
,
INT
,
INT
,
INT
,
INT
)
FCALLSCFUN4
(
INT
,
vlistDefVar
,
VLISTDEFVAR
,
vlistdefvar
,
INT
,
INT
,
INT
,
INT
)
...
...
@@ -317,7 +359,7 @@ FCALLSCSUB5 (vlistInqVar, VLISTINQVAR, vlistinqvar, INT, INT, PINT, PINT, PINT)
FCALLSCFUN2
(
INT
,
vlistInqVarGrid
,
VLISTINQVARGRID
,
vlistinqvargrid
,
INT
,
INT
)
FCALLSCFUN2
(
INT
,
vlistInqVarZaxis
,
VLISTINQVARZAXIS
,
vlistinqvarzaxis
,
INT
,
INT
)
/
*
used in MPIOM
*/
/
/
used in MPIOM
FCALLSCFUN2
(
INT
,
vlistInqVarID
,
VLISTINQVARID
,
vlistinqvarid
,
INT
,
INT
)
FCALLSCSUB3
(
vlistDefVarTimetype
,
VLISTDEFVARTIMETYPE
,
vlistdefvartimetype
,
INT
,
INT
,
INT
)
...
...
@@ -386,6 +428,9 @@ FCALLSCSUB4 (vlistDefVarDblKey, VLISTDEFVARDBLKEY, vlistdefvardblkey, INT, INT,
FCALLSCFUN3
(
INT
,
vlistHasVarKey
,
VLISTHASVARKEY
,
vlisthasvarkey
,
INT
,
INT
,
STRING
)
FCALLSCFUN3
(
DOUBLE
,
vlistInqVarDblKey
,
VLISTINQVARDBLKEY
,
vlistinqvardblkey
,
INT
,
INT
,
STRING
)
FCALLSCFUN3
(
INT
,
vlistInqVarIntKey
,
VLISTINQVARINTKEY
,
vlistinqvarintkey
,
INT
,
INT
,
STRING
)
// CDI attributes
FCALLSCFUN3
(
INT
,
cdiInqNatts
,
CDIINQNATTS
,
cdiinqnatts
,
INT
,
INT
,
PINT
)
FCALLSCFUN6
(
INT
,
cdiInqAtt
,
CDIINQATT
,
cdiinqatt
,
INT
,
INT
,
INT
,
PSTRING
,
PINT
,
PINT
)
FCALLSCFUN3
(
INT
,
cdiDelAtt
,
CDIDELATT
,
cdidelatt
,
INT
,
INT
,
STRING
)
...
...
@@ -396,6 +441,9 @@ FCALLSCFUN5 (INT, cdiDefAttTxt, CDIDEFATTTXT, cdidefatttxt, INT, INT, STRING, IN
FCALLSCFUN5
(
INT
,
cdiInqAttInt
,
CDIINQATTINT
,
cdiinqattint
,
INT
,
INT
,
STRING
,
INT
,
INTV
)
FCALLSCFUN5
(
INT
,
cdiInqAttFlt
,
CDIINQATTFLT
,
cdiinqattflt
,
INT
,
INT
,
STRING
,
INT
,
DOUBLEV
)
FCALLSCFUN5
(
INT
,
cdiInqAttTxt
,
CDIINQATTTXT
,
cdiinqatttxt
,
INT
,
INT
,
STRING
,
INT
,
PPSTRING
)
// GRID routines
FCALLSCSUB2
(
gridName
,
GRIDNAME
,
gridname
,
INT
,
PSTRING
)
FCALLSCFUN1
(
STRING
,
gridNamePtr
,
GRIDNAMEPTR
,
gridnameptr
,
INT
)
FCALLSCSUB1
(
gridCompress
,
GRIDCOMPRESS
,
gridcompress
,
INT
)
...
...
@@ -481,12 +529,21 @@ static int gridInqYvalsPart_fwrap(int gridID, int start, int size, double yvals[
}
FCALLSCFUN4
(
INT
,
gridInqYvalsPart_fwrap
,
GRIDINQYVALSPART
,
gridinqyvalspart
,
INT
,
INT
,
INT
,
DOUBLEV
)
FCALLSCFUN1
(
INT
,
gridInqYIsc
,
GRIDINQYISC
,
gridinqyisc
,
INT
)
// CDI var keys
FCALLSCFUN4
(
INT
,
cdiDefKeyInt
,
CDIDEFKEYINT
,
cdidefkeyint
,
INT
,
INT
,
INT
,
INT
)
FCALLSCFUN4
(
INT
,
cdiInqKeyInt
,
CDIINQKEYINT
,
cdiinqkeyint
,
INT
,
INT
,
INT
,
PINT
)
FCALLSCFUN4
(
INT
,
cdiDefKeyString
,
CDIDEFKEYSTRING
,
cdidefkeystring
,
INT
,
INT
,
INT
,
STRING
)
FCALLSCFUN5
(
INT
,
cdiInqKeyString
,
CDIINQKEYSTRING
,
cdiinqkeystring
,
INT
,
INT
,
INT
,
PSTRING
,
PINT
)
FCALLSCFUN4
(
INT
,
cdiInqKeyLen
,
CDIINQKEYLEN
,
cdiinqkeylen
,
INT
,
INT
,
INT
,
PINT
)
FCALLSCFUN4
(
INT
,
cdiCopyKeys
,
CDICOPYKEYS
,
cdicopykeys
,
INT
,
INT
,
INT
,
INT
)
// CDI grid keys
// CDI zaxis keys
FCALLSCFUN4
(
INT
,
cdiGridDefKeyStr
,
CDIGRIDDEFKEYSTR
,
cdigriddefkeystr
,
INT
,
INT
,
INT
,
STRING
)
FCALLSCFUN4
(
INT
,
cdiGridInqKeyStr
,
CDIGRIDINQKEYSTR
,
cdigridinqkeystr
,
INT
,
INT
,
INT
,
PSTRING
)
FCALLSCFUN4
(
INT
,
cdiZaxisDefKeyStr
,
CDIZAXISDEFKEYSTR
,
cdizaxisdefkeystr
,
INT
,
INT
,
INT
,
STRING
)
...
...
@@ -529,7 +586,7 @@ FCALLSCFUN1 (INT, gridIsCircular, GRIDISCIRCULAR, gridiscircular, INT)
FCALLSCFUN1
(
INT
,
gridInqTrunc
,
GRIDINQTRUNC
,
gridinqtrunc
,
INT
)
FCALLSCSUB2
(
gridDefTrunc
,
GRIDDEFTRUNC
,
griddeftrunc
,
INT
,
INT
)
/
*
Reference of an unstructured grid
*/
/
/
Reference of an unstructured grid
FCALLSCSUB2
(
gridDefNumber
,
GRIDDEFNUMBER
,
griddefnumber
,
INT
,
INT
)
FCALLSCFUN1
(
INT
,
gridInqNumber
,
GRIDINQNUMBER
,
gridinqnumber
,
INT
)
...
...
@@ -540,22 +597,22 @@ FCALLSCFUN2 (INT, gridInqReference, GRIDINQREFERENCE, gridinqreference, INT, PST
FCALLSCSUB2
(
gridDefUUID
,
GRIDDEFUUID
,
griddefuuid
,
INT
,
PVOID
)
FCALLSCSUB2
(
gridInqUUID
,
GRIDINQUUID
,
gridinquuid
,
INT
,
PVOID
)
/
*
Rotated Lon/Lat grid
*/
/
/
Rotated Lon/Lat grid
FCALLSCSUB4
(
gridDefParamRLL
,
GRIDDEFPARAMRLL
,
griddefparamrll
,
INT
,
DOUBLE
,
DOUBLE
,
DOUBLE
)
FCALLSCSUB4
(
gridInqParamRLL
,
GRIDINQPARAMRLL
,
gridinqparamrll
,
INT
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
)
/
*
Hexagonal GME grid
*/
/
/
Hexagonal GME grid
FCALLSCSUB5
(
gridDefParamGME
,
GRIDDEFPARAMGME
,
griddefparamgme
,
INT
,
INT
,
INT
,
INT
,
INT
)
FCALLSCSUB5
(
gridInqParamGME
,
GRIDINQPARAMGME
,
gridinqparamgme
,
INT
,
PINT
,
PINT
,
PINT
,
PINT
)
/
*
Lambert Conformal Conic grid
*/
/
/
Lambert Conformal Conic grid
FCALLSCSUB12
(
gridDefParamLCC
,
GRIDDEFPARAMLCC
,
griddefparamlcc
,
INT
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
)
FCALLSCFUN12
(
INT
,
gridInqParamLCC
,
GRIDINQPARAMLCC
,
gridinqparamlcc
,
INT
,
DOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
)
/
*
Polar stereographic grid
*/
/
/
Polar stereographic grid
FCALLSCSUB10
(
gridDefParamSTERE
,
GRIDDEFPARAMSTERE
,
griddefparamstere
,
INT
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
,
DOUBLE
)
FCALLSCFUN10
(
INT
,
gridInqParamSTERE
,
GRIDINQPARAMSTERE
,
gridinqparamstere
,
INT
,
DOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
,
PDOUBLE
)
...
...
@@ -601,6 +658,9 @@ FCALLSCSUB2 (gridDefComplexPacking, GRIDDEFCOMPLEXPACKING, griddefcomplexpacking
FCALLSCFUN1
(
INT
,
gridInqComplexPacking
,
GRIDINQCOMPLEXPACKING
,
gridinqcomplexpacking
,
INT
)
FCALLSCSUB2
(
gridDefScanningMode
,
GRIDDEFSCANNINGMODE
,
griddefscanningmode
,
INT
,
INT
)
FCALLSCFUN1
(
INT
,
gridInqScanningMode
,
GRIDINQSCANNINGMODE
,
gridinqscanningmode
,
INT
)
// ZAXIS routines
FCALLSCSUB2
(
zaxisName
,
ZAXISNAME
,
zaxisname
,
INT
,
PSTRING
)
FCALLSCFUN1
(
STRING
,
zaxisNamePtr
,
ZAXISNAMEPTR
,
zaxisnameptr
,
INT
)
FCALLSCFUN2
(
INT
,
zaxisCreate
,
ZAXISCREATE
,
zaxiscreate
,
INT
,
INT
)
...
...
@@ -649,7 +709,7 @@ FCALLSCSUB2 (zaxisDefWeights, ZAXISDEFWEIGHTS, zaxisdefweights, INT, DOUBLEV)
FCALLSCFUN2
(
INT
,
zaxisInqWeights
,
ZAXISINQWEIGHTS
,
zaxisinqweights
,
INT
,
DOUBLEV
)
FCALLSCSUB2
(
zaxisChangeType
,
ZAXISCHANGETYPE
,
zaxischangetype
,
INT
,
INT
)
/
*
TAXIS routines
*/
/
/
TAXIS routines
FCALLSCFUN1
(
INT
,
taxisCreate
,
TAXISCREATE
,
taxiscreate
,
INT
)
FCALLSCSUB1
(
taxisDestroy
,
TAXISDESTROY
,
taxisdestroy
,
INT
)
...
...
@@ -732,7 +792,7 @@ FCALLSCSUB2 (taxisDefNumavg, TAXISDEFNUMAVG, taxisdefnumavg, INT, INT)
FCALLSCFUN1
(
INT
,
taxisInqNumavg
,
TAXISINQNUMAVG
,
taxisinqnumavg
,
INT
)
FCALLSCFUN1
(
STRING
,
tunitNamePtr
,
TUNITNAMEPTR
,
tunitnameptr
,
INT
)
/
*
Institut routines
*/
/
/
Institut routines
FCALLSCFUN4
(
INT
,
institutDef
,
INSTITUTDEF
,
institutdef
,
INT
,
INT
,
STRING
,
STRING
)
FCALLSCFUN4
(
INT
,
institutInq
,
INSTITUTINQ
,
institutinq
,
INT
,
INT
,
STRING
,
STRING
)
...
...
@@ -742,7 +802,7 @@ FCALLSCFUN1 (INT, institutInqSubcenter, INSTITUTINQSUBCENTER, institutinqsubcent
FCALLSCFUN1
(
STRING
,
institutInqNamePtr
,
INSTITUTINQNAMEPTR
,
institutinqnameptr
,
INT
)
FCALLSCFUN1
(
STRING
,
institutInqLongnamePtr
,
INSTITUTINQLONGNAMEPTR
,
institutinqlongnameptr
,
INT
)
/
*
Model routines
*/
/
/
Model routines
FCALLSCFUN3
(
INT
,
modelDef
,
MODELDEF
,
modeldef
,
INT
,
INT
,
STRING
)
FCALLSCFUN3
(
INT
,
modelInq
,
MODELINQ
,
modelinq
,
INT
,
INT
,
STRING
)
...
...
@@ -750,7 +810,7 @@ FCALLSCFUN1 (INT, modelInqInstitut, MODELINQINSTITUT, modelinqinstitut, INT)
FCALLSCFUN1
(
INT
,
modelInqGribID
,
MODELINQGRIBID
,
modelinqgribid
,
INT
)
FCALLSCFUN1
(
STRING
,
modelInqNamePtr
,
MODELINQNAMEPTR
,
modelinqnameptr
,
INT
)
/
*
Table routines
*/
/
/
Table routines
FCALLSCSUB2
(
tableWrite
,
TABLEWRITE
,
tablewrite
,
STRING
,
INT
)
FCALLSCFUN1
(
INT
,
tableRead
,
TABLEREAD
,
tableread
,
STRING
)
...
...
@@ -762,31 +822,31 @@ FCALLSCFUN1 (INT, tableInqNum, TABLEINQNUM, tableinqnum, INT)
FCALLSCFUN1
(
INT
,
tableInqModel
,
TABLEINQMODEL
,
tableinqmodel
,
INT
)
FCALLSCSUB6
(
tableInqEntry
,
TABLEINQENTRY
,
tableinqentry
,
INT
,
INT
,
INT
,
PSTRING
,
PSTRING
,
PSTRING
)
/
*
History routines
*/
/
/
History routines
FCALLSCSUB3
(
streamDefHistory
,
STREAMDEFHISTORY
,
streamdefhistory
,
INT
,
INT
,
STRING
)
FCALLSCFUN1
(
INT
,
streamInqHistorySize
,
STREAMINQHISTORYSIZE
,
streaminqhistorysize
,
INT
)
FCALLSCSUB2
(
streamInqHistoryString
,
STREAMINQHISTORYSTRING
,
streaminqhistorystring
,
INT
,
PSTRING
)
/
*
Subtype routines
*/
/
/
Subtype routines
FCALLSCFUN1
(
INT
,
subtypeCreate
,
SUBTYPECREATE
,
subtypecreate
,
INT
)
/
*
Gives a textual summary of the variable subtype
*/
/
/
Gives a textual summary of the variable subtype
FCALLSCSUB1
(
subtypePrint
,
SUBTYPEPRINT
,
subtypeprint
,
INT
)
/
*
Compares two subtype data structures
*/
/
/
Compares two subtype data structures
FCALLSCFUN2
(
INT
,
subtypeCompare
,
SUBTYPECOMPARE
,
subtypecompare
,
INT
,
INT
)
FCALLSCFUN1
(
INT
,
subtypeInqSize
,
SUBTYPEINQSIZE
,
subtypeinqsize
,
INT
)
FCALLSCFUN1
(
INT
,
subtypeInqActiveIndex
,
SUBTYPEINQACTIVEINDEX
,
subtypeinqactiveindex
,
INT
)
FCALLSCSUB2
(
subtypeDefActiveIndex
,
SUBTYPEDEFACTIVEINDEX
,
subtypedefactiveindex
,
INT
,
INT
)
/
*
Generate a "query object" out of a key-value pair
*/
/
/
Generate a "query object" out of a key-value pair
/
*
Generate an AND-combined "query object" out of two previous query objects
*/
/
/
Generate an AND-combined "query object" out of two previous query objects
FCALLSCFUN3
(
INT
,
subtypeInqTile
,
SUBTYPEINQTILE
,
subtypeinqtile
,
INT
,
INT
,
INT
)
FCALLSCFUN4
(
INT
,
subtypeInqAttribute
,
SUBTYPEINQATTRIBUTE
,
subtypeinqattribute
,
INT
,
INT
,
STRING
,
PINT
)
...
...
src/make_fint.c
View file @
95670fda
...
...
@@ -277,25 +277,21 @@ static int detectComment(char **line_, ssize_t *lineLen, size_t *lineBufSize,
char
*
xname
,
size_t
*
xnameLen
,
char
**
xdes
,
int
*
lineno
,
FILE
*
fpin
,
FILE
*
fpinc
,
FILE
*
fpint
);
static
regex_t
commentStartRE
,
commentEndRE
,
commentRE
,
docCommentRE
,
doc
Line
CommentRE
;
static
regex_t
commentStartRE
,
commentEndRE
,
commentRE
,
comment2RE
,
docCommentRE
,
docComment
2
RE
;
static
inline
int
arrayArgRank
(
int
argType
);
static
void
sprintFortranArrayArgDims
(
size_t
argDimsFSize
,
char
argDimsF
[
argDimsFSize
],
int
argType
,
const
char
*
argSpecC
,
size_t
maxMatch
,
regmatch_t
reMatch
[]);
int
argType
,
const
char
*
argSpecC
,
size_t
maxMatch
,
regmatch_t
reMatch
[]);
static
void
sprintCArrayArgDims
(
size_t
argDimsCSize
,
char
argDimsC
[
argDimsCSize
],
int
argType
,
const
char
*
argSpecC
,
const
regmatch_t
reMatch
[]);
int
argType
,
const
char
*
argSpecC
,
const
regmatch_t
reMatch
[]);
static
void
fortran_interface
(
char
*
fname
,
char
*
fnameinc
,
char
*
fnameint
,
const
char
*
doc_root
)
static
void
fortran_interface
(
char
*
fname
,
char
*
fnameinc
,
char
*
fnameint
,
const
char
*
doc_root
)
{
FILE
*
fp
;
char
*
line
=
NULL
,
*
pline
;
size_t
lineBufSize
=
0
;
char
sname
[
128
],
*
parname
;
...
...
@@ -338,10 +334,8 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
/* complete symbol table data */
{
maxMatch
=
symRegexCompile
(
NUM_KNOWN_ARG_TYPES
,
funArgSym
,
&
line
,
&
lineBufSize
);
size_t
maxFunMatch
=
symRegexCompile
(
NUM_RET_TYPES
,
funRet
,
&
line
,
&
lineBufSize
);
maxMatch
=
symRegexCompile
(
NUM_KNOWN_ARG_TYPES
,
funArgSym
,
&
line
,
&
lineBufSize
);
size_t
maxFunMatch
=
symRegexCompile
(
NUM_RET_TYPES
,
funRet
,
&
line
,
&
lineBufSize
);
if
(
maxFunMatch
>
maxMatch
)
maxMatch
=
maxFunMatch
;
}
...
...
@@ -361,17 +355,20 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
}
/* compile complete comment regular expression */
{
static
const
char
commentREString
[]
=
"^"
WS
"*/
\\
*"
WS
"*(.*"
NWS
")"
WS
"*
\\
*/"
;
static
const
char
commentREString
[]
=
"^"
WS
"*/
\\
*"
WS
"*(.*"
NWS
")"
WS
"*
\\
*/"
;
static
const
char
comment2REString
[]
=
"^"
WS
"*//"
WS
"*(.*"
NWS
")"
;
if
(
reCompile
(
&
commentRE
,
commentREString
,
&
line
,
&
lineBufSize
))
exit
(
EXIT_FAILURE
);
if
(
reCompile
(
&
comment2RE
,
comment2REString
,
&
line
,
&
lineBufSize
))
exit
(
EXIT_FAILURE
);
}
/* compile documentation comment regular expression */
{
static
const
char
docCommentREString
[]
=
"^"
WS
"*/
\\
*"
WS
"*"
SYMRE
":("
WS
"*).*"
NWS
"("
WS
"*)
\\
*/"
;
static
const
char
doc
Line
CommentREString
[]
=
"^"
WS
"*//"
WS
"*"
SYMRE
":("
WS
"*).*"
NWS
"("
WS
"*)"
;
static
const
char
docCommentREString
[]
=
"^"
WS
"*/
\\
*"
WS
"*"
SYMRE
":("
WS
"*).*"
NWS
"("
WS
"*)
\\
*/"
;
static
const
char
docComment
2
REString
[]
=
"^"
WS
"*//"
WS
"*"
SYMRE
":("
WS
"*).*"
NWS
"("
WS
"*)"
;
if
(
reCompile
(
&
docCommentRE
,
docCommentREString
,
&
line
,
&
lineBufSize
))
exit
(
EXIT_FAILURE
);
if
(
reCompile
(
&
doc
Line
CommentRE
,
doc
Line
CommentREString
,
&
line
,
&
lineBufSize
))
if
(
reCompile
(
&
docComment
2
RE
,
docComment
2
REString
,
&
line
,
&
lineBufSize
))
exit
(
EXIT_FAILURE
);
}
regex_t
cppCondRE
;
...
...
@@ -525,8 +522,7 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
if
(
!
innerParens
)
{
funcargc
++
;
funcargname
[
funcargc
].
rm_so
=
(
regoff_t
)(
pline
-
line
+
i
+
1
);
funcargname
[
funcargc
].
rm_so
=
(
regoff_t
)(
pline
-
line
+
i
+
1
);
}
break
;
case
'('
:
...
...
@@ -536,8 +532,7 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
if
(
!
innerParens
)
{
funcargc
++
;
funcargname
[
funcargc
].
rm_so
=
(
regoff_t
)(
pline
-
line
+
i
+
1
);
funcargname
[
funcargc
].
rm_so
=
(
regoff_t
)(
pline
-
line
+
i
+
1
);
goto
endOfArgSearch
;
}
else
...
...
@@ -565,10 +560,8 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
/* test if argument list is actually empty */
if
(
funcargc
==
1
&&
!
regexec
(
&
emptyStringRE
,
line
+
funcargname
[
0
].
rm_so
,
1
,
reMatch
,
0
)
&&
(
funcargname
[
0
].
rm_so
+
reMatch
[
0
].
rm_eo
==
funcargname
[
funcargc
].
rm_so
-
1
))
&&
!
regexec
(
&
emptyStringRE
,
line
+
funcargname
[
0
].
rm_so
,
1
,
reMatch
,
0
)
&&
(
funcargname
[
0
].
rm_so
+
reMatch
[
0
].
rm_eo
==
funcargname
[
funcargc
].
rm_so
-
1
))
{
funcargc
=
0
;
}
...
...
@@ -579,11 +572,8 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
pline
=
line
+
funcargname
[
i
].
rm_so
;
int
argtype
;
const
regoff_t
argStart
=
(
regoff_t
)(
pline
-
line
);
for
(
argtype
=
ISVOID
;
argtype
<
NUM_KNOWN_ARG_TYPES
;
++
argtype
)
if
(
!
regexec
(
&
funArgSym
[
argtype
].
preg
,
pline
,
maxMatch
,
reMatch
,
0
))
for
(
argtype
=
ISVOID
;
argtype
<
NUM_KNOWN_ARG_TYPES
;
++
argtype
)
if
(
!
regexec
(
&
funArgSym
[
argtype
].
preg
,
pline
,
maxMatch
,
reMatch
,
0
))
{
funcargtype
[
i
]
=
argtype
;
funcargfull
[
i
].
rm_so
=
reMatch
[
0
].
rm_so
+
argStart
;
...
...
@@ -591,10 +581,8 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
regmatch_t
*
nameMatch
=
reMatch
+
funArgSym
[
argtype
].
nameMatch
;
funcargname
[
i
].
rm_so
=
nameMatch
->
rm_so
+
argStart
;
funcargname
[
i
].
rm_eo
=
nameMatch
->
rm_eo
+
argStart
;
needsExtraWrapper
=
needsExtraWrapper
||
funArgSym
[
argtype
].
needsExtraWrapper
;
needsPrologue
=
needsPrologue
||
funArgSym
[
argtype
].
needsPrologue
;
needsExtraWrapper
=
needsExtraWrapper
||
funArgSym
[
argtype
].
needsExtraWrapper
;
needsPrologue
=
needsPrologue
||
funArgSym
[
argtype
].
needsPrologue
;
break
;
}
if
(
argtype
==
NUM_KNOWN_ARG_TYPES
)
...
...
@@ -636,12 +624,10 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
argDimsF
[
0
]
=
0
;
else
sprintFortranArrayArgDims
(
argDimsFSize
,
argDimsF
,
argType
,
line
+
funcargfull
[
i
].
rm_so
,
maxMatch
,
reMatch
);
line
+
funcargfull
[
i
].
rm_so
,
maxMatch
,
reMatch
);
fprintf
(
fpinc
,
"%-16s%.*s%s"
,
funArgSym
[
argType
].
f77name
,
(
int
)(
funcargname
[
i
].
rm_eo
-
funcargname
[
i
].
rm_so
),
line
+
funcargname
[
i
].
rm_so
,
argDimsF
);
line
+
funcargname
[
i
].
rm_so
,
argDimsF
);
}
if
(
funcargc
)
fprintf
(
fpinc
,
")
\n
"
);
...
...
@@ -901,15 +887,11 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint,
argDimsF
[
0
]
=
0
;