Skip to content

Commit 5a22e90

Browse files
author
Joe Hamman
authored
Merge pull request #750 from UW-Hydro/develop
Develop
2 parents 59b9fd6 + aef57cc commit 5a22e90

File tree

139 files changed

+3809
-1461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+3809
-1461
lines changed

.travis.yml

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ matrix:
1818
- gfortran
1919
- valgrind
2020
# open-mpi is built from source in image.travis
21+
# Image Driver with rvic-routing
22+
- compiler: gcc
23+
os: linux
24+
env: TESTID='image' EXTENSION='ROUT=rout_rvic'
25+
addons:
26+
apt_packages:
27+
- libnetcdf-dev
28+
- netcdf-bin
29+
- netcdf-doc
30+
- gfortran
31+
- valgrind
32+
# open-mpi is built from source in imagervic.travis
2133
# CESM Driver
2234
- compiler: gcc
2335
os: linux

ci/image.travis

+5-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function vic_install {
6161
echo vic_install
6262
cd ${TRAVIS_BUILD_DIR}
6363
echo $PWD
64-
make full -C $DRIVER_PATH
64+
make full $EXTENSION -C $DRIVER_PATH
6565
}
6666

6767
function vic_before_script {
@@ -81,6 +81,10 @@ function vic_script {
8181
$DRIVER_EXE -v
8282
$DRIVER_EXE -o
8383

84+
# Set the number of OpenMP threads to use
85+
# https://docs.travis-ci.com/user/languages/c/#OpenMP-projects
86+
export OMP_NUM_THREADS=4
87+
8488
# Run test package
8589
./tests/run_tests.py unit examples system \
8690
--image=${DRIVER_EXE} \

docs/Development/ReleaseNotes.md

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

1616
------------------------------
17+
18+
## VIC 5.1.0 rc1
19+
20+
<!-- TODO -->
21+
<!-- [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.61422.svg)](http://dx.doi.org/10.5281/zenodo.61422) -->
22+
23+
**Release date: (April 27, 2018)**
24+
25+
Source code is available here: [![VIC.5.1.0](https://img.shields.io/badge/VIC-5.1.0-blue.svg)](https://github.com/UW-Hydro/VIC/releases/tag/VIC.5.1.0)
26+
27+
This is a minor update from VIC 5.0.1. The VIC 5.1.0 includes new features, such as a new streamflow routing extension and extended parallelization using OpenMP. The release also includes a number of bug fixes for the CESM driver. See the VIC Github page for more details on the changes included in this release.
28+
29+
#### Model enhancement:
30+
31+
1. Improved calculation of drainage between soil layers ([GH#656](https://github.com/UW-Hydro/VIC/pull/656))
32+
33+
Drainage from upper layer to adjacent lower layer is calculated according to Brook & Corey curve (where drainage rate is a function of upper-layer soil moisture). In previous versions, a simple numerical solution is applied which uses the timestep-beginning upper-layer soil moisture to calculate drainage rate, and assume this constant rate over the entire timestep. This can cause unreasonably large drainage if the curve has a steep shape and when soil moisture is high. Now, the current version uses exact integral (instead of numerical solution) for layer drainage calculation.
34+
35+
2. Fixes for the CESM driver
36+
37+
1. [GH#642](https://github.com/UW-Hydro/VIC/pull/642)
38+
39+
- Using correct fill value datatypes in MPI Gather steps
40+
- Updated state file name time step to be period-ending rather than period-beginning
41+
- Set the state file name to the RASM case ID
42+
- Removed decimal point for missing values for unsigned integers
43+
- Create dummy forcings when initializing the model (so that there is forcing data for the first time step)
44+
- Changed pressure units from kPa to Pa
45+
- Fixed bug that prevented using the correct local domain grid cells in `cesm_put_data.c`
46+
- Changed reference temperature units from Celsius to Kelvin in `cesm_put_data.c`
47+
48+
1. [GH#695](https://github.com/UW-Hydro/VIC/pull/695)
49+
50+
- Fix sign for latent heat fluxes passed from VIC to the coupler
51+
- Fix sign for longwave radiation passed from VIC to the coupler
52+
53+
1. [GH#696](https://github.com/UW-Hydro/VIC/pull/696)
54+
55+
- Changes names of CESM driver functions `trim` and `advance_time` to `trimstr` and `advance_vic_time`, respectively, to avoid conflicts with WRF functions with the same names when compiling RFR case.
56+
57+
1. [GH#702](https://github.com/UW-Hydro/VIC/pull/702)
58+
59+
- Fixes Julian day for the first timestep in the dmy struct for the CESM driver.
60+
61+
1. [GH#710](https://github.com/UW-Hydro/VIC/pull/710)
62+
63+
- Refactor the cesm_put_data.c routine in the CESM driver to use values from out_data directly, rather than computing them separately in cesm_put_data.c.
64+
65+
1. [GH#716](https://github.com/UW-Hydro/VIC/pull/716)
66+
67+
- Fixes initialization of coupler fields and calculates temperature and upwelling longwave to pass to WRF during initialization.
68+
69+
1. [GH#718](https://github.com/UW-Hydro/VIC/pull/718)
70+
71+
- Updates the cesm_put_data.c routine in the CESM driver to pass gridcell-averaged albedo to the coupler.
72+
73+
1. [GH#726](https://github.com/UW-Hydro/VIC/pull/726)
74+
75+
- Updates the cesm_put_data.c routine in the CESM driver to include the correct units for evap passed to the coupler.
76+
77+
1. [GH#732](https://github.com/UW-Hydro/VIC/pull/732)
78+
79+
- Updates the cesm_put_data.c routine in the CESM driver to include the correct units for sensible heat flux and updates the rofliq calculation to be correct (previously only OUT_BASEFLOW was being divided by global_param.dt).
80+
81+
1. [GH#734](https://github.com/UW-Hydro/VIC/pull/734)
82+
83+
- Updates the cesm_put_data.c routine in the CESM driver to include the correct signs for turbulent heat fluxes and evaporation. Previously we had switched the signs to agree with the image driver and they should instead be in accordance with the sign conventions for coupled models, which differ from those of land surface models. Also, eliminate populating the `l2x_Sl_ram1` field with aero_resist to agree with the VIC 4 implementation in RASM.
84+
85+
1. [GH#739](https://github.com/UW-Hydro/VIC/pull/739)
86+
87+
- Updates the cesm_put_data.c routine in the CESM driver to include the correct signs for the wind stresses and fixes a bug in calculating friction velocity (previously it was missing a square root).
88+
89+
1. [GH#744](https://github.com/UW-Hydro/VIC/pull/744)
90+
91+
- Updates the cesm_interface_c.c routine to include missing timers and the VIC RUN timer in the CESM driver.
92+
93+
1. [GH#746](https://github.com/UW-Hydro/VIC/pull/746)
94+
95+
- Updates the cesm_interface_c.c routine in the CESM driver to populate the nrecs, endyear, endmonth and endday fields in the global_param struct to make them available to vic_finalize for timing tables (specifically the secs/day columns).
96+
97+
3. Speed up NetCDF operations in the image/CESM drivers ([GH#684](https://github.com/UW-Hydro/VIC/pull/684))
98+
99+
These changes speed up image driver initialization, forcing reads, and history writes by only opening and closing each input netCDF file once.
100+
101+
4. Added two new timers to measure time in I/O operations ([GH#703](https://github.com/UW-Hydro/VIC/pull/703))
102+
103+
These two timers count the CPU and WALL time spent in ``vic_force`` and ``vic_write``. The accumulated time from these timers is printed out at the end of each simulation in the timing table. See also [GH#442](https://github.com/UW-Hydro/VIC/pull/442).
104+
105+
5. Added gridcell-averaged albedo (STATE_AVG_ALBEDO) as a state file variable ([GH#712](https://github.com/UW-Hydro/VIC/pull/712))
106+
107+
This is for use in the CESM driver for VIC to pass to WRF, but has been implemented in the core structure of VIC (in vic_run) for consistency with the classic and image drivers. Running VIC from a cold start now also includes calculation of gridcell-averaged albedo.
108+
109+
6. Cleanup of the initialization sections of the ``image`` and ``cesm`` drivers ([GH#701](https://github.com/UW-Hydro/VIC/pull/701))
110+
111+
Codified behavior in the initialization of the ``image`` and `cesm` drivers that requires the parameter variables `AreaFract`, `Pfactor`, `zone_fract`, and `Cv` must sum exactly to 1.0. If using the `SNOW_BAND` option, the area weighted `elevation` must match the mean grid cell elevation (`elev`). VIC will print *warnings* if any of these criteria are violated.
112+
113+
7. Added thread parallelization using OPENMP ([GH#712](https://github.com/UW-Hydro/VIC/pull/712))
114+
115+
The VIC image and CESM drivers now may be optionally compiled with OPENMP to enable shared memory thread parallelization. This option should improve the parallel scaling of these drivers by reducing the number of MPI messages and increasing message size.
116+
117+
8. Added streamflow routing extensions ROUT_STUB and ROUT_RVIC for the VIC image driver ([GH#231](https://github.com/UW-Hydro/VIC/pull/231))
118+
119+
The VIC image driver can be optionally compiled with ROUT_RVIC to enable routing in image mode (ROUT_STUB is the default extension which means no routing). With ROUT_RVIC enabled, the output variable ``OUT_DISCHARGE`` is available, and there will also be an extra state variable ``STATE_ROUT_RING`` stored in the state file.
120+
121+
9. Moved MAX_ITER_GRND_CANOPY, which controls the maximum number of ground-canopy iterations in CLOSE_ENERGY mode for vegetation types with an overstory, to the parameters struct ([GH#771](https://github.com/UW-Hydro/VIC/pull/771))
122+
123+
Previously this was set in the surface_fluxes.c numerics routine for ground-canopy iterations, which meant that that routine had to be altered to change the maximum number of iterations. It has now been moved to the parameters struct so that it can be overriden in the constants file.
124+
125+
10. Updated new snow density function by adding a cap to new snow density that is set in the parameters struct by the parameter SNOW_NEW_SNOW_DENS_MAX ([GH#776](https://github.com/UW-Hydro/VIC/pull/776))
126+
127+
Previously the change in cold content of the snowpack term (deltaCC in the snow_data_struct) would get unreasonably large if the Hedstrom and Pomeroy 1998 equation used to calculate snow density, which depends only on air temperature, was calculated with air temperatures above about 2 deg C. We use this term to calculate the ground flux from the snowpack and snow depth, which resulted in extremely small snow depths and unreasonably large ground fluxes from the snowpack (and thus changes in snowpack cold content). Now there is a cap on new snow density with the new parameter SNOW_NEW_SNOW_DENS_MAX as well as a snow depth below which we disregard the ground flux from the snowpack (1.e-8).
128+
129+
10. Miscellaneous clean-up:
130+
131+
[GH#723](https://github.com/UW-Hydro/VIC/pull/723)
132+
133+
- Added support for veg_hist forcings (non-climatological) in image mode
134+
- Fixed erroneous allocation of extra veg tile in image mode
135+
- Simplified looping over veg tiles and bands in vic_run() and prepare_full_energy()
136+
- Replaced lengthy data structures with local pointers in vic_run()
137+
- Simplified out_prec, out_rain, and Melt arrays
138+
- Updated names of variables and options for LAI and FCANOPY in documentation to match their new names in the code
139+
- Removed constants MAX_VEG and MAX_BANDS from code; all arrays that were declared with those lengths were replaced with dynamic allocations. This allowed for specification of veg libraries containing more classes without recompiling the code, and more efficient memory usage.
140+
141+
[GH#766](https://github.com/UW-Hydro/VIC/pull/766)
142+
143+
- Improved logic in computing soil evaporation (esoil), primarily in func_surf_energy_bal(), by creating explicit terms for transpiration (transp) and esoil in the layer data structure.
144+
145+
#### Bug Fixes:
146+
147+
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))
148+
149+
2. Renamed "fcov" to "fcan" in image driver to better match variable code name ([GH#673](https://github.com/UW-Hydro/VIC/pull/673))
150+
151+
------------------------------
152+
17153
## VIC 5.0.1
18154

19155
**Release date: (February 1, 2017)**
@@ -26,10 +162,10 @@ To check which release of VIC you are running:
26162

27163
2. Fixed forceskip rounding bug ([GH#639](https://github.com/UW-Hydro/VIC/pull/639))
28164

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).
165+
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 simulation period) is rounded correctly (before the fix, rounding error might cause 1-timestep offset in the simulation results).
30166

31167
3. Fixed a problem with image restarts when using multiple processors ([GH#638](https://github.com/UW-Hydro/VIC/pull/638))
32-
168+
33169
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.
34170

35171
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))
@@ -40,8 +176,8 @@ To check which release of VIC you are running:
40176

41177
6. Fixed a bug related to writing two-dimensional lat/lon variables to a state file ([GH#652](https://github.com/UW-Hydro/VIC/pull/652))
42178

43-
Before the bug fix, two-dimensional lat/lon variables were not populated correctly and were written as fill values to a state file. Now two-dimensional lat/lon variables are correctly populated and written.
44-
179+
Before the bug fix, two-dimensional lat/lon variables were not populated correctly and were written as fill values to a state file. Now two-dimensional lat/lon variables are correctly populated and written.
180+
45181
7. Fixed a bug related to `dz_node` and `node_depth` variables in image driver output state file ([GH#657](https://github.com/UW-Hydro/VIC/pull/657))
46182

47183
Before the fix, `dz_node` and `node_depth` in image driver output state file were not spatially distributed, which was wrong. Now these two variables are spatially distributed in the output state file.
@@ -58,10 +194,9 @@ To check which release of VIC you are running:
58194

59195
Before the fix, there would be an error if the simulation start time is later than the forcing start time that year AND the simulation spans multiple years. Fixed this bug.
60196

61-
62197
------------------------------
63198

64-
## VIC 5.0.0 [![DOI](https://zenodo.org/badge/7766/UW-Hydro/VIC.svg)](https://zenodo.org/badge/latestdoi/7766/UW-Hydro/VIC)
199+
## VIC 5.0.0 [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.61422.svg)](http://dx.doi.org/10.5281/zenodo.61422)
65200

66201
**Release date: (September 2, 2016)**
67202

docs/Documentation/Constants.md

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ The table below lists the constants available for manipulation via the `CONSTANT
111111
| SNOW_MAX_SURFACE_SWE | |
112112
| SNOW_LIQUID_WATER_CAPACITY | |
113113
| SNOW_NEW_SNOW_DENSITY | |
114+
| SNOW_NEW_SNOW_DENS_MAX | |
115+
| SNOW_DEPTH_THRES | |
114116
| SNOW_DENS_DMLIMIT | |
115117
| SNOW_DENS_DMLIMIT_FACTOR | |
116118
| SNOW_DENS_MAX_CHANGE | |
@@ -161,6 +163,7 @@ The table below lists the constants available for manipulation via the `CONSTANT
161163
| TOL_GRND | |
162164
| TOL_OVER | |
163165
| FROZEN_MAXITER | |
166+
| MAX_ITER_GRND_CANOPY | |
164167
| NEWT_RAPH_MAXTRIAL | |
165168
| NEWT_RAPH_TOLX | |
166169
| NEWT_RAPH_TOLF | |

docs/Documentation/Drivers/Classic/ForcingData.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ The VIC Classic Driver requires subdaily forcings (meteorological or other). For
1919
| Variable | Description | Units |
2020
|------------|----------------------------------------------------------|---------------------------- |
2121
| ALBEDO | Surface Albedo | fraction (between 0 and 1) |
22-
| LAI_IN | Leaf Area Index | m<sup>2</sup>/m<sup>2</sup> |
23-
| VEGCOVER | Partial veg cover fraction ( = 1 - canopy gap fraction ) | fraction (between 0 and 1) |
22+
| LAI | Leaf Area Index | m<sup>2</sup>/m<sup>2</sup> |
23+
| FCANOPY | Partial veg cover fraction ( = 1 - canopy gap fraction ) | fraction (between 0 and 1) |
2424

2525
#### Lake Forcings, Required when LAKES is TRUE:
2626

0 commit comments

Comments
 (0)