Skip to content

Commit 0aa35c8

Browse files
author
Joe Hamman
authored
Merge pull request #586 from UW-Hydro/develop
Release PR for VIC.5.0.0.rc2
2 parents aa0f335 + f3ac38d commit 0aa35c8

File tree

127 files changed

+4638
-1691
lines changed

Some content is hidden

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

127 files changed

+4638
-1691
lines changed

.gitignore

+9-2
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,23 @@ vic_headers.py
2424
*.mod
2525

2626
vicNl
27-
vic_classic
28-
vic_image
27+
vic_classic.exe
28+
vic_image.exe
2929
liblnd.a
3030
_vic.py
31+
vic_timing_*txt
32+
massif.out.*
33+
vic_call_graph_*
34+
35+
vic_call_graph*
36+
gmon.out
3137

3238
.DS_Store
3339
TAGS
3440

3541
*egg-info*
3642

3743
# Python stuff
44+
__pycache__
3845
.ipynb_checkpoints
3946
.eggs

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ matrix:
1313
addons:
1414
apt_packages:
1515
- libnetcdf-dev
16+
- netcdf-bin
17+
- netcdf-doc
1618
- gfortran
1719
- valgrind
1820
# open-mpi is built from source in image.travis
@@ -23,6 +25,8 @@ matrix:
2325
addons:
2426
apt_packages:
2527
- libnetcdf-dev
28+
- netcdf-bin
29+
- netcdf-doc
2630
- gfortran
2731
# open-mpi is built from source in cesm.travis
2832
# Classic Driver

ci/cesm.travis

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
22

3-
set -e
4-
53
DRIVER_PATH="./vic/drivers/cesm/"
64
DRIVER_LIB="${DRIVER_PATH}lndlib.a"
75

ci/classic.travis

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
22

3-
set -e
4-
53
DRIVER_PATH="${TRAVIS_BUILD_DIR}/vic/drivers/classic/"
64
DRIVER_EXE="${DRIVER_PATH}vic_classic.exe"
75
SAMPLES_PATH="${TRAVIS_BUILD_DIR}/samples/"
@@ -59,10 +57,8 @@ function vic_script {
5957

6058
# Run test package
6159
./tests/run_tests.py unit examples system \
62-
--vic_exe=${DRIVER_EXE} \
63-
--driver=${TESTID} \
60+
--classic=${DRIVER_EXE} \
6461
--data_dir=${SAMPLES_PATH}/data
65-
6662
}
6763

