22 # define FORTRAN_NAME(low,up) up
25 # define FORTRAN_NAME(low,up) low##_
27 # define FORTRAN_NAME(low,up) low
33 #define byte_reverse FORTRAN_NAME(byte_reverse, BYTE_REVERSE )
34 #define byte_reverse8 FORTRAN_NAME(byte_reverse8, BYTE_REVERSE8 )
35 #define byte_open FORTRAN_NAME(byte_open, BYTE_OPEN )
36 #define byte_close FORTRAN_NAME(byte_close, BYTE_CLOSE )
37 #define byte_rewind FORTRAN_NAME(byte_rewind, BYTE_REWIND )
38 #define byte_read FORTRAN_NAME(byte_read, BYTE_READ )
39 #define byte_write FORTRAN_NAME(byte_write, BYTE_WRITE )
40 #define get_bytesw_write FORTRAN_NAME(get_bytesw_write, GET_BYTESW_WRITE)
41 #define set_bytesw_write FORTRAN_NAME(set_bytesw_write, SET_BYTESW_WRITE)
47 #define SWAP(a,b) temp=(a); (a)=(b); (b)=temp;
71 printf(
"byte_reverse() :: n must be positive\n");
76 for (ptr=(
char *)buf,n=*nn; n--; ptr+=4)
91 printf(
"byte_reverse8() :: n must be positive\n");
97 printf(
"byte_reverse8() :: n must be multiple of 2\n");
102 for (ptr=(
char *)buf,n=*nn,n=n+2; n-=2; ptr+=8)
121 printf(
"byte_open() :: invalid string length\n");
125 strncpy(name,n,nlen);
126 for (i=nlen-1; i>0; i--)
if (name[i] !=
' ')
break;
129 for (i=nlen-1; i>0; i--)
if (name[i] ==
'/')
break;
131 strncpy(dirname,name,i);
133 istat = mkdir(dirname,0755);
145 printf(
"byte_close() :: couldn't fclose file!\n");
169 printf(
"byte_write() :: n must be positive\n");
176 if (!(fp=fopen(name,
"wb")))
178 printf(
"byte_write() :: fopen failure!\n");
189 fwrite(buf,
sizeof(
float),*n,fp);
193 printf(
"byte_write() :: can't fwrite after freading!\n");
207 {printf(
"byte_read() :: n must be positive\n"); *ierr=1;
return;}
211 if (!(fp=fopen(name,
"rb")))
214 printf(
"byte_read() :: fopen failure2!\n");
225 fread(buf,
sizeof(
float),*n,fp);
228 printf(
"ABORT: Error reading %s\n",name);
234 printf(
"ABORT: EOF found while reading %s\n",name);
242 printf(
"byte_read() :: can't fread after fwriting!\n");
void set_bytesw_read(int *pa)
void get_bytesw_read(int *pa)