From 5a5bbf9a54d36fbd633e8053f80b04fc2a8b1850 Mon Sep 17 00:00:00 2001 From: ymao Date: Wed, 5 Oct 2016 16:14:09 -0700 Subject: [PATCH 1/2] Fixed a bug when calculating steps of forcing to skip - should round to integer first before converting to int type to prevent possible 1-timestep wrong offset --- vic/drivers/shared_all/src/make_dmy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vic/drivers/shared_all/src/make_dmy.c b/vic/drivers/shared_all/src/make_dmy.c index 9abbdcb02..ec6f6fbc7 100644 --- a/vic/drivers/shared_all/src/make_dmy.c +++ b/vic/drivers/shared_all/src/make_dmy.c @@ -98,8 +98,8 @@ make_dmy(global_param_struct *global) global->calendar, global->time_units); global->forceskip[i] = - (unsigned int) ((start_num - force_num) * - (double) param_set.force_steps_per_day[i]); + (unsigned int) round((start_num - force_num) * + (double) param_set.force_steps_per_day[i]); } } From 35cd143ecf95f88f2c8b846ddbbc58b1288f63fa Mon Sep 17 00:00:00 2001 From: ymao Date: Wed, 5 Oct 2016 16:34:33 -0700 Subject: [PATCH 2/2] Added bug fix release notes to PR#639 --- docs/Development/ReleaseNotes.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/Development/ReleaseNotes.md b/docs/Development/ReleaseNotes.md index 337a540f2..dbf9903a7 100644 --- a/docs/Development/ReleaseNotes.md +++ b/docs/Development/ReleaseNotes.md @@ -24,6 +24,10 @@ To check which release of VIC you are running: After the fix, the timestamp appeared in the image driver output history filename is the beginning time of the time period in the file. +2. Fixed forceskip rounding bug ([GH#639](https://github.com/UW-Hydro/VIC/pull/639)) + + After the fix, the `forceskip` variable in the global parameter structure (i.e., the number of timesteps to skip in the forcing data for the simulatin period) is rounded correctly (before the fix, rounding error might cause 1-timestep offset in the simulation results). + ------------------------------ ## VIC 5.0.0 [![DOI](https://zenodo.org/badge/7766/UW-Hydro/VIC.svg)](https://zenodo.org/badge/latestdoi/7766/UW-Hydro/VIC)