Commit 25681428 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

update fortran interface

parent 4dc30eca
! This file was automatically generated, don't edit!
!
! Fortran interface for CDI library version 1.5.4
! Fortran interface for CDI library version 1.5.5rc1
!
! Author:
! -------
! Uwe Schulzweida, MPI-MET, Hamburg, January 2012
! Uwe Schulzweida, MPI-MET, Hamburg, April 2012
!
INTEGER CDI_MAX_NAME
......@@ -509,6 +509,20 @@
! INTEGER nmiss)
EXTERNAL streamWriteVar
! streamWriteVarDouble
! (INTEGER streamID,
! INTEGER varID,
! DOUBLEPRECISION data_vec,
! INTEGER nmiss)
EXTERNAL streamWriteVarDouble
! streamWriteVarFloat
! (INTEGER streamID,
! INTEGER varID,
! REAL data_vec,
! INTEGER nmiss)
EXTERNAL streamWriteVarFloat
! streamReadVarSlice
! (INTEGER streamID,
! INTEGER varID,
......@@ -525,6 +539,22 @@
! INTEGER nmiss)
EXTERNAL streamWriteVarSlice
! streamWriteVarSliceDouble
! (INTEGER streamID,
! INTEGER varID,
! INTEGER levelID,
! DOUBLEPRECISION data_vec,
! INTEGER nmiss)
EXTERNAL streamWriteVarSliceDouble
! streamWriteVarSliceFloat
! (INTEGER streamID,
! INTEGER varID,
! INTEGER levelID,
! REAL data_vec,
! INTEGER nmiss)
EXTERNAL streamWriteVarSliceFloat
!
! STREAM record I/O routines
!
......@@ -552,11 +582,29 @@
! INTEGER nmiss)
EXTERNAL streamWriteRecord
! streamWriteRecordDouble
! (INTEGER streamID,
! DOUBLEPRECISION data_vec,
! INTEGER nmiss)
EXTERNAL streamWriteRecordDouble
! streamWriteRecordFloat
! (INTEGER streamID,
! REAL data_vec,
! INTEGER nmiss)
EXTERNAL streamWriteRecordFloat
! streamCopyRecord
! (INTEGER streamIDdest,
! INTEGER streamIDsrc)
EXTERNAL streamCopyRecord
! streamInqGinfo
! (INTEGER streamID,
! INTEGER intnum,
! REAL fltnum)
EXTERNAL streamInqGinfo
!
! VLIST routines
!
......
......@@ -103,8 +103,12 @@ FCALLSCFUN1 (INT, streamNtsteps, STREAMNTSTEPS, streamntsteps, INT)
FCALLSCSUB4 (streamReadVar, STREAMREADVAR, streamreadvar, INT, INT, PDOUBLE, PINT)
FCALLSCSUB4 (streamWriteVar, STREAMWRITEVAR, streamwritevar, INT, INT, PDOUBLE, INT)
FCALLSCSUB4 (streamWriteVarDouble, STREAMWRITEVARDOUBLE, streamwritevardouble, INT, INT, PDOUBLE, INT)
FCALLSCSUB4 (streamWriteVarFloat, STREAMWRITEVARFLOAT, streamwritevarfloat, INT, INT, PFLOAT, INT)
FCALLSCSUB5 (streamReadVarSlice, STREAMREADVARSLICE, streamreadvarslice, INT, INT, INT, PDOUBLE, PINT)
FCALLSCSUB5 (streamWriteVarSlice, STREAMWRITEVARSLICE, streamwritevarslice, INT, INT, INT, PDOUBLE, INT)
FCALLSCSUB5 (streamWriteVarSliceDouble, STREAMWRITEVARSLICEDOUBLE, streamwritevarslicedouble, INT, INT, INT, PDOUBLE, INT)
FCALLSCSUB5 (streamWriteVarSliceFloat, STREAMWRITEVARSLICEFLOAT, streamwritevarslicefloat, INT, INT, INT, PFLOAT, INT)
/* STREAM record I/O routines */
......@@ -112,7 +116,10 @@ FCALLSCSUB3 (streamInqRecord, STREAMINQRECORD, streaminqrecord, INT, PINT, PINT)
FCALLSCSUB3 (streamDefRecord, STREAMDEFRECORD, streamdefrecord, INT, INT, INT)
FCALLSCSUB3 (streamReadRecord, STREAMREADRECORD, streamreadrecord, INT, PDOUBLE, PINT)
FCALLSCSUB3 (streamWriteRecord, STREAMWRITERECORD, streamwriterecord, INT, PDOUBLE, INT)
FCALLSCSUB3 (streamWriteRecordDouble, STREAMWRITERECORDDOUBLE, streamwriterecorddouble, INT, PDOUBLE, INT)
FCALLSCSUB3 (streamWriteRecordFloat, STREAMWRITERECORDFLOAT, streamwriterecordfloat, INT, PFLOAT, INT)
FCALLSCSUB2 (streamCopyRecord, STREAMCOPYRECORD, streamcopyrecord, INT, INT)
FCALLSCSUB3 (streamInqGinfo, STREAMINQGINFO, streaminqginfo, INT, PINT, PFLOAT)
/* VLIST routines */
......
......@@ -72,10 +72,10 @@ void fortran_interface(char *fname, char *fnameinc, char *fnameint)
int i, ii;
int lineno = 0;
size_t linelen, len;
enum {ISVOID, ISSTRING, ISSTRINGP, ISINT, ISINTP, ISREAL, ISDOUBLE, ISDOUBLEP, ISCONSTSTRING};
char *f77name[] = {"", "CHARACTER*(*)", "CHARACTER*(*)", "INTEGER", "INTEGER", "REAL", "DOUBLEPRECISION", "DOUBLEPRECISION", "CHARACTER*80"};
char *cfint[] = {"", "STRING", "PSTRING", "INT", "PINT", "FLOAT", "DOUBLE", "PDOUBLE", "STRING"};
char *cname[] = {"void", "char *", "char *", "int", "int *", "float", "double", "double *", "char *"};
enum {ISVOID, ISSTRING, ISSTRINGP, ISINT, ISINTP, ISREAL, ISREALP, ISDOUBLE, ISDOUBLEP, ISCONSTSTRING};
char *f77name[] = {"", "CHARACTER*(*)", "CHARACTER*(*)", "INTEGER", "INTEGER", "REAL", "REAL", "DOUBLEPRECISION", "DOUBLEPRECISION", "CHARACTER*80"};
char *cfint[] = {"", "STRING", "PSTRING", "INT", "PINT", "FLOAT", "PFLOAT", "DOUBLE", "PDOUBLE", "STRING"};
char *cname[] = {"void", "char *", "char *", "int", "int *", "float", "float *", "double", "double *", "char *"};
char funcname[128];
char *funcargname[20];
int funcargtype[20];
......@@ -187,6 +187,16 @@ void fortran_interface(char *fname, char *fnameinc, char *fnameint)
functype = ISDOUBLE;
pline += 6;
}
else if ( memcmp(line, "float*", 6) == 0 )
{
printf("skip: line %3d float *\n", lineno);
continue;
}
else if ( memcmp(line, "float", 5) == 0 )
{
functype = ISREAL;
pline += 5;
}
else if ( memcmp(line, "char*", 5) == 0 )
{
functype = ISCONSTSTRING;
......@@ -284,6 +294,18 @@ void fortran_interface(char *fname, char *fnameinc, char *fnameint)
funcargtype[i] = ISDOUBLE;
funcargname[i] = pline;
}
else if ( memcmp(pline, "float*", 6) == 0 )
{
pline += 6;
funcargtype[i] = ISREALP;
funcargname[i] = pline;
}
else if ( memcmp(pline, "float", 5) == 0 )
{
pline += 5;
funcargtype[i] = ISREAL;
funcargname[i] = pline;
}
else
{
printf("%s not implemented\n", funcargname[i]);
......
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