30 {
31
33
34 FILE *out;
35
36 int ids, iz;
37
38
40
41
42 if (argc < 4)
43 ERRMSG("Give parameters: <ctl> <gps.nc> <prof.tab>");
44
45
46 ids = (int) scan_ctl(argc, argv, "IDS", -1, "0", NULL);
47
48
50
51
52 if (ids < 0 || ids > gps->
nds)
53 ERRMSG("Profile not available!");
54
55
56 printf("Write profile data: %s\n", argv[3]);
57 if (!(out = fopen(argv[3], "w")))
58 ERRMSG("Cannot create file!");
59
60
61 fprintf(out,
62 "# $1 = time [sec]\n"
63 "# $2 = altitude [km]\n"
64 "# $3 = longitude [deg]\n"
65 "# $4 = latitude [deg]\n"
66 "# $5 = pressure [hPa]\n"
67 "# $6 = temperature [K]\n"
68 "# $7 = water vapor vmr [ppm]\n"
69 "# $8 = temperature perturbation [K]\n"
70 "# $9 = tropopause height [km]\n\n");
71
72
73 for (iz = 0; iz < gps->
nz[ids]; iz++)
74 if (gps->
z[ids][iz] > 0)
75 fprintf(out, "%.2f %g %g %g %g %g %g %g %g\n",
76 gps->
time[ids], gps->
z[ids][iz], gps->
lon[ids][iz],
77 gps->
lat[ids][iz], gps->
p[ids][iz], gps->
t[ids][iz],
78 gps->
wv[ids][iz], gps->
pt[ids][iz], gps->
th[ids]);
79
80
81 fclose(out);
82
83
84 free(gps);
85
86 return EXIT_SUCCESS;
87}
void read_gps(char *filename, gps_t *gps)
Read GPS-RO data file.
double time[NDS]
Time (seconds since 2000-01-01T00:00Z).
double pt[NDS][NZ]
Temperature perturbation [K].
double t[NDS][NZ]
Temperature [K].
double wv[NDS][NZ]
Water vapor volume mixing ratio [ppm].
int nz[NDS]
Number of altitudes per profile.
double lon[NDS][NZ]
Longitude [deg].
int nds
Number of profiles.
double p[NDS][NZ]
Pressure [hPa].
double th[NDS]
Tropopause height [km].
double z[NDS][NZ]
Altitude [km].
double lat[NDS][NZ]
Latitude [deg].