Skip to content

Commit bdd64b5

Browse files
author
Joe Hamman
committed
Merge pull request #393 from lizaclark/hotfix/output_force
Update write_data.c for binary output when OUTPUT_FORCE=TRUE
2 parents 744fb0a + 1385c1d commit bdd64b5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/write_data.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,15 @@ void write_data(out_data_file_struct *out_data_files,
110110
tmp_fptr = (float *)calloc(N_OUTVAR_TYPES*options.Nlayer*options.SNOW_BAND,sizeof(float));
111111
tmp_dptr = (double *)calloc(N_OUTVAR_TYPES*options.Nlayer*options.SNOW_BAND,sizeof(double));
112112

113-
// Time
114-
tmp_iptr[0] = dmy->year;
115-
tmp_iptr[1] = dmy->month;
116-
tmp_iptr[2] = dmy->day;
117-
tmp_iptr[3] = dmy->hour;
113+
if (!options.OUTPUT_FORCE) {
114+
115+
// Time
116+
tmp_iptr[0] = dmy->year;
117+
tmp_iptr[1] = dmy->month;
118+
tmp_iptr[2] = dmy->day;
119+
tmp_iptr[3] = dmy->hour;
120+
121+
}
118122

119123
// Loop over output files
120124
for (file_idx = 0; file_idx < options.Noutfiles; file_idx++) {

0 commit comments

Comments
 (0)