11 extern struct time_cntl
tc;
12 extern struct fgroup_info
fg[20];
30 struct fmap_struct fmap[100];
48 if(
tc.period==1) h=10;
49 if(
tc.period==2) h=16;
50 if(
tc.period==3) h=22;
54 sprintf(tmp_file,
"fmap_fg.%d%d%d.%d%d%d",
57 if((
fp = fopen (tmp_file,
"w")))
62 if(strcmp(fg_last,fmap[
j].fgroupid))
67 if(!strcmp(
fg[
k].
id,fmap[
j].fgroupid))
68 fprintf(
fp,
"$%s\nMOD\n.FMAP6 %02d%02d%02d%02dPST\n",
73 for(
k=
tc.period-1;
k<=last_per;
k++)
81 strcpy(fg_last,fmap[
j].fgroupid);
85 for(
k=
tc.period-1;
k<=last_per;
k++)
98 tc.year,
tc.month,
tc.day,
tc.hour,&y,&m,&d,&h);
105 strcpy(fg_last,
"\0");
109 if(strcmp(fg_last,fmap[
j].fgroupid))
114 if(!strcmp(
fg[
k].
id,fmap[
j].fgroupid))
115 fprintf(
fp,
"$%s\nMOD\n.FMAP6 %02d%02d%02d%02dPST \n",
119 strcpy(fg_last,fmap[
j].fgroupid);
134 if((
fp = fopen (tmp_file,
"r")))
137 if (!(
text = XtMalloc ((
unsigned)(len+1))))
139 sprintf (line,
"%s: XtMalloc(%ld) failed", len, tmp_file);
146 len_actual=fread (
text,
sizeof (
char), len,
fp);
147 text[len_actual] = 0;
150 sprintf (line,
"Click 'Save as *' to store as '* File'");
156 sprintf(line,
"rm %s",tmp_file);
161 sprintf(line,
"Couldn't open temp file %s",tmp_file);
170 sprintf(line,
"Couldn't open temp file %s",tmp_file);
178 sprintf(line,
"No fmaps in table fmaqtrly to read.");
int adj_time(int adj, int y, int m, int d, int h, int *adj_y, int *adj_m, int *adj_d, int *adj_h)
struct fgroup_info fg[20]
int create_fmap_file(int remove)
int fmap_load(struct fmap_struct *fmap)
sprintf(fbuf,"/usr/mapper/nexrad/ngrid.%02d-%02d-%02d-%02d", year, month, day, hour)
fprintf(fp,"%d %d %d %d 1\n", iminx, iminy, maxi, maxj)