Commit 7183a20f authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Keep some preprocessor conditional in the Fortran interface output.

parent 9971a8b2
......@@ -218,23 +218,23 @@ extern "C" {
# include <yaxt.h>
#endif
#ifdef MPI_VERSION
#ifdef MPI_VERSION /* make_fint keep */
void pioEndDef ( void );
void pioEndTimestepping ( void );
void pioFinalize ( void );
/* pioInit: initialize I/O server processes and communication */
MPI_Comm pioInit(MPI_Comm commSuper, int nProcsIO, int IOMode, int nNamespaces,
int *hasLocalFile, float partInflate);
int pioInqVarDecoChunk ( int, int );
int pioInqVarDecoOff ( int, int );
void pioNamespaceSetActive ( int );
void pioWriteTimestep ( int, int, int );
void streamWriteVarPart (int streamID, int varID, int memtype,
const void *data, int nmiss,
Xt_idxlist partDesc);
#endif
#endif /* make_fint keep */
int pioInqVarDecoChunk ( int, int );
int pioInqVarDecoOff ( int, int );
void pioNamespaceSetActive ( int );
/* CDI control routines */
......
......@@ -4,7 +4,7 @@
!
! Author:
! -------
! Uwe Schulzweida, MPI-MET, Hamburg, January 2013
! Uwe Schulzweida, MPI-MET, Hamburg, March 2013
!
INTEGER CDI_MAX_NAME
......@@ -370,20 +370,6 @@
! REAL partInflate)
EXTERNAL pioInit
INTEGER pioInqVarDecoChunk
! (INTEGER ,
! INTEGER )
EXTERNAL pioInqVarDecoChunk
INTEGER pioInqVarDecoOff
! (INTEGER ,
! INTEGER )
EXTERNAL pioInqVarDecoOff
! pioNamespaceSetActive
! (INTEGER )
EXTERNAL pioNamespaceSetActive
! pioWriteTimestep
! (INTEGER ,
! INTEGER ,
......@@ -399,6 +385,20 @@
! TYPE(XT_IDXLIST)partDesc)
EXTERNAL streamWriteVarPart
INTEGER pioInqVarDecoChunk
! (INTEGER ,
! INTEGER )
EXTERNAL pioInqVarDecoChunk
INTEGER pioInqVarDecoOff
! (INTEGER ,
! INTEGER )
EXTERNAL pioInqVarDecoOff
! pioNamespaceSetActive
! (INTEGER )
EXTERNAL pioNamespaceSetActive
!
! CDI control routines
!
......
......@@ -68,6 +68,7 @@
/* parallel IO routines */
#ifdef MPI_VERSION /* make_fint keep */
FCALLSCSUB0 (pioEndDef, PIOENDDEF, pioenddef)
FCALLSCSUB0 (pioEndTimestepping, PIOENDTIMESTEPPING, pioendtimestepping)
FCALLSCSUB0 (pioFinalize, PIOFINALIZE, piofinalize)
......@@ -78,15 +79,16 @@ static int pioInit_fwrap(int commSuper, int nProcsIO, int IOMode, int nNamespace
return MPI_Comm_c2f(v);
}
FCALLSCFUN6 (INT, pioInit_fwrap, PIOINIT, pioinit, INT, INT, INT, INT, PINT, FLOAT)
FCALLSCFUN2 (INT, pioInqVarDecoChunk, PIOINQVARDECOCHUNK, pioinqvardecochunk, INT, INT)
FCALLSCFUN2 (INT, pioInqVarDecoOff, PIOINQVARDECOOFF, pioinqvardecooff, INT, INT)
FCALLSCSUB1 (pioNamespaceSetActive, PIONAMESPACESETACTIVE, pionamespacesetactive, INT)
FCALLSCSUB3 (pioWriteTimestep, PIOWRITETIMESTEP, piowritetimestep, INT, INT, INT)
static void streamWriteVarPart_fwrap(int streamID, int varID, int memtype, const void * data, int nmiss, void * partDesc)
{
streamWriteVarPart( streamID, varID, memtype, data, nmiss, (*(Xt_idxlist *)partDesc));
}
FCALLSCSUB6 (streamWriteVarPart_fwrap, STREAMWRITEVARPART, streamwritevarpart, INT, INT, INT, PVOID, INT, PVOID)
#endif /* make_fint keep */
FCALLSCFUN2 (INT, pioInqVarDecoChunk, PIOINQVARDECOCHUNK, pioinqvardecochunk, INT, INT)
FCALLSCFUN2 (INT, pioInqVarDecoOff, PIOINQVARDECOOFF, pioinqvardecooff, INT, INT)
FCALLSCSUB1 (pioNamespaceSetActive, PIONAMESPACESETACTIVE, pionamespacesetactive, INT)
/* CDI control routines */
......
......@@ -230,6 +230,16 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint)
if (reCompile(&docCommentRE, docCommentREString, &line, &lineBufSize))
exit(EXIT_FAILURE);
}
/* compile keep-conditional regular expression */
/* if(n)def and endif preprocessor conditionals followed by
make_fint keep are copied to the Fortran interface file */
regex_t cppCondRE;
{
static const char cppCondREString[]
= "^"WS"*#"WS"*(ifn?def"WS"+"SYMRE"|endif)"WS"+/\\*"WS"*make_fint keep"WS"*\\*/";
if (reCompile(&cppCondRE, cppCondREString, &line, &lineBufSize))
exit(EXIT_FAILURE);
}
/* fortran include */
fprintf(fpinc, "! This file was automatically generated, don't edit!\n");
......@@ -598,6 +608,11 @@ static void fortran_interface(char *fname, char *fnameinc, char *fnameint)
" PARAMETER (%-22s = %2d)\n", parname, parname,
parvalue);
}
else if (!regexec(&cppCondRE, line, maxMatch, reMatch, 0))
{
/* fortran include */
fputs(line, fpint);
}
else if (!regexec(&docCommentRE, line, maxMatch, reMatch, 0))
{
/* found documentation comment */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment