cleanup of sfc_pres_temp_more.c
*/
#include <netcdf.h>
-#define FILE_NAME basic1.nc
+#define FILE_NAME "sfc_pres_temp_more.nc"
#define NDIMS 2
#define LAT_NAME "latitude"
#define LAT_LEN 40
#define TEMP_NAME "surface_temperature"
#define SONNET_NAME "Brownings_sonnet_mangled_by_Hartnett"
-char data_poem[] = "How do I love data? Let me count the ways.\n
-I love data to the depth and breadth and height\n
-My model can reach, when running overnight\n
-From the ends of CONUS and ideal Space.\n
-I love data to the level of every day's\n
-6Z ob, by Sun and Linux box.\n
-I love data freely, as PIs strive for funding;\n
-I love data purely, as good C code is compiled,\n
-I love data with the passion put to use\n
-In my old programs, and with my childhood's TRS-80.\n
-I love data with a love I seemed to lose\n
-With my lost password -I love data with the constants,\n
-expressions, statements, of all my code! -and, if NSF choose,\n
-I shall love data better after processing.";
+char poem[] = "How do I love data? Let me count the ways.\n"
+ "I love data to the depth and breadth and height\n"
+ "My model can reach, when running overnight\n"
+ "From the ends of CONUS and ideal Space.\n"
+ "I love data to the level of every day's\n"
+ "6Z ob, by Sun and Linux box.\n"
+ "I love data freely, as PIs strive for funding;\n"
+ "I love data purely, as good C code is compiled,\n"
+ "I love data with the passion put to use\n"
+ "In my old programs, and with my childhood's TRS-80.\n"
+ "I love data with a love I seemed to lose\n"
+ "With my lost password -I love data with the constants,\n"
+ "expressions, statements, of all my code! -and, if NSF choose,\n"
+ "I shall love data better after processing.";
int
main()
{
- int ncid, lon_dimid, lat_dimid, pres_varid, temp_varid;
+ int ncid, lon_dimid, lat_dimid, pres_varid, temp_varid, lat_varid, lon_varid;
int dimids[NDIMS];
float pres_out[LAT_LEN][LON_LEN], pres_in[LAT_LEN][LON_LEN];
float temp_out[LAT_LEN][LON_LEN], temp_in[LAT_LEN][LON_LEN];
+ float latitude[LAT_LEN], longitude[LON_LEN];
char *att_in;
size_t len_in;
int error = 0;
@@ -106,9 +107,9 @@ main()
return retval;
/* Write the dimension metadata. */
- if ((retval = nc_put_var_float(ncid, lat_varid, latitude_out)))
+ if ((retval = nc_put_var_float(ncid, lat_varid, latitude)))
return retval;
- if ((retval = nc_put_var_float(ncid, lon_varid, longitude_out)))
+ if ((retval = nc_put_var_float(ncid, lon_varid, longitude)))
return retval;
/* Write the phoney data. */
