00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _FORTRANNAMEMACRO_H_
00012 #define _FORTRANNAMEMACRO_H_
00013
00014 #ifdef CH_FORT_UPPERCASE
00015 #ifdef CH_FORT_UNDERSCORE
00016 #define FORTRAN_BASENAME( NAME ,name ) NAME ## _
00017 #ifdef CH_USE_DOUBLE
00018 #define LAPACK(NAME, name) d ## NAME ## _
00019 #else
00020 #define LAPACK(NAME, name) s ## NAME ## _
00021 #endif
00022 #else
00023 #define FORTRAN_BASENAME( NAME ,name ) NAME
00024 #ifdef CH_USE_DOUBLE
00025 #define LAPACK(NAME, name) d ## NAME
00026 #else
00027 #define LAPACK(NAME, name) s ## NAME
00028 #endif
00029 #endif
00030 #else
00031 #ifdef CH_FORT_UNDERSCORE
00032 #define FORTRAN_BASENAME( NAME ,name ) name ## _
00033 #ifdef CH_USE_DOUBLE
00034 #define LAPACK(NAME, name) d ## name ## _
00035 #else
00036 #define LAPACK(NAME, name) s ## name ## _
00037 #endif
00038 #else
00039 #define FORTRAN_BASENAME( NAME ,name ) name
00040 #ifdef CH_USE_DOUBLE
00041 #define LAPACK(NAME, name) d ## name
00042 #else
00043 #define LAPACK(NAME, name) s ## name
00044 #endif
00045 #endif
00046 #endif
00047
00048
00049
00050 #ifndef CH_MULTIDIM
00051 #ifdef CH_FORT_UPPERCASE
00052 #ifdef CH_FORT_UNDERSCORE
00053 #define FORTRAN_NAME( NAME ,name ) NAME ## _
00054 #else
00055 #define FORTRAN_NAME( NAME ,name ) NAME
00056 #endif
00057 #else
00058 #ifdef CH_FORT_UNDERSCORE
00059 #define FORTRAN_NAME( NAME ,name ) name ## _
00060 #else
00061 #define FORTRAN_NAME( NAME ,name ) name
00062 #endif
00063 #endif
00064 #else
00065 #ifndef LAST_MULTIDIM_FortranNameMacro_SPACEDIM
00066 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 0
00067 #endif
00068 #if CH_SPACEDIM != LAST_MULTIDIM_FortranNameMacro_SPACEDIM
00069 #undef LAST_MULTIDIM_FortranNameMacro_SPACEDIM
00070 #ifdef FORTRAN_NAME
00071 #undef FORTRAN_NAME
00072 #endif
00073 #if CH_SPACEDIM == 0
00074 #elif CH_SPACEDIM == 1
00075 #ifdef CH_FORT_UPPERCASE
00076 #ifdef CH_FORT_UNDERSCORE
00077 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 1d_
00078 #else
00079 #define FORTRAN_NAME( NAME ,name ) NAME ## 1d
00080 #endif
00081 #else
00082 #ifdef CH_FORT_UNDERSCORE
00083 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 1d_
00084 #else
00085 #define FORTRAN_NAME( NAME ,name ) name ## 1d
00086 #endif
00087 #endif
00088 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 1
00089 #elif CH_SPACEDIM == 2
00090 #ifdef CH_FORT_UPPERCASE
00091 #ifdef CH_FORT_UNDERSCORE
00092 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 2d_
00093 #else
00094 #define FORTRAN_NAME( NAME ,name ) NAME ## 2d
00095 #endif
00096 #else
00097 #ifdef CH_FORT_UNDERSCORE
00098 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 2d_
00099 #else
00100 #define FORTRAN_NAME( NAME ,name ) name ## 2d
00101 #endif
00102 #endif
00103 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 2
00104 #elif CH_SPACEDIM == 3
00105 #ifdef CH_FORT_UPPERCASE
00106 #ifdef CH_FORT_UNDERSCORE
00107 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 3d_
00108 #else
00109 #define FORTRAN_NAME( NAME ,name ) NAME ## 3d
00110 #endif
00111 #else
00112 #ifdef CH_FORT_UNDERSCORE
00113 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 3d_
00114 #else
00115 #define FORTRAN_NAME( NAME ,name ) name ## 3d
00116 #endif
00117 #endif
00118 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 3
00119 #elif CH_SPACEDIM == 4
00120 #ifdef CH_FORT_UPPERCASE
00121 #ifdef CH_FORT_UNDERSCORE
00122 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 4d_
00123 #else
00124 #define FORTRAN_NAME( NAME ,name ) NAME ## 4d
00125 #endif
00126 #else
00127 #ifdef CH_FORT_UNDERSCORE
00128 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 4d_
00129 #else
00130 #define FORTRAN_NAME( NAME ,name ) name ## 4d
00131 #endif
00132 #endif
00133 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 4
00134 #elif CH_SPACEDIM == 5
00135 #ifdef CH_FORT_UPPERCASE
00136 #ifdef CH_FORT_UNDERSCORE
00137 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 5d_
00138 #else
00139 #define FORTRAN_NAME( NAME ,name ) NAME ## 5d
00140 #endif
00141 #else
00142 #ifdef CH_FORT_UNDERSCORE
00143 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 5d_
00144 #else
00145 #define FORTRAN_NAME( NAME ,name ) name ## 5d
00146 #endif
00147 #endif
00148 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 5
00149 #elif CH_SPACEDIM == 6
00150 #ifdef CH_FORT_UPPERCASE
00151 #ifdef CH_FORT_UNDERSCORE
00152 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 6d_
00153 #else
00154 #define FORTRAN_NAME( NAME ,name ) NAME ## 6d
00155 #endif
00156 #else
00157 #ifdef CH_FORT_UNDERSCORE
00158 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 6d_
00159 #else
00160 #define FORTRAN_NAME( NAME ,name ) name ## 6d
00161 #endif
00162 #endif
00163 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 6
00164 #else
00165 Fail now: CH_SPACEDIM must be 1, 2, 3, 4, 5 or 6.
00166 #endif
00167 #endif
00168 #endif
00169
00170 #endif