Mapper
new_write_qpf_grids.c
Go to the documentation of this file.
1 #define _POSIX_SOURCE
2 #include "prototypes_new.h"
3 
4 void write_qpf_grids(char *fname)
5 
6 {
7 
8 FILE *fp;
9 extern struct hrap_grid *hrap_grid;
10 extern struct pcp *pcp;
11 int i,j;
12 int iflag;
13 
14 fp=fopen(fname,"w");
15 
16 if(fp==NULL) {
17 
18  printf("could not open %s\n",fname);
19 
20  exit(1);
21 
22  }
23 
24 chmod(fname,S_IRUSR | S_IWUSR |
25  S_IRGRP | S_IWGRP |
26  S_IROTH | S_IWOTH);
27 
28 iflag=1;
29 
30 fprintf(fp,"%d %d %d %d %d\n",
32  iflag);
33 
34 for(i=0;i<hrap_grid->maxi;i++) {
35 
36 for(j=0;j<hrap_grid->maxj;j++) {
37 
38  fprintf(fp," %5d",pcp->value[i][j]);
39 
40  }
41 }
42 
43 fclose(fp);
44 
45 return;
46 
47 }
48 
static int i
fclose(fp)
printf("fbuf is %s\n", fbuf)
fp
Definition: make_NEXRAD.c:339
fprintf(fp,"%d %d %d %d 1\n", iminx, iminy, maxi, maxj)
int j
Definition: mapp2h.h:48
void write_qpf_grids(char *fname)
struct pcp * pcp
Definition: mapper.c:140
struct hrap_grid * hrap_grid
Definition: mapper.c:142
char fname[100]
Definition: send_afos.c:6
short int hrap_miny
Definition: misc.h:583
short int hrap_minx
Definition: misc.h:582
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