Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
00001 /* 00002 00003 Copyright (C) 2000, 2001, Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2.1 of the GNU Lesser General Public License 00007 as published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU Lesser General Public 00021 License along with this program; if not, write the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, 00023 USA. 00024 00025 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00026 Mountain View, CA 94043, or: 00027 00028 http://www.sgi.com 00029 00030 For further information regarding this notice, see: 00031 00032 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00033 00034 */ 00035 00036 00037 00038 #pragma ident "@(#) libf/fio/tables.c 92.2 06/18/99 18:41:02" 00039 00040 /* 00041 * tables.c - This module contains tables and structures with 00042 * constant data. 00043 */ 00044 00045 #include <foreign.h> 00046 #include <fortran.h> 00047 #include <cray/dopevec.h> 00048 #include <cray/mtlock.h> /* For SHARED_CC_BUG_WORKAROUND */ 00049 #include "fio.h" 00050 00051 /* 00052 * _f77_to_f90_type_cnvt[] 00053 * Table which converts a Fortran 77 type code to a Fortran 90 00054 * type code. 00055 */ 00056 00057 const ftype_t 00058 _f77_to_f90_type_cnvt[DT_MAX] = { 00059 DVTYPE_TYPELESS, /* DT_NONE Typeless */ 00060 DVTYPE_INTEGER, /* DT_INT Integer */ 00061 DVTYPE_REAL, /* DT_REAL Real */ 00062 DVTYPE_REAL, /* DT_DBLE Double precision*/ 00063 DVTYPE_COMPLEX, /* DT_CMPLX Complex */ 00064 DVTYPE_LOGICAL, /* DT_LOG Logical */ 00065 DVTYPE_ASCII, /* DT_CHAR Character */ 00066 DVTYPE_INTEGER, /* DT_SINT Short integer */ 00067 DVTYPE_COMPLEX /* DT_DBLCOM Complex */ 00068 }; 00069 00070 /* 00071 * _f90_to_f77_type_cnvt[] 00072 * Table which converts a Fortran 90 type code to a Fortran 77 00073 * type code. 00074 */ 00075 00076 const short 00077 _f90_to_f77_type_cnvt[DVTYPE_NTYPES] = { 00078 -1, /* DVTYPE_UNUSED Unused */ 00079 DT_NONE, /* DVTYPE_TYPELESS Typeless */ 00080 DT_INT, /* DVTYPE_INTEGER Integer */ 00081 DT_REAL, /* DVTYPE_REAL Real */ 00082 DT_CMPLX, /* DVTYPE_COMPLEX Complex */ 00083 DT_LOG, /* DVTYPE_LOGICAL Logical */ 00084 DT_CHAR, /* DVTYPE_ASCII Character */ 00085 -1, /* DVTYPE_DERIVEDBYTE Unused */ 00086 -1 /* DVTYPE_DERIVEDWORD Unused */ 00087 }; 00088 00089 /* 00090 * _f77_type_len[] 00091 * Table containing the byte size of each Fortran 77 data type, 00092 * indexed by the Fortran 77 data type code. 00093 */ 00094 00095 const short 00096 _f77_type_len[DT_MAX] = { 00097 sizeof(long), /* DT_NONE Typeless */ 00098 sizeof(_f_int), /* DT_INT Integer */ 00099 sizeof(_f_real), /* DT_REAL Real */ 00100 sizeof(_f_real) * 2, /* DT_DBLE Double precision*/ 00101 sizeof(_f_real) * 2, /* DT_CMPLX Complex */ 00102 sizeof(_f_log), /* DT_LOG Logical */ 00103 sizeof(char), /* DT_CHAR Character */ 00104 #ifdef _CRAYT3E 00105 sizeof(_f_int4), /* DT_SINT Short integer */ 00106 #else 00107 sizeof(_f_int), /* DT_SINT Short integer */ 00108 #endif 00109 sizeof(_f_real) * 4 /* DT_DBLCOM Double complex */ 00110 }; 00111 00112 /* 00113 * _f90_type_name[] 00114 * Table containing the name of each Fortran 90 data type, 00115 * indexed by the Fortran 90 data type code. 00116 */ 00117 00118 const char * 00119 _f90_type_name[DVTYPE_NTYPES] = { 00120 NULL, /* DVTYPE_UNUSED Unused */ 00121 "boolean", /* DVTYPE_TYPELESS Typeless */ 00122 "INTEGER", /* DVTYPE_INTEGER Integer */ 00123 "REAL", /* DVTYPE_REAL Real */ 00124 "COMPLEX", /* DVTYPE_COMPLEX Complex */ 00125 "LOGICAL", /* DVTYPE_LOGICAL Logical */ 00126 "CHARACTER", /* DVTYPE_ASCII Character */ 00127 NULL, /* DVTYPE_DERIVEDBYTE Unused */ 00128 NULL /* DVTYPE_DERIVEDWORD Unused */ 00129 }; 00130 00131 /* 00132 * _f77_type_name[] 00133 * Table containing the name of each Fortran 77 data type, 00134 * indexed by the Fortran 77 data type code. 00135 */ 00136 00137 const char * 00138 _f77_type_name[DT_MAX] = { 00139 "Typeless", /* DT_NONE Typeless */ 00140 "INTEGER", /* DT_INT Integer */ 00141 "REAL", /* DT_REAL Real */ 00142 "DOUBLE PRECISION", /* DT_DBLE Double precision*/ 00143 "COMPLEX", /* DT_CMPLX Complex */ 00144 "LOGICAL", /* DT_LOG Logical */ 00145 "CHARACTER", /* DT_CHAR Character */ 00146 "Short INTEGER", /* DT_SINT Short integer */ 00147 "Double Complex" /* DT_DBLCOM Double Complex */ 00148 }; 00149 00150 /* 00151 * _charset_cnvt[] 00152 * Table which maps a character conversion code into the 00153 * corresponding general numeric data conversion type. 00154 */ 00155 00156 const short 00157 _charset_cnvt[CS_MAX] = {0, 0, NCV_IBM, NCV_CDC, 0, 0}; 00158 00159 /* 00160 * _ffstat_cnvt[] 00161 * Table which maps a return status from ffread into 00162 * the corresponding _frch status code. 00163 */ 00164 00165 const short 00166 _ffstat_cnvt[7] = { 00167 -1, /* not used */ 00168 CNT, 00169 EOR, 00170 EOF, 00171 EOD, 00172 CNT, /* for FFBOD */ 00173 -1 /* for FFERR */ 00174 }; 00175 00176 /* 00177 * _old_namelist_to_f77_type_cnvt[] 00178 * Table containing the mapping of the old Namelist 00179 * Fortran data type codes to Fortran 77 type codes. 00180 * The table is indexed by the old type code. 00181 */ 00182 00183 const short 00184 _old_namelist_to_f77_type_cnvt[10] = { 00185 DT_NONE, /* Typeless */ 00186 DT_SINT, /* Short integer */ 00187 DT_INT, /* Integer */ 00188 DT_REAL, /* Real */ 00189 DT_DBLE, /* Double precision */ 00190 DT_CMPLX, /* Complex */ 00191 DT_CHAR, /* Character */ 00192 -1, /* Unused */ 00193 -1, /* Unused */ 00194 DT_LOG /* Logical */ 00195 }; 00196 00197 /* 00198 * __tip_null[] 00199 * Structure containing a null type information packet 00200 * for initialization. 00201 */ 00202 00203 type_packet 00204 __tip_null = {DVTYPE_TYPELESS, -1, 0, 0, 0, 0, 1, 0, 0, 0, NULL}; 00205 00206 SHARED_CC_BUG_WORKAROUND(_tables_kludge_func)