Skip to content

Commit aa0f335

Browse files
authored
Merge pull request #534 from UW-Hydro/develop
VIC 5.0.0-rc1
2 parents 7c3556b + dc56d48 commit aa0f335

File tree

771 files changed

+74221
-178439
lines changed

Some content is hidden

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

771 files changed

+74221
-178439
lines changed

.gitignore

+20-1
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,32 @@
88
*.lib
99
*.a
1010

11+
# Build process
12+
.depend
13+
.cache
14+
build/
15+
dist/
16+
vic_headers.py
17+
1118
# Shared objects (inc. Windows DLLs)
1219
*.dll
1320
*.so
1421
*.so.*
1522
*.dylib
23+
*.dSYM
24+
*.mod
1625

1726
vicNl
27+
vic_classic
28+
vic_image
29+
liblnd.a
30+
_vic.py
1831

1932
.DS_Store
20-
site/
33+
TAGS
34+
35+
*egg-info*
36+
37+
# Python stuff
38+
.ipynb_checkpoints
39+
.eggs

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "samples/data"]
2+
path = samples/data
3+
url = https://github.com/UW-Hydro/VIC_sample_data.git

.travis.yml

+89-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,90 @@
11
language: c
2-
compiler: gcc
3-
script: make -C src/
2+
sudo: false # use container based build
3+
notifications:
4+
email: false
5+
6+
matrix:
7+
fast_finish: true
8+
include:
9+
# Image Driver
10+
- compiler: gcc
11+
os: linux
12+
env: TESTID='image'
13+
addons:
14+
apt_packages:
15+
- libnetcdf-dev
16+
- gfortran
17+
- valgrind
18+
# open-mpi is built from source in image.travis
19+
# CESM Driver
20+
- compiler: gcc
21+
os: linux
22+
env: TESTID='cesm'
23+
addons:
24+
apt_packages:
25+
- libnetcdf-dev
26+
- gfortran
27+
# open-mpi is built from source in cesm.travis
28+
# Classic Driver
29+
- compiler: clang
30+
os: linux
31+
env: TESTID='classic'
32+
addons:
33+
apt_packages:
34+
- valgrind
35+
sources:
36+
- ubuntu-toolchain-r-test
37+
- compiler: gcc
38+
os: linux
39+
env: TESTID='classic'
40+
addons:
41+
apt_packages:
42+
- valgrind
43+
sources:
44+
- ubuntu-toolchain-r-test
45+
- compiler: gcc
46+
os: linux
47+
env: TESTID=classic USE_CC=gcc-5
48+
addons:
49+
apt:
50+
packages:
51+
- gcc-5
52+
- gcc-5-multilib
53+
- linux-libc-dev:i386
54+
- valgrind
55+
sources:
56+
- ubuntu-toolchain-r-test
57+
- compiler: clang
58+
os: linux
59+
env: TESTID=classic USE_CC=clang-3.6
60+
addons:
61+
apt:
62+
packages:
63+
- clang-3.6
64+
- valgrind
65+
sources:
66+
- llvm-toolchain-precise-3.6
67+
- ubuntu-toolchain-r-test
68+
- compiler: gcc
69+
os: osx
70+
env: TESTID=classic BREW_INSTALLS=valgrind
71+
allow_failures:
72+
# OSX build moved to allowed failures because throughput was so slow on travis
73+
- compiler: gcc
74+
os: osx
75+
env: TESTID=classic BREW_INSTALLS=valgrind
76+
before_install:
77+
- source ci/vic_install_utils
78+
- source ci/${TESTID}.travis
79+
- install_miniconda
80+
- vic_before_install
81+
install:
82+
- vic_install
83+
before_script:
84+
- vic_before_script
85+
script:
86+
- vic_script
87+
after_success:
88+
- vic_after_success
89+
after_failure:
90+
- vic_after_failure

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ If you think you have found a bug in VIC, please file an issue on Github [here](
4242

4343
If you can provide more information that is great. If you know how to run the model in a debugger, you may be able to pinpoint where the problem occurs.
4444

45-
#### Requesting New features
45+
#### Proposing New Features
4646

4747
The VIC model is under active development. If you would like to propose a new feature, driver, or extension to the VIC model, please raise a Github issue [here](https://github.com/UW-Hydro/VIC/issues). Also, because VIC is an open source model with no official support for development, be prepared to contribute to the implementation of your feature request. Also note that features that are only of interest to you are unlikely to be implemented in the main source code repo (although you are of course free to modify the code in any way you see fit).
4848

ci/Dockerfile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM ubuntu:trusty
2+
3+
# Get the basic VIC dependencies
4+
RUN apt-get update -q && \
5+
apt-get install -y -q --no-install-recommends \
6+
ca-certificates \
7+
build-essential \
8+
ssh \
9+
netcdf-bin \
10+
libnetcdf-dev \
11+
libopenmpi-dev \
12+
openmpi-bin \
13+
git \
14+
make
15+
16+
# Dedicated work directory for output
17+
ENV WORKDIR $HOME/workdir
18+
RUN mkdir -p $WORKDIR
19+
20+
# Put the UW-Hydro version of VIC in the container
21+
RUN git clone https://github.com/UW-Hydro/VIC.git
22+
23+
# Command to run when this image is "run", just build the classic and image drivers
24+
CMD git checkout develop && \
25+
git pull origin develop && \
26+
cd VIC/vic/drivers/classic && \
27+
make && \
28+
./vic_classic.exe -o && \
29+
cd ../image && \
30+
make && \
31+
./vic_image.exe -o

ci/cesm.travis

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
DRIVER_PATH="./vic/drivers/cesm/"
6+
DRIVER_LIB="${DRIVER_PATH}lndlib.a"
7+
8+
function vic_before_install {
9+
echo vic_before_install
10+
echo $PATH
11+
if [ ! -z "$USE_CC" ]; then
12+
echo "export CC=$USE_CC"
13+
export CC=$USE_CC;
14+
$CC --version
15+
fi
16+
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
17+
echo "Testing on osx"
18+
if [ ! -z "$BREW_TAPS" ]; then
19+
for tap in $BREW_TAPS
20+
do
21+
brew tap $tap
22+
done
23+
fi
24+
if [ ! -z "$BREW_INSTALLS" ]; then
25+
brew update
26+
for pkg in $BREW_INSTALLS
27+
do
28+
brew outdated $pkg || brew upgrade $pkg || brew install $pkg
29+
brew link $pkg
30+
done
31+
fi
32+
export TRAVIS_NETCDFPATH=/usr/local
33+
export TRAVIS_MPIPATH=/usr/local
34+
else
35+
export TRAVIS_NETCDFPATH=/usr
36+
export TRAVIS_MPIPATH="${HOME}/mpich"
37+
38+
# Install MPICH
39+
if [ ! -d ${TRAVIS_MPIPATH} ]; then
40+
install_mpich
41+
else
42+
echo "MPICH installed..."
43+
fi
44+
find ${TRAVIS_MPIPATH} -name mpiexec
45+
find ${TRAVIS_MPIPATH} -name mpicc
46+
fi
47+
48+
}
49+
50+
function vic_install {
51+
echo vic_install
52+
cd ${TRAVIS_BUILD_DIR}
53+
echo $PWD
54+
make full -C $DRIVER_PATH
55+
}
56+
57+
function vic_before_script {
58+
echo vic_before_script
59+
if [ ! -f $DRIVER_LIB ]; then
60+
echo "Library (${DRIVER_LIB}) not found!"
61+
exit 1
62+
fi
63+
}
64+
65+
function vic_script {
66+
echo vic_script
67+
nm ${DRIVER_LIB}
68+
69+
# Run test package
70+
./tests/run_tests.py unit
71+
}
72+
73+
function vic_after_success {
74+
echo vic_after_success
75+
echo "Success!"
76+
}
77+
78+
function vic_after_failure {
79+
echo vic_after_failure
80+
echo "Test failed -- please review the log"
81+
}

ci/classic.travis

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
DRIVER_PATH="${TRAVIS_BUILD_DIR}/vic/drivers/classic/"
6+
DRIVER_EXE="${DRIVER_PATH}vic_classic.exe"
7+
SAMPLES_PATH="${TRAVIS_BUILD_DIR}/samples/"
8+
9+
function vic_before_install {
10+
echo vic_before_install
11+
echo $PATH
12+
if [ ! -z "$USE_CC" ]; then
13+
echo "export CC=$USE_CC"
14+
export CC=$USE_CC;
15+
$CC --version
16+
fi
17+
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
18+
echo "Testing on osx"
19+
if [ ! -z "$BREW_TAPS" ]; then
20+
for tap in $BREW_TAPS
21+
do
22+
brew tap $tap
23+
done
24+
fi
25+
if [ ! -z "$BREW_INSTALLS" ]; then
26+
brew update
27+
for pkg in $BREW_INSTALLS
28+
do
29+
brew outdated $pkg || brew upgrade $pkg || brew install $pkg
30+
brew link $pkg
31+
done
32+
fi
33+
fi
34+
}
35+
36+
function vic_install {
37+
echo vic_install
38+
$CC --version
39+
which $CC
40+
type $CC
41+
make full -C $DRIVER_PATH
42+
}
43+
44+
function vic_before_script {
45+
echo vic_before_script
46+
if [ ! -f $DRIVER_EXE ]; then
47+
echo "Executable (${DRIVER_EXE}) not found!"
48+
exit 1
49+
fi
50+
51+
echo "Getting sample data"
52+
bash ${SAMPLES_PATH}/get_sample_data.bash
53+
}
54+
55+
function vic_script {
56+
echo vic_script
57+
$DRIVER_EXE -v
58+
$DRIVER_EXE -o
59+
60+
# Run test package
61+
./tests/run_tests.py unit examples system \
62+
--vic_exe=${DRIVER_EXE} \
63+
--driver=${TESTID} \
64+
--data_dir=${SAMPLES_PATH}/data
65+
66+
}
67+
68+
function vic_after_success {
69+
echo vic_after_success
70+
echo "Success!"
71+
}
72+
73+
function vic_after_failure {
74+
echo vic_after_failure
75+
echo "Test failed -- please review the log"
76+
}

0 commit comments

Comments
 (0)