Read regression point positions. More...
#include <dsclim.h>
Go to the source code of this file.
Functions | |
int | read_regression_points (reg_struct *reg) |
Read regression point positions. |
Read regression point positions.
Definition in file read_regression_points.c.
int read_regression_points | ( | reg_struct * | reg | ) |
Read regression point positions.
[in] | reg | Regression structure. |
Definition at line 67 of file read_regression_points.c.
References reg_struct::dimxname, reg_struct::dimyname, reg_struct::filename, reg_struct::lat, reg_struct::lon, reg_struct::npts, reg_struct::ptsname, read_netcdf_var_1d(), and TRUE.
Referenced by main().
00067 { 00074 int npts; 00075 int istat; 00076 00077 /* Read latitudes of points where regressions are calculated */ 00078 istat = read_netcdf_var_1d(&(reg->lat), (info_field_struct *) NULL, reg->filename, reg->dimyname, reg->ptsname, &npts, TRUE); 00079 if (istat != 0) { 00080 (void) free(reg->lat); 00081 return istat; 00082 } 00083 00084 /* Read longitudes of points where regressions are calculated */ 00085 istat = read_netcdf_var_1d(&(reg->lon), (info_field_struct *) NULL, reg->filename, reg->dimxname, reg->ptsname, &(reg->npts), TRUE); 00086 if (istat != 0 || npts != reg->npts) { 00087 (void) free(reg->lat); 00088 (void) free(reg->lon); 00089 return istat; 00090 } 00091 00092 (void) fprintf(stdout, "%s: %d regression point positions read successfully.\n", __FILE__, reg->npts); 00093 00094 /* Return status */ 00095 return 0; 00096 }