Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #pragma ident "@(#) libfi/element/associated.c 92.1 06/16/99 15:47:23"
00038 #include <fortran.h>
00039 #include <stdlib.h>
00040 #include <liberrno.h>
00041 #include <cray/dopevec.h>
00042
00043 #define TRUE 1
00044 #define FALSE 0
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 _f_log
00061 _ASSOCIATED (DopeVectorType * pointer,
00062 DopeVectorType * target)
00063 {
00064 int iresult;
00065 int loopj;
00066 int rank;
00067 long ptrlen;
00068 long tarlen;
00069 iresult = FALSE;
00070
00071
00072 if (!pointer->assoc)
00073 return(_btol(iresult));
00074
00075
00076
00077
00078 if (target == NULL) {
00079 iresult = TRUE;
00080 return(_btol(iresult));
00081 }
00082
00083
00084
00085
00086 if ((target->p_or_a == POINTTR) && (!target->assoc))
00087 return(_btol(iresult));
00088
00089 rank = pointer->n_dim;
00090 #if defined(_CRAY1) && !defined(_ADDR64) && !defined(_WORD32)
00091 ptrlen = pointer->base_addr.a.el_len;
00092 tarlen = target->base_addr.a.el_len;
00093 #else
00094 ptrlen = _fcdlen(pointer->base_addr.charptr);
00095 tarlen = _fcdlen(target->base_addr.charptr);
00096 #endif
00097
00098
00099 if ((pointer->base_addr.a.ptr == target->base_addr.a.ptr) &&
00100 (ptrlen == tarlen) &&
00101 (pointer->n_dim == target->n_dim) &&
00102 (pointer->type_lens.type == target->type_lens.type)) {
00103
00104
00105 for (loopj = 0; loopj < rank; loopj++) {
00106 if((pointer->dimension[loopj].extent !=
00107 target->dimension[loopj].extent) ||
00108 (pointer->dimension[loopj].stride_mult !=
00109 target->dimension[loopj].stride_mult))
00110 return(_btol(iresult));
00111 }
00112 iresult = TRUE;
00113 }
00114 return(_btol(iresult));
00115 }
00116
00117 #ifdef _F_LOG4
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 _f_log4
00133 _ASSOCIATED_4 (DopeVectorType * pointer,
00134 DopeVectorType * target)
00135 {
00136 _f_int4 iresult;
00137 int loopj;
00138 int rank;
00139 long ptrlen;
00140 long tarlen;
00141 iresult = FALSE;
00142
00143
00144 if (!pointer->assoc)
00145 return(_btol(iresult));
00146
00147
00148
00149
00150 if (target == NULL) {
00151 iresult = TRUE;
00152 return(_btol(iresult));
00153 }
00154
00155
00156
00157
00158 if ((target->p_or_a == POINTTR) && (!target->assoc))
00159 return(_btol(iresult));
00160
00161 rank = pointer->n_dim;
00162 #if defined(_CRAY1) && !defined(_ADDR64) && !defined(_WORD32)
00163 ptrlen = pointer->base_addr.a.el_len;
00164 tarlen = target->base_addr.a.el_len;
00165 #else
00166 ptrlen = _fcdlen(pointer->base_addr.charptr);
00167 tarlen = _fcdlen(target->base_addr.charptr);
00168 #endif
00169
00170
00171 if ((pointer->base_addr.a.ptr == target->base_addr.a.ptr) &&
00172 (ptrlen == tarlen) &&
00173 (pointer->n_dim == target->n_dim) &&
00174 (pointer->type_lens.type == target->type_lens.type)) {
00175
00176
00177 for (loopj = 0; loopj < rank; loopj++) {
00178 if((pointer->dimension[loopj].extent !=
00179 target->dimension[loopj].extent) ||
00180 (pointer->dimension[loopj].stride_mult !=
00181 target->dimension[loopj].stride_mult))
00182 return(_btol(iresult));
00183 }
00184 iresult = TRUE;
00185 }
00186 return(_btol(iresult));
00187 }
00188
00189 #endif
00190
00191
00192 #ifdef _F_LOG8
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207 _f_log8
00208 _ASSOCIATED_8 (DopeVectorType * pointer,
00209 DopeVectorType * target)
00210 {
00211 _f_int8 iresult;
00212 int loopj;
00213 int rank;
00214 long ptrlen;
00215 long tarlen;
00216 iresult = FALSE;
00217
00218
00219 if (!pointer->assoc)
00220 return(_btol(iresult));
00221
00222
00223
00224
00225 if (target == NULL) {
00226 iresult = TRUE;
00227 return(_btol(iresult));
00228 }
00229
00230
00231
00232
00233 if ((target->p_or_a == POINTTR) && (!target->assoc))
00234 return(_btol(iresult));
00235
00236 rank = pointer->n_dim;
00237 #if defined(_CRAY1) && !defined(_ADDR64) && !defined(_WORD32)
00238 ptrlen = pointer->base_addr.a.el_len;
00239 tarlen = target->base_addr.a.el_len;
00240 #else
00241 ptrlen = _fcdlen(pointer->base_addr.charptr);
00242 tarlen = _fcdlen(target->base_addr.charptr);
00243 #endif
00244
00245
00246 if ((pointer->base_addr.a.ptr == target->base_addr.a.ptr) &&
00247 (ptrlen == tarlen) &&
00248 (pointer->n_dim == target->n_dim) &&
00249 (pointer->type_lens.type == target->type_lens.type)) {
00250
00251
00252 for (loopj = 0; loopj < rank; loopj++) {
00253 if((pointer->dimension[loopj].extent !=
00254 target->dimension[loopj].extent) ||
00255 (pointer->dimension[loopj].stride_mult !=
00256 target->dimension[loopj].stride_mult))
00257 return(_btol(iresult));
00258 }
00259 iresult = TRUE;
00260 }
00261 return(_btol(iresult));
00262 }
00263
00264 #endif