X
xiao
Can anyone help me to find out what are the structure of 'DataTable' ?
Does loop the 14 layers or the 800*800 array first?
(NumX=NumY=800)
gridde and WriteHeader are two structures
Thank you~~~
void WriteCloudStats(GRIDDEF *griddef, char *StatsDir, int month, int
year, short ****DataTable)
{
FILE *fptr[2];
int i,j,k,l;
char filename[200],command[250],monstr[5];
GRIDDEF header;
if(month < 10)
sprintf(monstr,"0%d",month);
else
sprintf(monstr,"%d",month);
sprintf(filename,"%s/CldYearlyStats_%d_
%d.dat",StatsDir,month,year);
sprintf(command,"/bin/cp %s %s.arc",filename,filename);
system(command);
fptr[0] = fopen(filename,"w");
sprintf(filename,"%s/CldTotalStats_%d.dat",StatsDir,month);
sprintf(command,"/bin/cp %s %s.arc",filename,filename);
system(command);
fptr[1] = fopen(filename,"w");
for(i=0; i<2; i++){
if(fptr != NULL){
WriteHeader(griddef,fptr);
for(j=0; j<14; j++)fwrite(
&DataTable[j][0][0],
sizeof(short),
griddef->NumX*griddef->NumY,
fptr
);
printf("Data is %d \n",&DataTable[j][0][0]);
fclose(fptr);
}
}
}
Does loop the 14 layers or the 800*800 array first?
(NumX=NumY=800)
gridde and WriteHeader are two structures
Thank you~~~
void WriteCloudStats(GRIDDEF *griddef, char *StatsDir, int month, int
year, short ****DataTable)
{
FILE *fptr[2];
int i,j,k,l;
char filename[200],command[250],monstr[5];
GRIDDEF header;
if(month < 10)
sprintf(monstr,"0%d",month);
else
sprintf(monstr,"%d",month);
sprintf(filename,"%s/CldYearlyStats_%d_
%d.dat",StatsDir,month,year);
sprintf(command,"/bin/cp %s %s.arc",filename,filename);
system(command);
fptr[0] = fopen(filename,"w");
sprintf(filename,"%s/CldTotalStats_%d.dat",StatsDir,month);
sprintf(command,"/bin/cp %s %s.arc",filename,filename);
system(command);
fptr[1] = fopen(filename,"w");
for(i=0; i<2; i++){
if(fptr != NULL){
WriteHeader(griddef,fptr);
for(j=0; j<14; j++)fwrite(
&DataTable[j][0][0],
sizeof(short),
griddef->NumX*griddef->NumY,
fptr
);
printf("Data is %d \n",&DataTable[j][0][0]);
fclose(fptr);
}
}
}