Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up ascii header #227

Merged
merged 4 commits into from
Jul 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions vic/drivers/classic/src/write_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,14 @@ write_header(out_data_file_struct *out_data_files,
else {
Nvars += 3;
}
fprintf(out_data_files[file_idx].fh, "# NRECS: %zu\n",
global.nrecs);
fprintf(out_data_files[file_idx].fh, "# DT: %f\n", global.out_dt);
fprintf(out_data_files[file_idx].fh,
"# STARTDATE: %04d-%02d-%02d-%05d\n",
dmy->year, dmy->month, dmy->day, dmy->dayseconds);
fprintf(out_data_files[file_idx].fh, "# ALMA_OUTPUT: %d\n",
tmp_ALMA_OUTPUT);
fprintf(out_data_files[file_idx].fh, "# NVARS: %zu\n", Nvars);
fprintf(out_data_files[file_idx].fh, "# SIMULATION: %s\n",
out_data_files[file_idx].prefix);
fprintf(out_data_files[file_idx].fh, "# MODEL_VERSION: %s\n",
SHORT_VERSION);
fprintf(out_data_files[file_idx].fh, "# ALMA_UNITS: %s\n",
tmp_ALMA_OUTPUT ? "True" : "False");

// Header part 2: Variables
fprintf(out_data_files[file_idx].fh, "# ");

// Write the date
if (global.out_dt < SEC_PER_DAY) {
// Write year, month, day, and sec
Expand Down
34 changes: 33 additions & 1 deletion vic/drivers/shared/include/vic_driver_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <vic_def.h>
#include <vic_physical_constants.h>

#define VERSION "5.0 beta 2014-Dec-03"
#define VERSION "5.0 beta 2015-July-26"
#define SHORT_VERSION "5.0.beta"

/******************************************************************************
Expand Down Expand Up @@ -61,6 +61,38 @@ typedef struct {
size_t N_TYPES[2];
} param_set_struct;

/******************************************************************************
* @brief This structure stores output information for one output file.
*****************************************************************************/
typedef struct {
char prefix[MAXSTRING]; /**< prefix of the file name, e.g. "fluxes" */
char filename[MAXSTRING]; /**< complete file name */
FILE *fh; /**< filehandle */
size_t nvars; /**< number of variables to store in the file */
unsigned int *varid; /**< id numbers of the variables to store in the file
(a variable's id number is its index in the out_data array).
The order of the id numbers in the varid array
is the order in which the variables will be written. */
} out_data_file_struct;

/******************************************************************************
* @brief This structure holds all variables needed for the error handling
* routines.
*****************************************************************************/
typedef struct {
atmos_data_struct *atmos;
double dt;
energy_bal_struct *energy;
filep_struct filep;
size_t rec;
out_data_struct *out_data;
out_data_file_struct *out_data_files;
snow_data_struct *snow;
soil_con_struct soil_con;
veg_con_struct *veg_con;
veg_var_struct *veg_var;
} Error_struct;

double all_30_day_from_dmy(dmy_struct *dmy);
double all_leap_from_dmy(dmy_struct *dmy);
void calc_root_fractions(veg_con_struct *veg_con, soil_con_struct *soil_con);
Expand Down
32 changes: 0 additions & 32 deletions vic/vic_run/include/vic_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -1504,36 +1504,4 @@ typedef struct {
double *aggdata; /**< array of aggregated data values */
} out_data_struct;

/******************************************************************************
* @brief This structure stores output information for one output file.
*****************************************************************************/
typedef struct {
char prefix[20]; /**< prefix of the file name, e.g. "fluxes" */
char filename[MAXSTRING]; /**< complete file name */
FILE *fh; /**< filehandle */
size_t nvars; /**< number of variables to store in the file */
unsigned int *varid; /**< id numbers of the variables to store in the file
(a variable's id number is its index in the out_data array).
The order of the id numbers in the varid array
is the order in which the variables will be written. */
} out_data_file_struct;

/******************************************************************************
* @brief This structure holds all variables needed for the error handling
* routines.
*****************************************************************************/
typedef struct {
atmos_data_struct *atmos;
double dt;
energy_bal_struct *energy;
filep_struct filep;
size_t rec;
out_data_struct *out_data;
out_data_file_struct *out_data_files;
snow_data_struct *snow;
soil_con_struct soil_con;
veg_con_struct *veg_con;
veg_var_struct *veg_var;
} Error_struct;

#endif