00001 /**********************************************************************/ 00002 00003 /* Copyright 2006-2010, NEC Europe Ltd., London, UK. */ 00004 /* All rights reserved. Use is subject to OASIS4 license terms. */ 00005 00006 /********************************************************************** 00007 00008 !---------------------------------------------------------------------- 00009 !BOP 00010 ! 00011 ! !INCLUDE: mpp_f2c.h 00012 ! 00013 ! !DESCRIPTION: 00014 ! 00015 Include file of C-Interface of PSMILe Library: 00016 00017 This include-file contains the installation dependent definitions 00018 of the FORTRAN to C-Interface of the PSMILe Library. 00019 00020 ! !REVISION HISTORY: 00021 ! 00022 ! Date Programmer Description 00023 ! ---------- ---------- ----------- 00024 ! 01.12.03 H. Ritzdorf created 00025 ! 00026 !EOP 00027 !----------------------------------------------------------------------- 00028 00029 ---------------------------------------------------------------------- 00030 00031 $Id: mpp_f2c.h 922 2006-04-20 14:34:55Z valcke $ 00032 00033 ***********************************************************************/ 00034 00035 /* ===================================================================== 00036 Definitions of Variables used in the Interface between Fortran and C 00037 00038 INTEGER : Corresponding type to Fortran type integer 00039 REAL : Corresponding type to Fortran type real 00040 00041 LONG_INT_C : C type which corresponds to the Fortran type 00042 LONG_INT_F. 00043 LONG_INT_F must be large enough to store relative 00044 addresses which are pointers to allocated buffers. 00045 ===================================================================== */ 00046 00047 #ifndef INTEGER 00048 # if defined ( PRISM_EXTENDED_WIDTH ) 00049 /* Fortran INTEGER corresponds to C's long long */ 00050 # define INTEGER long long 00051 # else 00052 # define INTEGER int 00053 # endif 00054 #endif /* INTEGER */ 00055 00056 #ifndef REAL 00057 # if defined ( PRISM_EXTENDED_WIDTH ) 00058 /* Fortran REAL corresponds to C's double */ 00059 # define REAL double 00060 # else 00061 # define REAL float 00062 # endif 00063 #endif /* REAL */ 00064 00065 #ifndef LONG_INT_C 00066 # if defined (POINTER_64_BITS) 00067 # define LONG_INT_C long long 00068 # else 00069 # define LONG_INT_C INTEGER 00070 # endif 00071 #endif 00072 00073 #ifndef MALLOC 00074 00075 # define MALLOC(size) malloc ((size_t) size) 00076 # define FREE(ptr) free (ptr) 00077 00078 #endif /* MALLOC */ 00079 00080 #ifdef PRISM_ASSERTION 00081 # undef ASSERT 00082 #ifdef __ANSI_CPP__ 00083 # define ASSERT(c) \ 00084 if (!(c)) {\ 00085 fprintf(stderr, "### Assertion violation: %s in %s:%d\n",\ 00086 #c, __FILE__, __LINE__);\ 00087 abort ();\ 00088 } 00089 #else 00090 # define ASSERT(c) \ 00091 if (!(c)) {\ 00092 fprintf(stderr, "### Assertion violation: %s in %s:%d\n",\ 00093 "expression", __FILE__, __LINE__);\ 00094 abort ();\ 00095 } 00096 #endif /* __ANSI_CPP__ */ 00097 00098 #else 00099 00100 # define ASSERT(c) 00101 00102 #endif /* PRISM_ASSERTION */ 00103 00104 /* ===================================================================== 00105 Names of C-Routines which are called by FORTRAN routines 00106 ===================================================================== */ 00107 00108 #if defined (FORTRANUNDERSCORE) 00109 00110 # define mpp_flushstd mpp_flushstd_ 00111 00112 #elif defined (FORTRANCAPS) 00113 00114 # define mpp_flushstd MPP_FLUSHSTD 00115 00116 #elif defined (FORTRANDOUBLEUNDERSCORE) 00117 00118 # define mpp_flushstd mpp_flushstd__ 00119 00120 #endif 00121 00122 /* ===================================================================== 00123 Interface description of C routines 00124 ===================================================================== */ 00125 00126 /* Utilities for standard I/O */ 00127 00128 void mpp_flushstd (void);