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

Bugfix/nc close #774

Merged
merged 13 commits into from
Jan 31, 2018
Merged
Show file tree
Hide file tree
Changes from 12 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
2 changes: 2 additions & 0 deletions docs/Development/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,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
Original file line number Diff line number Diff line change
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