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

Setup continuous integration #1

Closed
wants to merge 5 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
46 changes: 46 additions & 0 deletions .github/workflows/conda-and-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build/Test CI

on: [push, pull_request]

jobs:
build-linux-and-macos:
runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8"]
build-type: [Release]

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: true

- name: Show conda installation info
run: conda info

- name: Install build tools and dependencies into env
run: |
conda install --file=requirements.txt
conda list

- name: Make cmake build directory
run: cmake -E make_directory build

- name: Configure cmake
working-directory: ${{ github.workspace }}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}

- name: Build
working-directory: ${{ github.workspace }}/build
run: cmake --build . --config ${{ matrix.build-type }}
69 changes: 68 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,69 @@
# CDM_v2.48
# Coastal Dune Model

Coastal Dune Model that includes updated vegetation and wrack dynamics.


## Install

### Prerequisites

To install the Coastal Dune Model from source, you will need to install some
prerequisite packages.
* A C++ compiler
* CMake
* FFTW

If you are using Anaconda, these can be installed through the *conda* command.

$ conda create -n cdm --file=requirements.txt
$ conda activate cdm

This creates a new conda environment, *cdm*, with all of the prequisite packages
installed.

### Compile

To build and install cmake, run

$ mkdir _build && cd _build
$ cmake ../src -DCMAKE_INSTALL_PREFIX=<path-to-installation>
$ make -j4
$ make install

where `<path-to-installation>` is the base directory in which the Coastal Dune
Model will be installed (`/usr/local` is the default).

## Use

With the Coastal Dune Model installed following the above instructions, you
can run it with the *coastal-dune-model* executable that was installed in
`<path-to-installation>/bin`. If this folder is in your *PATH*,

$ coastal-dune-model params.par

## References

Biel, R. G., Moore, L. J., and Goldstein, E. B. (submitted). Influence of wrack on dune forma-
tion.Journal of Geophysical Research: Biogeosciences.

Biel, R. G., Moore, L. J., Zinnert, J., and Brown, J. (in prep.). Inhibition or facilitation of
dune development on barriers: The influence of back-beach vegetation on barrier island sta-
ble states.Journal of Geophysical Research: Biogeosciences.

Duran, O. and Moore, L. J. (2013). Vegetation controls on the maximum size of coastal dunes.
Proceedings of the National Academy of Sciences, 110(43):17217–17222.

Duran, O., Parteli, E. J., and Herrmann, H. J. (2010). A continuous model for sand dunes:
Review, new developments and application to barchan dunes and barchan dune fields.Earth
Surface Processes and Landforms, 35(13):1591–1600.

Duran Vinent, O. and Moore, L. J. (2015). Barrier island bistability induced by biophysical
interactions.Nature Clim. Change, 5(2):158–162.

Moore, L. J., Vinent, O. D., and Ruggiero, P. (2016). Vegetation control allows autocyclic
formation of multiple dunes on prograding coasts.Geology, 44(7):559–562.

Weng, W. S., Hunt, J. C. R., Carruthers, D. J., Warren, A., Wiggs, G. F. S., Livingstone, I.,
and Castro, I. (1991). Air flow and sand transport over sand-dunes. In Barndorff-Nielsen,
O. E. and Willetts, B. B., editors,Aeolian Grain Transport, pages 1–22, Vienna. Springer
Vienna.
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cmake
cxx-compiler
fftw
pkg-config
46 changes: 46 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 3.0)

project (cdm CXX)

set (CDM_VERSION 3.0)

find_package(PkgConfig REQUIRED)
pkg_check_modules(FFTW3 REQUIRED IMPORTED_TARGET fftw3)
include_directories(${FFTW3_INCLUDE_DIRS})
link_directories(${FFTW3_LIBRARY_DIRS})

set(
CDM_SRCS
PTG_Func2dScalar.cc
PTG_Func2dVec.cc
analyze_new.cc
avalanche.cc
dune_evolution.cc
evolution.cc
flux_stationary.cc
func.cc
globals.cc
influx.cc
initsurf.cc
initsurfalea.cc
initsurfbeach.cc
iter_aval_new.cc
rfftw12d.cc
rotatematrix.cc
save.cc
sepbubble.cc
shear.cc
shear_hlr.cc
shore.cc
storm.cc
vegetation.cc
wind.cc
)

add_executable(coastal-dune-model main.cc ${CDM_SRCS})
target_link_libraries(coastal-dune-model fftw3)

install(
TARGETS coastal-dune-model
RUNTIME DESTINATION bin
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.