Skip to content

Commit

Permalink
Merge pull request #774 from wietsefranssen/bugfix/nc_close
Browse files Browse the repository at this point in the history
Bugfix/nc close
  • Loading branch information
bartnijssen committed Jan 31, 2018
2 parents 7b8196a + 98d89b1 commit df5d1d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/Development/ReleaseNotes.md
Expand Up @@ -135,6 +135,8 @@ To check which release of VIC you are running:

1. Renamed "fcov" to "fcan" in image driver to better match variable code name ([GH#673](https://github.com/UW-Hydro/VIC/pull/673))

1. NetCDF forcing files are now closed at the last timestep in stead of after the last timestep. ([GH#774](https://github.com/UW-Hydro/VIC/pull/774))

------------------------------

## VIC 5.0.1
Expand Down
4 changes: 2 additions & 2 deletions vic/drivers/image/src/vic_force.c
Expand Up @@ -245,7 +245,7 @@ vic_force(void)

if (mpi_rank == VIC_MPI_ROOT) {
// Close forcing file if it is the last time step
if (current == global_param.nrecs) {
if (current == global_param.nrecs - 1) {
status = nc_close(filenames.forcing[0].nc_id);
check_nc_status(status, "Error closing %s",
filenames.forcing[0].nc_filename);
Expand Down Expand Up @@ -375,7 +375,7 @@ vic_force(void)

if (mpi_rank == VIC_MPI_ROOT) {
// Close forcing file if it is the last time step
if (current == global_param.nrecs) {
if (current == global_param.nrecs - 1) {
status = nc_close(filenames.forcing[1].nc_id);
check_nc_status(status, "Error closing %s",
filenames.forcing[1].nc_filename);
Expand Down

0 comments on commit df5d1d2

Please sign in to comment.