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

Travis CI integration #1

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .pytest_cache/v/cache/nodeids
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"tests/test_dummy.py::test_dummy"
]
60 changes: 60 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
os: trusty

before_install:
- sudo apt-get update
# Install MONC's dependencies
- sudo apt-get install -y mpich fftw3-dev
# Install MONC's python libraries
- sudo apt-get install -y python-numpy python-scipy python-matplotlib ipython ipython-notebook
# install pytest for running tests
- sudo apt-get install -y python-logilab-common
# Install HDF5 compiled for parallel use
- sudo apt-get install -y libhdf5-mpich2-dev
# Install GNU m4:
- sudo apt-get install -y m4

install:
- export NETCDF_C_VERSION=4.4.0
- export NETCDF_FORTRAN_VERSION=4.4.3
- export FCM_VERSION=2017.10.0
# Download:
- wget https://github.com/Unidata/netcdf-c/archive/v${NETCDF_C_VERSION}.tar.gz
- tar -xf v${NETCDF_C_VERSION}.tar.gz
- cd netcdf-c-${NETCDF_C_VERSION}/
# Configure:
- CC=mpicc CPPFLAGS=-I/usr/include/hdf5/mpich LDFLAGS=-L/usr/lib/x86_64-linux-gnu/hdf5/mpich ./configure --enable-parallel-tests --disable-dap --prefix=/usr
# Build and install:
# - make check
- sudo make install
# change directory to home
- cd
# Build NetCDF Fortran static libraries
# Download:
- wget https://github.com/Unidata/netcdf-fortran/archive/v${NETCDF_FORTRAN_VERSION}.tar.gz
- tar -xf v${NETCDF_FORTRAN_VERSION}.tar.gz
- cd netcdf-fortran-${NETCDF_FORTRAN_VERSION}/
# Configure:
- H5DIR=/usr
- NCDIR=/usr
- NFDIR=/usr
- ODIR=/usr
- CC=mpicc FC=mpif90 F77=mpif77 CPPFLAGS="-I${NCDIR}/include -I${H5DIR}/include/hdf5/mpich -I${ODIR}/include" LDFLAGS="-L${NCDIR}/lib -L${H5DIR}/lib/x86_64-linux-gnu/hdf5/mpich -L${ODIR}/lib" LD_LIBRARY_PATH=${NCDIR}/lib:${H5DIR}/lib:${ODIR}/lib LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz" ./configure --disable-shared --prefix=${NCDIR}
# Build and install:
# - make check
- sudo make install
# change directory to home
- cd
# Install FCM (used for compilation)
- wget https://github.com/metomi/fcm/archive/${FCM_VERSION}.tar.gz
- tar -xf ${FCM_VERSION}.tar.gz
- export PATH=`pwd`/fcm-${FCM_VERSION}/bin:$PATH
# Compile MONC with FCM
# change to where Travis has checked out our repository
- cd $TRAVIS_BUILD_DIR
- ls
- fcm make -f fcm-make/monc-ubuntu-14.04-gnu.cfg

script:
- pytest
# run straka test for now to ensure that MONC runs
- mpirun -np 4 build/bin/monc_driver.exe --config=tests/straka_short.mcf
Binary file added tests/__pycache__/test_dummy.cpython-27-PYTEST.pyc
Binary file not shown.
128 changes: 128 additions & 0 deletions tests/straka_short.mcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Global configuration
global_configuration=global_config

# Override global component defaults
fftsolver_enabled=.true.
iterativesolver_enabled=.false.
pw_advection_enabled=.true.
tvd_advection_enabled=.true.
simplesetup_enabled=.true.
smagorinsky_enabled=.true.
lower_bc_enabled=.true.
setfluxlook_enabled=.true. #This must be set to true if running with lower_bc
viscosity_enabled=.true.
diffusion_enabled=.true.
simplecloud_enabled=.false.
coriolis_enabled=.false.
damping_enabled=.false.
forcing_enabled=.false.
galilean_transformation=.false. # Needs debugging
randomnoise_enabled=.false.
mean_profiles_enabled=.true. #This must be set to true if running with damping
th_advection_enabled=.false.
cfltest_enabled=.false. # Make sure we set a sensible initial timestep
iobridge_enabled=.true.
scalar_diagnostics_enabled=.true.
profile_diagnostics_enabled=.true.

# Test case source code
tank_experiments_enabled=.true.

# Add bubble to initialisation
initialisation_stage_ordering+=tank_experiments
dynamics_group_contents=kidtestcase, pw_advection, tvd_advection, th_advection, diffusion, viscosity, coriolis, buoyancy, damping, forcing, set_consistent_lowbc, tank_experiments, lwrad_exponential, simplecloud, casim,diverr, psrce, flux_budget, diagnostics, profile_diagnostics, scalar_diagnostics, stepfields

# IO server configuration
ioserver_configuration_file="io/io_cfg_files/data_write_1file.xml"
moncs_per_io_server=3
sampling_frequency=4
3d_sampling_frequency=20
mm=5.0
mm1=5.0
diag_write_freq=900.0

#Advection
advection_flow_fields=tvd
advection_theta_field=tvd
advection_q_fields=tvd

# Control configuration
display_synopsis_frequency=100
cfl_frequency=2
termination_time=100.
dtm=.25

# Checkpoint configuration
checkpoint_frequency=0
checkpoint_file="straka_dump.nc"
checkpoint_walltime_frequency=10
walltime_limit=00:30:00

# iterative solver
tolerance=1.e-5
max_iterations=500
preconditioner_iterations=0
include_top_level=.false.
symm_prob=.false.

# CFL configuration
cfl_frequency=10
cfl_cvismax=0.2
cfl_cvelmax=0.2
cfl_dtmmax=30.
cfl_dtmmin=0.001

# Simple setup configuration
thref0=300.0
surface_pressure=100000.
surface_reference_pressure=100000.
x_size=2
y_size=512
z_size=65
dxx=100
dyy=100
zztop=6400.0
kgd=1,65
hgd=0.0, 6400.0
rmlmax=50.

enable_theta=.true.
number_q_fields=0
use_anelastic_equations=.true.
origional_vertical_grid_setup=.true.
passive_th=.false.
passive_q=.true.
backscatter=.false.
use_viscosity_and_diffusion=.true.
use_surface_fluxes=.false.
use_time_varying_surface_values=.false.

# Initialization of fields
l_init_pl_theta=.true.
z_init_pl_theta=0.0, 6400.
f_init_pl_theta=300., 300.
l_init_pl_u=.false.
l_init_pl_v=.false.
l_init_pl_q=.false.

l_matchthref=.false.

# Set up the tank

l_bubbles=.true.
l_splittank=.false.
l_sources=.false.
l_bubble_straka=.true.

bubble_x_cen=0.0
bubble_y_cen=25600.0
bubble_z_cen=3000.0
bubble_x_rad=6000000.0
bubble_y_rad=4000.0
bubble_z_rad=2000.0
l_bubble_use_t=.true.
#bubble_th_pert=-0.01
bubble_t_pert=-15.
bubble_edge=0.0
bubble_lrandom=.false.
bubble_lmoist=.false.
2 changes: 2 additions & 0 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_dummy():
pass