Mapper
read_file.c
Go to the documentation of this file.
1 
2 #include "prototypes_new.h"
3 
4 
5 void read_file(char *prefix,int num,struct pcp *pcp)
6 
7 {
8 
9 FILE *fp;
10 char fname[100];
11 extern struct hrap_grid *hrap_grid;
12 int i,j,h;
13 char kbuf[10000];
14 int tread;
15 
16 sprintf(fname,"%s.%d",prefix,num);
17 
18 fp=fopen(fname,"r");
19 
20 if(fp==NULL) {
21 
22  for(i=0;i<hrap_grid->maxi;i++) {
23 
24  for(j=0;j<hrap_grid->maxj;j++) {
25 
26  pcp->value[i][j]=0;
27 
28  }
29 
30  }
31 
32  return;
33 
34  }
35 
36 tread=fread(&pcp->value[0][0],sizeof(short int),hrap_grid->maxi*hrap_grid->maxj,fp);
37 
38 fclose(fp);
39 
40 return;
41 
42 }
43 
static int i
void read_file(char *prefix, int num, struct pcp *pcp)
Definition: read_file.c:5
fclose(fp)
sprintf(fbuf,"/usr/mapper/nexrad/ngrid.%02d-%02d-%02d-%02d", year, month, day, hour)
fp
Definition: make_NEXRAD.c:339
int j
Definition: mapp2h.h:48
struct hrap_grid * hrap_grid
Definition: mapper.c:142
char fname[100]
Definition: send_afos.c:6
short int maxi
Definition: misc.h:580
short int maxj
Definition: misc.h:581
Definition: misc.h:596
short int ** value
Definition: misc.h:599