42static int lunTableInit=0;
43static FILE *lunTable[MAXLUN];
44static int lunUsed[MAXLUN];
49 if (lunTableInit == 0)
51 for (i=0; i < MAXLUN; i++)
67 (FortranInt *lun, FortranInt *istat, FortranByte *fname)
74 if ((cLun < 0) || (cLun >= MAXLUN))
81 if (lunUsed[cLun] != 0)
82 fclose (lunTable[cLun]);
85 lunTable[cLun] = fopen (fname,
"r");
86 if (lunTable[cLun] == NULL)
101#elif defined(f2under)
108 (FortranInt *lun,
void *
buff, FortranLlong *recno, FortranLlong *recl, FortranInt *istat)
117 cRecl = (size_t) *recl;
119 cbuff = (
char *) buff;
121 if ((cLun < 0) || (cLun >= MAXLUN))
128 if (lunUsed[cLun] == 0)
135 offset = ((long) *recno-1)*cRecl;
136 if(fseek(lunTable[cLun], offset, 0) !=0)
137 {*istat = -3;
return; }
140 xfer = fread (buff, (
size_t) 1, cRecl, lunTable[cLun]);
145 for (i=xfer; i < cRecl; i++)
158#elif defined(f2under)
165 (FortranInt *lun, FortranInt *istat)
173 if ((cLun < 0) || (cLun >= MAXLUN))
180 if (lunUsed[cLun] == 0)
187 fclose (lunTable[cLun]);
real, dimension(:), allocatable buff
Used in the many variables' gather; note that scattering has been replaced with subdomain reads when ...