6864
function vic_after_success {

ci/image.travis

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
22

3-
set -e
4-
53
DRIVER_PATH="${TRAVIS_BUILD_DIR}/vic/drivers/image/"
64
DRIVER_EXE="${DRIVER_PATH}vic_image.exe"
75
SAMPLES_PATH="${TRAVIS_BUILD_DIR}/samples/"
@@ -34,23 +32,29 @@ function vic_before_install {
3432
brew install homebrew/versions/gcc49
3533
brew reinstall open-mpi --build-from-source
3634
fi
37-
export TRAVIS_NETCDFPATH=/usr/local
38-
export TRAVIS_MPIPATH=/usr/local
35+
export TRAVIS_MPIPATH=/usr/local
36+
export NC_LIBS=$(/usr/local/bin/nc-config --libs)
37+
export NC_CFLAGS=$(/usr/local/bin/nc-config --cflags)
3938
else
40-
export TRAVIS_NETCDFPATH=/usr
4139
export TRAVIS_MPIPATH="${HOME}/mpich"
40+
export NC_LIBS=$(/usr/bin/nc-config --libs)
41+
export NC_CFLAGS=$(/usr/bin/nc-config --cflags)
4242

4343
# Install MPICH
4444
if [ ! -d ${TRAVIS_MPIPATH} ]; then
4545
install_mpich
4646
else
4747
echo "MPICH installed..."
4848
fi
49-
find ${TRAVIS_MPIPATH} -name mpiexec
50-
find ${TRAVIS_MPIPATH} -name mpicc
5149
fi
52-
export PATH=$TRAVIS_MPIPATH/bin:$PATH
50+
export PATH=${TRAVIS_MPIPATH}/bin:${PATH}
51+
find ${TRAVIS_MPIPATH} -name mpiexec
5352
mpiexec --version
53+
find ${TRAVIS_MPIPATH} -name mpicc
54+
export MPICC="${TRAVIS_MPIPATH}/bin/mpicc"
55+
$MPICC --version
56+
echo "NETCDF LIB FLAGS ------> ${NC_LIBS}"
57+
echo "NETCDF C FLAGS --------> ${NC_CFLAGS}"
5458
}
5559

5660
function vic_install {
@@ -79,10 +83,8 @@ function vic_script {
7983

8084
# Run test package
8185
./tests/run_tests.py unit examples system \
82-
--vic_exe=${DRIVER_EXE} \
83-
--driver=${TESTID} \
86+
--image=${DRIVER_EXE} \
8487
--data_dir=${SAMPLES_PATH}/data
85-
8688
}
8789

8890
function vic_after_success {

ci/requirements.yml

+4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ dependencies:
1010
- configobj
1111
- xarray
1212
- bottleneck
13+
- matplotlib
14+
- seaborn
15+
- psutil
1316
- pip:
1417
- git+https://github.com/UW-Hydro/tonic.git
1518
- engarde
1619
- pytest-faulthandler
1720
- pytest-xdist
21+
- gprof2dot

ci/vic_install_utils

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env bash
22

3-
set -e
4-
53
if [ -z "$WORKDIR" ]; then
64
export WORKDIR=$HOME/workdir
75
mkdir -p $WORKDIR
86
fi
97

8+
export VIC_VALGRIND_SUPPRESSIONS=${TRAVIS_BUILD_DIR}/tests/vic_valgrind_suppressions.supp
9+
1010
function install_mpich {
11-
wget --no-check-certificate -q http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz
12-
tar -xzf mpich-3.2.tar.gz
13-
cd mpich-3.2
11+
wget --no-check-certificate -q http://www.mpich.org/static/downloads/3.1b1/mpich-3.1b1.tar.gz
12+
tar -xzf mpich-3.1b1.tar.gz
13+
cd mpich-3.1b1
1414
mkdir build && cd build
1515
../configure CC=$CC CXX=$CXX --prefix=${TRAVIS_MPIPATH}
1616
make -j2

docs/Development/ReleaseNotes.md

+17-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ For VIC 5 and later, type `vic _{classic,image}.exe -v`
1515

1616
------------------------------
1717

18-
## VIC 5.0.0 (Release Candidate 1)
18+
## VIC 5.0.0 (Release Candidate 2)
1919

20-
**Release date: June 28, 2016**
20+
**Release date: August 18, 2016**
2121

2222
This is a major update from VIC 4. The VIC 5.0.0 release aims to have nearly identical physics as VIC 4.2 while providing a clean, refactored code base supporting multiple drivers. There are a number of new features, bug fixes, and backward incompatible changes. See the VIC Github page for more details on the changes included in this release.
2323

@@ -60,19 +60,22 @@ This is a major update from VIC 4. The VIC 5.0.0 release aims to have nearly ide
6060

6161
9. Tests Datasets ([GH#79](https://github.com/UW-Hydro/VIC/issues/79))
6262

63-
**TODO:** See https://github.com/UW-Hydro/VIC/issues/79 for more information.
63+
See https://github.com/UW-Hydro/VIC/issues/79 for more information. A temporary location of the test data is here: ftp://ftp.hydro.washington.edu/pub/gergel/VIC5_test_data/
6464

6565
10. Testing and Continuous Integration ([GH#190](https://github.com/UW-Hydro/VIC/pull/190))
6666

6767
A comprehensive testing platform has been implemented and is available for public use along with the VIC model. A small subset of the test platform is run on [Travis-CI](https://travis-ci.org/UW-Hydro/VIC), which facilitates continuous integration of the VIC test platform. More information on the test platform is [here](Testing.md)
6868

69+
11. Run-time profiling and timing ([GH#442](https://github.com/UW-Hydro/VIC/pull/442))
70+
71+
A timing module has been added to VIC in order to assess the computational cost and throughput of the VIC model. New output variables (`OUT_TIME_VICRUN_WALL` and `OUT_TIME_VICRUN_CPU`) document the time spent in `vic_run` for each variable. Additionally, a timing table is printed to `LOG_DEST` at the end of each simulation.
72+
6973
#### Backwards Incompatible Changes:
7074

7175
1. Classic Driver I/O Formatting ([GH#18](https://github.com/UW-Hydro/VIC/issues/18), [GH#204](https://github.com/UW-Hydro/VIC/issues/204), [GH#227](https://github.com/UW-Hydro/VIC/pull/227))
7276

7377
The format of ASCII forcing and output files has changed in VIC 5. These changes were motivated by the desire to improve simulation metadata tracking and reproducibility of VIC simulations.
7478

75-
- Forcing files now require date stamps for each timestep and a header specifies the names of the forcing variables.
7679
- Output files now include a header with simulation metadata and variable names. The `PRT_HEADER` option has been deprecated.
7780

7881
2. Classic Driver Global Parameter Options
@@ -155,18 +158,26 @@ This is a major update from VIC 4. The VIC 5.0.0 release aims to have nearly ide
155158

156159
3. Fix related to exact restart ([GH#481](https://github.com/UW-Hydro/VIC/pull/481), [GH#507](https://github.com/UW-Hydro/VIC/pull/507), [GH#509](https://github.com/UW-Hydro/VIC/pull/509))
157160

158-
Previously, VIC did not produce the same results (fluxes and states) if a simulation is separated into multiple shorter-period runs by saving the state variables and restarting. This was due to: 1) the MTCLIM algorithm resulted in slightly different sub-daily meteorological variable values for different length of forcing (MTCLIM is deprecated in the current version); 2) a few bugs resulting in inexact restart. The following bugs have been fixed:
161+
Previously, VIC did not produce the same results (fluxes and states) if a simulation was separated into multiple shorter-period runs by saving the state variables and restarting. This was due to:
162+
1. The MTCLIM algorithm resulted in slightly different sub-daily meteorological variable values for different lengths of forcings (MTCLIM is deprecated in the current version)
163+
2. A few bugs resulting in inexact restart.
164+
165+
The following bugs have been fixed:
159166

160167
- The prognostic state variable `energy.Tfoliage` (foliage temperature) is now saved to the state file
161168
- Two flux variables `energy.LongUnderOut` and `energy.snow_flux` are now saved to the state file.
162169

163170
!!!Note
164-
This is a temporary solution to ensure exact restart. A better way of handling the two flux variables needs to be done in the future (see [GH#479](https://github.com/UW-Hydro/VIC/issues/479))
171+
This is a temporary solution to ensure exact restart. A better way of handling these two flux variables needs to be done in the future (see [GH#479](https://github.com/UW-Hydro/VIC/issues/479))
165172

166173
4. Fix for binary state file I/O ([GH#487](https://github.com/UW-Hydro/VIC/pull/487))
167174

168175
Fixed a bug so that the binary format state file I/O works correctly.
169176

177+
5. Fix for a physical constant (water heat capacity) ([GH#574](https://github.com/UW-Hydro/VIC/pull/574))
178+
179+
Fixed a bug where volumetric heat capacity of water should be used in `func_canopy_energy_bal` (previously specific heat capacity was used).
180+
170181
------------------------------
171182

172183
## VIC 4.2.c [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.35302.svg)](http://dx.doi.org/10.5281/zenodo.35302)

docs/Documentation/Drivers/Image/RunVIC.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Running the VIC Image Driver
22

33
## Dependencies:
4-
The Image Driver's has three dependencies:
4+
The Image Driver has three dependencies:
55

66
1. A C compiler. We routinely test VIC using the following compilers:
77

@@ -22,9 +22,16 @@ The Image Driver's has three dependencies:
2222
## Compiling
2323
In most cases, you will need to edit the `NETCDF_PATH` and `MPI_PATH` variables in the `Makefile`.
2424

25-
If you want to use a compiler other than `gcc`, either edit the Makefile or set the `CC` environment variable, e.g.
25+
If you want to use a compiler other than `mpicc`, either edit the Makefile or set the `MPICC` environment variable, e.g.
2626

27-
export CC=icc
27+
MPICC=/path/to/mpi_c_compiler
28+
29+
The flags and libraries required to compile VIC with netCDF are automatically determined in the `Makefile`. They can be overwritten by setting the following two environment variables. These variables can be determined by running `nc-config --all`.
30+
31+
NC_LIBS="-L/path/to/libs ..."
32+
NC_CFLAGS="-I/path/to/includes -your_c_flags ..."
33+
34+
In some versions of the MPI library (e.g. OPEN-MPI with Intel), you may also need to set the environment variable `MX_RCACHE=2` prior to compiling.
2835

2936
- Change directory, `cd`, to the "Image Driver" source code directory and type `make`
3037

@@ -37,10 +44,16 @@ If you want to use a compiler other than `gcc`, either edit the Makefile or set
3744

3845
At the command prompt, type:
3946

40-
`vic_image.exe -g global_parameter_filename`
47+
`vic_image.exe -g global_parameter_filename.txt`
4148

4249
where `global_parameter_filename` = name of the global parameter file corresponding to your project.
4350

51+
To run VIC image driver using multiple processor, type the following instead:
52+
53+
`mpiexec -np n_proc vic_image.exe -g global_parameter_filename.txt`
54+
55+
where `n_proc` = number of processors to be used
56+
4457
## Other Command Line Options
4558

4659
VIC has a few other command line options:

samples/global.param.sample.image.txt

+3-6
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,19 @@ WIND_H 10.0 # height of wind speed measurement (m)
139139
#######################################################################
140140
# Land Surface Files and Parameters
141141
#######################################################################
142-
SOIL (put the soil parameter path/file here) # Soil parameter path/file
142+
PARAMETERS (put the parameters path/file here) # Parameters path/file
143143
BASEFLOW ARNO # ARNO = columns 5-8 are the standard VIC baseflow parameters; NIJSSEN2001 = columns 5-8 of soil file are baseflow parameters from Nijssen et al (2001)
144144
JULY_TAVG_SUPPLIED FALSE # TRUE = final column of the soil parameter file will contain average July air temperature, for computing treeline; this will be ignored if COMPUTE_TREELINE is FALSE; FALSE = compute the treeline based on the average July air temperature of the forcings over the simulation period
145145
ORGANIC_FRACT FALSE # TRUE = simulate organic soils; soil param file contains 3*Nlayer extra columns, listing for each layer the organic fraction, and the bulk density and soil particle density of the organic matter in the soil layer; FALSE = soil param file does not contain any information about organic soil, and organic fraction should be assumed to be 0
146-
VEGPARAM (put the veg parameter path/file here) # Veg parameter path/file
147-
ROOT_ZONES 3 # Number of root zones (must match format of veg param file)
148146
#LAI_SRC FROM_VEGPARAM # FROM_VEGPARAM = read LAI from veg param file; FROM_VEGHIST = read LAI from veg_hist forcing file
149147
#ALB_SRC FROM_VEGPARAM # FROM_VEGPARAM = read ALBEDO from veg param file; FROM_VEGHIST = read ALBEDO from veg_hist forcing file
150148
#FCAN_SRC FROM_DEFAULT # FROM_DEFAULT = set all fcanopy values to 1.0; FROM_VEGPARAM = read FCANOPY from veg param file; FROM_VEGHIST = read FCANOPY from veg_hist forcing file
151-
SNOW_BAND 1 # Number of snow bands; if number of snow bands > 1, you must insert the snow band path/file after the number of bands (e.g. SNOW_BAND 5 my_path/my_snow_band_file)
149+
SNOW_BAND TRUE # TRUE if VIC should use snowbands in PARAMETERS file, else FALSE.
152150

153151
#######################################################################
154152
# Lake Simulation Parameters
155-
# These need to be un-commented and set to correct values only when running lake model (LAKES is not FALSE)
156153
#######################################################################
157-
#LAKES (put lake parameter path/file here) # Lake parameter path/file
154+
#LAKES TRUE # TRUE if VIC should use the lake module, else FALSE. Requires lake parameters in the PARAMETERS file.
158155
#LAKE_PROFILE FALSE # TRUE = User-specified depth-area parameters in lake parameter file; FALSE = VIC computes a parabolic depth-area profile
159156

160157
#######################################################################
-4.06 KB
Binary file not shown.

tests/examples/global_param.image.STEHE.feb.txt

+5-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ FROZEN_SOIL FALSE
1515

1616
AERO_RESIST_CANSNOW AR_406
1717

18-
DOMAIN $test_data_dir/image/Stehekin/parameters/domain.stehekin.20151028.nc
18+
DOMAIN $test_data_dir/image/Stehekin/parameters/domain.stehekin.20151028.nc
1919
DOMAIN_TYPE LAT lat
2020
DOMAIN_TYPE LON lon
2121
DOMAIN_TYPE MASK mask
@@ -24,22 +24,19 @@ DOMAIN_TYPE FRAC frac
2424
DOMAIN_TYPE YDIM lat
2525
DOMAIN_TYPE XDIM lon
2626

27-
FORCING1 $test_data_dir/image/Stehekin/forcings/Stehekin_image_test.forcings_10days.
27+
FORCING1 $test_data_dir/image/Stehekin/forcings/Stehekin_image_test.forcings_10days.
2828
FORCE_TYPE AIR_TEMP tas
2929
FORCE_TYPE PREC prcp
3030
FORCE_TYPE PRESSURE pres
3131
FORCE_TYPE SWDOWN dswrf
32-
FORCE_TYPE LWDOWN dlwrf
32+
FORCE_TYPE LWDOWN dlwrf
3333
FORCE_TYPE VP shum
3434
FORCE_TYPE WIND wind
3535
WIND_H 10.0
3636

37-
SOIL $test_data_dir/image/Stehekin/parameters/Stehekin_test_params_20160327.nc
37+
PARAMETERS $test_data_dir/image/Stehekin/parameters/Stehekin_test_params_20160327.nc
3838
NODES 3
39-
VEGPARAM $test_data_dir/image/Stehekin/parameters/Stehekin_test_params_20160327.nc
40-
ROOT_ZONES 3
41-
VEGLIB $test_data_dir/image/Stehekin/parameters/Stehekin_test_params_20160327.nc
42-
SNOW_BAND 1 $test_data_dir/image/Stehekin/parameters/Stehekin_test_params_20160327.nc
39+
SNOW_BAND TRUE
4340

4441
RESULT_DIR $result_dir
4542

tests/profiling/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
VIC Profiling Tests
2+
=======
3+
4+
These tests quantify the performance of VIC in terms of CPU/wall time and memory usage.

0 commit comments

Comments
 (0)