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 #ifndef CH_MULTIDIM
00015 #ifdef CH_FORT_UPPERCASE
00016 #ifdef CH_FORT_UNDERSCORE
00017 #define FORTRAN_NAME( NAME ,name ) NAME ## _
00018 #else
00019 #define FORTRAN_NAME( NAME ,name ) NAME
00020 #endif
00021 #else
00022 #ifdef CH_FORT_UNDERSCORE
00023 #define FORTRAN_NAME( NAME ,name ) name ## _
00024 #else
00025 #define FORTRAN_NAME( NAME ,name ) name
00026 #endif
00027 #endif
00028 #else
00029 #ifndef LAST_MULTIDIM_FortranNameMacro_SPACEDIM
00030 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 0
00031 #endif
00032 #if CH_SPACEDIM != LAST_MULTIDIM_FortranNameMacro_SPACEDIM
00033 #undef LAST_MULTIDIM_FortranNameMacro_SPACEDIM
00034 #ifdef FORTRAN_NAME
00035 #undef FORTRAN_NAME
00036 #endif
00037 #if CH_SPACEDIM == 0
00038 #elif CH_SPACEDIM == 1
00039 #ifdef CH_FORT_UPPERCASE
00040 #ifdef CH_FORT_UNDERSCORE
00041 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 1d_
00042 #else
00043 #define FORTRAN_NAME( NAME ,name ) NAME ## 1d
00044 #endif
00045 #else
00046 #ifdef CH_FORT_UNDERSCORE
00047 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 1d_
00048 #else
00049 #define FORTRAN_NAME( NAME ,name ) name ## 1d
00050 #endif
00051 #endif
00052 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 1
00053 #elif CH_SPACEDIM == 2
00054 #ifdef CH_FORT_UPPERCASE
00055 #ifdef CH_FORT_UNDERSCORE
00056 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 2d_
00057 #else
00058 #define FORTRAN_NAME( NAME ,name ) NAME ## 2d
00059 #endif
00060 #else
00061 #ifdef CH_FORT_UNDERSCORE
00062 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 2d_
00063 #else
00064 #define FORTRAN_NAME( NAME ,name ) name ## 2d
00065 #endif
00066 #endif
00067 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 2
00068 #elif CH_SPACEDIM == 3
00069 #ifdef CH_FORT_UPPERCASE
00070 #ifdef CH_FORT_UNDERSCORE
00071 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 3d_
00072 #else
00073 #define FORTRAN_NAME( NAME ,name ) NAME ## 3d
00074 #endif
00075 #else
00076 #ifdef CH_FORT_UNDERSCORE
00077 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 3d_
00078 #else
00079 #define FORTRAN_NAME( NAME ,name ) name ## 3d
00080 #endif
00081 #endif
00082 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 3
00083 #elif CH_SPACEDIM == 4
00084 #ifdef CH_FORT_UPPERCASE
00085 #ifdef CH_FORT_UNDERSCORE
00086 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 4d_
00087 #else
00088 #define FORTRAN_NAME( NAME ,name ) NAME ## 4d
00089 #endif
00090 #else
00091 #ifdef CH_FORT_UNDERSCORE
00092 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 4d_
00093 #else
00094 #define FORTRAN_NAME( NAME ,name ) name ## 4d
00095 #endif
00096 #endif
00097 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 4
00098 #elif CH_SPACEDIM == 5
00099 #ifdef CH_FORT_UPPERCASE
00100 #ifdef CH_FORT_UNDERSCORE
00101 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 5d_
00102 #else
00103 #define FORTRAN_NAME( NAME ,name ) NAME ## 5d
00104 #endif
00105 #else
00106 #ifdef CH_FORT_UNDERSCORE
00107 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 5d_
00108 #else
00109 #define FORTRAN_NAME( NAME ,name ) name ## 5d
00110 #endif
00111 #endif
00112 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 5
00113 #elif CH_SPACEDIM == 6
00114 #ifdef CH_FORT_UPPERCASE
00115 #ifdef CH_FORT_UNDERSCORE
00116 #define FORTRAN_NAME( NAME ,name ) NAME ## _ ## 6d_
00117 #else
00118 #define FORTRAN_NAME( NAME ,name ) NAME ## 6d
00119 #endif
00120 #else
00121 #ifdef CH_FORT_UNDERSCORE
00122 #define FORTRAN_NAME( NAME ,name ) name ## _ ## 6d_
00123 #else
00124 #define FORTRAN_NAME( NAME ,name ) name ## 6d
00125 #endif
00126 #endif
00127 #define LAST_MULTIDIM_FortranNameMacro_SPACEDIM 6
00128 #else
00129 Fail now: CH_SPACEDIM must be 1, 2, 3, 4, 5 or 6.
00130 #endif
00131 #endif
00132 #endif
00133
00134 #endif