50 if (strcmp(mode,
"r") == 0 &&
prank == 0){
51 fp = fopen(filename,
"rb");
53 print1 (
"! OpenBinaryFile: file %s does not exists\n", filename);
67 if (strcmp(mode,
"w") == 0) fp = fopen(filename,
"wb");
68 else if (strcmp(mode,
"r") == 0) fp = fopen(filename,
"rb");
70 print1 (
"! Cannot find file %s\n",filename);
122 int ioff, joff, koff;
126 MPI_Barrier (MPI_COMM_WORLD);
135 for (k =
KBEG; k <=
KEND + koff; k++) {
136 for (j =
JBEG; j <=
JEND + joff; j++) {
138 fwrite (Vc + i*dsize, dsize,
NX1 + ioff, fl);
169 int ioff, joff, koff;
189 for (k =
KBEG; k <=
KEND + koff; k++) {
190 for (j =
JBEG; j <=
JEND + joff; j++) {
192 fread (Vc + i*dsize, dsize,
NX1 + ioff, fl);
207 for (k =
KBEG-koff; k <=
KEND + koff; k++) {
208 for (j =
JBEG-joff; j <=
JEND + joff; j++) {
209 for (i =
IBEG-ioff; i <=
IEND + ioff; i++) {
231 static float ***Vflt;
237 Vflt[
k][
j][
i] = (float)(Vdbl[k][j][i]*unit);
241 flt = (float)(Vdbl[k][j][i]*unit);
long int NX1
Number of interior zones in the X1 directions (boundaries excluded) for the local processor...
void print1(const char *fmt,...)
FILE * OpenBinaryFile(char *filename, int sz, char *mode)
long int NX2_TOT
Total number of zones in the X2 direction (boundaries included) for the local processor.
int AL_File_open(char *filename, int sz_ptr)
#define ARRAY_3D(nx, ny, nz, type)
int AL_Write_array(void *va, int sz_ptr, int istag)
float *** Convert_dbl2flt(double ***Vdbl, double unit, int swap_endian)
void ReadBinaryArray(void *V, size_t dsize, int sz, FILE *fl, int istag, int swap_endian)
long int NX3_TOT
Total number of zones in the X3 direction (boundaries included) for the local processor.
long int IEND
Upper grid index of the computational domain in the the X1 direction for the local processor...
int AL_File_close(int sz_ptr)
long int KBEG
Lower grid index of the computational domain in the the X3 direction for the local processor...
long int KEND
Upper grid index of the computational domain in the the X3 direction for the local processor...
long int JBEG
Lower grid index of the computational domain in the the X2 direction for the local processor...
int CloseBinaryFile(FILE *fbin, int sz)
#define QUIT_PLUTO(e_code)
void WriteBinaryArray(void *V, size_t dsize, int sz, FILE *fl, int istag)
long int JEND
Upper grid index of the computational domain in the the X2 direction for the local processor...
long int NX1_TOT
Total number of zones in the X1 direction (boundaries included) for the local processor.
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
int AL_Read_array(void *va, int sz_ptr, int istag)