Skip to content

Commit 2aa1eb0

Browse files
committed
Revert "Merge branch 'hotfix/5.0.1' of github.com:UW-Hydro/VIC into hotfix/5.0.1"
This reverts commit a9a202b, reversing changes made to bbf7d9a.
1 parent e2ca076 commit 2aa1eb0

18 files changed

+24
-180
lines changed

docs/Development/ReleaseNotes.md

-25
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,6 @@ To check which release of VIC you are running:
1313
- For VIC 4, type `vicNl -v`
1414
- For VIC 5 and later, type `vic_{classic,image}.exe -v`
1515

16-
------------------------------
17-
## VIC 5.0.1
18-
19-
**Release date: (Unreleased)**
20-
21-
#### Bug Fixes:
22-
23-
1. Fixed image driver history file name timestamp ([GH#635](https://github.com/UW-Hydro/VIC/pull/635))
24-
25-
After the fix, the timestamp appeared in the image driver output history filename is the beginning time of the time period in the file.
26-
27-
2. Fixed forceskip rounding bug ([GH#639](https://github.com/UW-Hydro/VIC/pull/639))
28-
29-
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).
30-
31-
3. Fixed a problem with image restarts when using multiple processors ([GH#638](https://github.com/UW-Hydro/VIC/pull/638))
32-
33-
After the fix, only the master node is assigned the task of validating state file dimensions and coordinate variables. Multiprocessing was also added to the VIC testing framework.
34-
35-
4. Ensured that the mask variable in the input domain file must be integer type; otherwise an error is raised. ([GH#645](https://github.com/UW-Hydro/VIC/pull/645))
36-
37-
5. Fixed a bug related to `make_lastday` function ([GH#647](https://github.com/UW-Hydro/VIC/pull/647))
38-
39-
Before the fix, the input arguments to function `make_lastday` are sometimes in a wrong order. The bug caused error when trying to write state file on a leap day.
40-
4116
------------------------------
4217

4318
## VIC 5.0.1

docs/Documentation/Drivers/Classic/RunVIC.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- Clang (`clang` version 3+)
1010

1111
VIC has also been compiled using these compilers:
12-
12+
1313
- Intel (`icc`)
1414
- PGI (`pgcc`)
1515

@@ -28,7 +28,7 @@
2828

2929
At the command prompt, type:
3030

31-
./vic_classic.exe -g global_parameter_filename
31+
vic_classic.exe -g global_parameter_filename
3232

3333
where `global_parameter_filename` = name of the global parameter file corresponding to your project.
3434

docs/Documentation/Drivers/Image/Domain.md

-51
This file was deleted.

docs/Documentation/Drivers/Image/GlobalParam.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ See the [example file](#example-global-parameter-file) at the end of this page f
157157

158158
# Define Domain file
159159

160-
The folloiwng options describe the input domain file information. See [Domain File](Domain.md) for details about the domain file.
160+
The folloiwng options describe the input domain file information.
161161

162162
| Name | Type | Units | Description |
163163
|-------------|---------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------|

docs/Documentation/Drivers/Image/Inputs.md

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ To run VIC, several sets of input data are necessary:
77
* [Global Parameter File](GlobalParam.md): This is the main input file for VIC. It points VIC to the locations of the other input/output files and sets parameters that govern the simulation (e.g., start/end dates, modes of operation).
88
* [Meteorological Forcing Files](ForcingData.md): Gridded, sub-daily timeseries of meteorological variables as inputs.
99
* [Parameters File](Params.md): Spatially distributed parameters describing the land surface.
10-
* [Domain File](Domain.md): Domain information of VIC run.
1110

1211
And a few more are optional:
1312

docs/Documentation/Drivers/Image/RunVIC.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ In some versions of the MPI library (e.g. OPEN-MPI with Intel), you may also nee
4444

4545
At the command prompt, type:
4646

47-
./vic_image.exe -g global_parameter_filename.txt
47+
`vic_image.exe -g global_parameter_filename.txt`
4848

4949
where `global_parameter_filename` = name of the global parameter file corresponding to your project.
5050

5151
To run VIC image driver using multiple processors, type the following instead:
5252

53-
mpiexec -np $n_proc ./vic_image.exe -g global_parameter_filename.txt
53+
`mpiexec -np n_proc vic_image.exe -g global_parameter_filename.txt`
5454

5555
where `n_proc` = number of processors to be used
5656

5757
## Other Command Line Options
5858

5959
VIC has a few other command line options:
6060

61-
- `./vic_image.exe -v`: says which version of VIC this is
62-
- `./vic_image.exe -h`: prints a list of all the VIC command-line options
63-
- `./vic_image.exe -o`: prints a list of all of the current compile-time settings in this executable; to change these settings, you must edit the appropriate header files (e.g. `vic_def.h` or `vic_driver_shared.h`) and recompile using `make full`.
61+
- `vic_image.exe -v`: says which version of VIC this is
62+
- `vic_image.exe -h`: prints a list of all the VIC command-line options
63+
- `vic_image.exe -o`: prints a list of all of the current compile-time settings in this executable; to change these settings, you must edit the appropriate header files (e.g. `vic_def.h` or `vic_driver_shared.h`) and recompile using `make full`.

docs/Documentation/References.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Primary Historical Reference
44

5-
Liang, X., D. P. Lettenmaier, E. F. Wood, and S. J. Burges (1994), A simple hydrologically based model of land surface water and energy fluxes for general circulation models, _J. Geophys. Res._, **99**(D7), 1441514428, [doi:10.1029/94JD00483](http://dx.doi.org/10.1029/94JD00483).
5+
Liang, X., D. P. Lettenmaier, E. F. Wood, and S. J. Burges, 1994: A Simple hydrologically Based Model of Land Surface Water and Energy Fluxes for GSMs, _J. Geophys. Res._, **99**(D7), 14415-14428, [doi:10.1029/94JD00483](http://dx.doi.org/10.1029/94JD00483).
66

77
### Other Historical References
88

mkdocs.yml

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ pages:
6464
- 'Inputs': 'Documentation/Drivers/Image/Inputs.md'
6565
- 'Outputs': 'Documentation/Drivers/Image/Outputs.md'
6666
- 'Params': 'Documentation/Drivers/Image/Params.md'
67-
- 'Domain': 'Documentation/Drivers/Image/Domain.md'
6867
- 'RunVIC': 'Documentation/Drivers/Image/RunVIC.md'
6968
- 'Lake Param': 'Documentation/Drivers/Image/LakeParam.md'
7069
- 'StateFile': 'Documentation/Drivers/Image/StateFile.md'

tests/system/system_tests.cfg

-4
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ STATE_FORMAT=BINARY
144144
test_description = Exact restart (falseFULL_ENERGY flaseFROZEN_SOIL) - image driver
145145
driver = image
146146
global_parameter_file = global.image.STEHE.restart.txt
147-
mpi_proc = 4
148147
expected_retval = 0
149148
check = exact_restart
150149
[[restart]]
@@ -159,7 +158,6 @@ FROZEN_SOIL=FALSE
159158
test_description = Exact restart (trueFULL_ENERGY flaseFROZEN_SOIL) - image driver
160159
driver = image
161160
global_parameter_file = global.image.STEHE.restart.txt
162-
mpi_proc = 4
163161
expected_retval = 0
164162
check = exact_restart
165163
[[restart]]
@@ -174,7 +172,6 @@ FROZEN_SOIL=FALSE
174172
test_description = Exact restart (falseFULL_ENERGY trueFROZEN_SOIL) - image driver
175173
driver = image
176174
global_parameter_file = global.image.STEHE.restart.FROZEN_SOIL.txt
177-
mpi_proc = 4
178175
expected_retval = 0
179176
check = exact_restart
180177
[[restart]]
@@ -190,7 +187,6 @@ NODES=10
190187
test_description = Exact restart (trueFULL_ENERGY trueFROZEN_SOIL) - image driver
191188
driver = image
192189
global_parameter_file = global.image.STEHE.restart.FROZEN_SOIL.txt
193-
mpi_proc = 4
194190
expected_retval = 0
195191
check = exact_restart
196192
[[restart]]

vic/drivers/classic/src/get_global_param.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ get_global_param(FILE *gp)
891891

892892

893893
// Validate simulation end date and/or number of timesteps
894-
make_lastday(global_param.calendar, global_param.endyear, lastday);
894+
make_lastday(global_param.endyear, global_param.calendar, lastday);
895895

896896
if (global_param.nrecs == 0 && global_param.endyear == 0 &&
897897
global_param.endmonth == 0 && global_param.endday == 0) {
@@ -1204,7 +1204,7 @@ get_global_param(FILE *gp)
12041204
global_param.statesec);
12051205
}
12061206
// Check for month, day in range
1207-
make_lastday(global_param.calendar, global_param.stateyear,
1207+
make_lastday(global_param.stateyear, global_param.calendar,
12081208
lastday);
12091209
if (global_param.stateday > lastday[global_param.statemonth - 1] ||
12101210
global_param.statemonth < 1 ||

vic/drivers/image/src/get_global_param.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ get_global_param(FILE *gp)
727727
}
728728

729729
// Validate simulation end date and/or number of timesteps
730-
make_lastday(global_param.calendar, global_param.endyear, lastday);
730+
make_lastday(global_param.endyear, global_param.calendar, lastday);
731731

732732
if (global_param.nrecs == 0 && global_param.endyear == 0 &&
733733
global_param.endmonth == 0 && global_param.endday == 0) {
@@ -895,7 +895,7 @@ get_global_param(FILE *gp)
895895
global_param.statesec);
896896
}
897897
// Check for month, day in range
898-
make_lastday(global_param.calendar, global_param.stateyear,
898+
make_lastday(global_param.stateyear, global_param.calendar,
899899
lastday);
900900
if (global_param.stateday > lastday[global_param.statemonth - 1] ||
901901
global_param.statemonth < 1 ||

vic/drivers/shared_all/src/make_dmy.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ make_dmy(global_param_struct *global)
9898
global->calendar, global->time_units);
9999

100100
global->forceskip[i] =
101-
(unsigned int) round((start_num - force_num) *
102-
(double) param_set.force_steps_per_day[i]);
101+
(unsigned int) ((start_num - force_num) *
102+
(double) param_set.force_steps_per_day[i]);
103103
}
104104
}
105105

vic/drivers/shared_image/include/vic_driver_shared_image.h

-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ size_t get_global_domain(char *fname, domain_struct *global_domain,
201201
size_t get_nc_dimension(char *nc_name, char *dim_name);
202202
void get_nc_var_attr(char *nc_name, char *var_name, char *attr_name,
203203
char **attr);
204-
int get_nc_var_type(char *nc_name, char *var_name);
205204
int get_nc_varndimensions(char *nc_name, char *var_name);
206205
int get_nc_field_double(char *nc_name, char *var_name, size_t *start,
207206
size_t *count, double *var);

vic/drivers/shared_image/src/get_global_domain.c

-7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ get_global_domain(char *nc_name,
3535
bool coords_only)
3636
{
3737
int *run = NULL;
38-
int typeid;
3938
double *var = NULL;
4039
double *var_lon = NULL;
4140
double *var_lat = NULL;
@@ -61,12 +60,6 @@ get_global_domain(char *nc_name,
6160
run = malloc(global_domain->ncells_total * sizeof(*run));
6261
check_alloc_status(run, "Memory allocation error.");
6362

64-
// Check whether mask variable is int type
65-
typeid = get_nc_var_type(nc_name, global_domain->info.mask_var);
66-
if (typeid != NC_INT) {
67-
log_err("Mask variable in the domain file must be integer type.");
68-
}
69-
7063
get_nc_field_int(nc_name, global_domain->info.mask_var, d2start, d2count,
7164
run);
7265

vic/drivers/shared_image/src/get_nc_var_attr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <vic_driver_shared_image.h>
2828

2929
/******************************************************************************
30-
* @brief Get netCDF variable attributes.
30+
* @brief Get netCDF dimension.
3131
*****************************************************************************/
3232
void
3333
get_nc_var_attr(char *nc_name,

vic/drivers/shared_image/src/get_nc_var_type.c

-60
This file was deleted.

vic/drivers/shared_image/src/vic_init_output.c

+6-10
Original file line numberDiff line numberDiff line change
@@ -231,29 +231,25 @@ initialize_history_file(nc_file_struct *nc,
231231
case FREQ_NDAYS:
232232
sprintf(stream->filename, "%s/%s.%04d-%02d-%02d.nc",
233233
filenames.result_dir,
234-
stream->prefix, stream->time_bounds[0].year,
235-
stream->time_bounds[0].month,
236-
stream->time_bounds[0].day);
234+
stream->prefix, ref_dmy->year, ref_dmy->month,
235+
ref_dmy->day);
237236
break;
238237
case FREQ_NMONTHS:
239238
// If FREQ_NMONTHS -- filename = result_dir/prefix.YYYY-MM.nc
240239
sprintf(stream->filename, "%s/%s.%04d-%02d.nc", filenames.result_dir,
241-
stream->prefix, stream->time_bounds[0].year,
242-
stream->time_bounds[0].month);
240+
stream->prefix, ref_dmy->year, ref_dmy->month);
243241
break;
244242
case FREQ_NYEARS:
245243
// If FREQ_NYEARS -- filename = result_dir/prefix.YYYY.nc
246244
sprintf(stream->filename, "%s/%s.%04d.nc", filenames.result_dir,
247-
stream->prefix, stream->time_bounds[0].year);
245+
stream->prefix, ref_dmy->year);
248246
break;
249247
default:
250248
// For all other cases -- filename = result_dir/prefix.YYYY-MM-DD-SSSSS.nc
251249
sprintf(stream->filename, "%s/%s.%04d-%02d-%02d-%05u.nc",
252250
filenames.result_dir,
253-
stream->prefix, stream->time_bounds[0].year,
254-
stream->time_bounds[0].month,
255-
stream->time_bounds[0].day,
256-
stream->time_bounds[0].dayseconds);
251+
stream->prefix, ref_dmy->year, ref_dmy->month,
252+
ref_dmy->day, ref_dmy->dayseconds);
257253
}
258254

259255
// open the netcdf file

vic/drivers/shared_image/src/vic_restore.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ vic_restore(void)
3939
extern veg_con_map_struct *veg_con_map;
4040
extern filenames_struct filenames;
4141
extern metadata_struct state_metadata[N_STATE_VARS];
42-
extern int mpi_rank;
4342

4443
int v;
4544
size_t i;
@@ -61,9 +60,8 @@ vic_restore(void)
6160
size_t d6start[6];
6261

6362
// validate state file dimensions and coordinate variables
64-
if (mpi_rank == VIC_MPI_ROOT) {
65-
check_init_state_file();
66-
}
63+
check_init_state_file();
64+
6765
// read state variables
6866

6967
// allocate memory for variables to be stored

0 commit comments

Comments
 (0)