Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
49 changes: 24 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/OpenDA-Association/OpenDA.svg?branch=master)](https://travis-ci.org/OpenDA-Association/OpenDA)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e78fb37c00fa4d689eb3a40d4b786d94)](https://www.codacy.com/app/OpenDA_Association/OpenDA?utm_source=github.com&utm_medium=referral&utm_content=OpenDA-Association/OpenDA&utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/465833e082b54b279105a280b36c75b8)](https://www.codacy.com/gh/OpenDA-Association/OpenDA?utm_source=github.com&utm_medium=referral&utm_content=OpenDA-Association/OpenDA&utm_campaign=Badge_Grade)

# OpenDA

Expand All @@ -12,35 +12,34 @@ OpenDA is an Open Source project. Contributions are welcome from anyone wishing

Data-assimilation methods

- Ensemble KF (EnKF)
- Ensemble SquareRoot KF (EnSR)
- Steady State KF
- Particle Filter
- 3DVar
- DudEnKF (still under research)
- DudEnSR (still under research)
- Ensemble KF (EnKF)
- Ensemble SquareRoot KF (EnSR)
- Steady State KF
- Particle Filter
- 3DVar
- DudEnKF (still under research)
- DudEnSR (still under research)

Parameter estimation (calibration) methods:

- Dud
- Sparse Dud
- Simplex
- Powell
- Gridded full search
- Shuffled Comples Evolution (SCE)
- Generalized Likelihood Uncertainty Estimation (GLUE)
- (L)BFGS
- Conjugate Gradient: Fleetjer-Reeves, Polak-Ribiere, Steepest Descent
- Uncertainty Analaysis methods
- GLUE
- DELSA
- Dud
- Sparse Dud
- Simplex
- Powell
- Gridded full search
- Shuffled Comples Evolution (SCE)
- Generalized Likelihood Uncertainty Estimation (GLUE)
- (L)BFGS
- Conjugate Gradient: Fleetjer-Reeves, Polak-Ribiere, Steepest Descent
- Uncertainty Analaysis methods
- GLUE
- DELSA

Language interfaces

- C/C++
- Java
- Fortran77/90
- C/C++
- Java
- Fortran77/90

These files are part of the OpenDA software. For more information see our website at
http://www.openda.org

<http://www.openda.org>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/
package org.openda.algorithms;

import org.openda.interfaces.*;
import org.openda.interfaces.IStochVector;
import org.openda.interfaces.IVector;

public interface LeastSquaresCostFunction extends ICostFunction{

Expand All @@ -43,7 +44,7 @@ public interface LeastSquaresCostFunction extends ICostFunction{

/**
* Use background term for cost function, i.e. add Jb = (p-p0)'/B(p-p0)
* @param boolean to turn backgroundterm on(true) of off(false)
* @param onIsTrue to turn backgroundterm on(true) of off(false)
*/
public abstract void setBackgroundTerm(boolean onIsTrue);

Expand Down
321 changes: 321 additions & 0 deletions checkstyle.xml

Large diffs are not rendered by default.

77 changes: 48 additions & 29 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Contributing to OpenDA

This document briefly describes the policy for contributing changes to OpenDA.
Expand All @@ -9,8 +8,9 @@ share your code with the OpenDA community this document applies.
## Share your code with the OpenDA community

For OpenDA we distinguish two methods for contributing:
1. Create a fork on github and then a pull request. When you contribute for the first time, then this is probably what you want.
2. Ask a core-developer of OpenDA to create a branch where you can push you contributions. If you do not know who the core-developers of OpenDA are then you can contact one at info@openda.org

1. Create a fork on github and then a pull request. When you contribute for the first time, then this is probably what you want.
2. Ask a core-developer of OpenDA to create a branch where you can push you contributions. If you do not know who the core-developers of OpenDA are then you can contact one at info@openda.org

## Repository structure

Expand All @@ -19,34 +19,53 @@ As a general rule all code changes are first committed to a branch. These branch
## Step by step

### Fork scenario
1. Create a fork on github
2. Clone your newly created fork `git clone https://github.com/<your account>/OpenDA.git`
3. Create a branch with a name that describes your intended developments. `git checkout -b my_branch`
4. Write and test your code in your branch.
5. Commit to your local copy and push to your fork of OpenDA
* `git add bla`
* `git commit -m "my description"`
* `git push origin my_branch`
6. Once finished or more regularly: merge changes in OpenDA into your work
* Update your fork of OpenDA on github
* `git fetch origin master` to update your local copy (from your fork)
* `git merge master`
7. Push changes to the server again `git push origin my_branch` (to your fork)
8. Create a pull request on github

1. Create a fork on github

2. Clone your newly created fork `git clone https://github.com/<your account>/OpenDA.git`

3. Create a branch with a name that describes your intended developments. `git checkout -b my_branch`

4. Write and test your code in your branch.

5. Commit to your local copy and push to your fork of OpenDA

- `git add bla`
- `git commit -m "my description"`
- `git push origin my_branch`

6. Once finished or more regularly: merge changes in OpenDA into your work

- Update your fork of OpenDA on github
- `git fetch origin master` to update your local copy (from your fork)
- `git merge master`

7. Push changes to the server again `git push origin my_branch` (to your fork)

8. Create a pull request on github

### Directly on main repository scenario
1. Clone your OpenDA repository `git clone https://github.com/OpenDA-Association/OpenDA.git`
3. Create a branch with a name that describes your intended developments. `git checkout -b my_branch`
4. Write and test your code in your branch.
5. Commit to local copy and push to your fork of OpenDA
* `git add bla`
* `git commit -m "my description"`
* `git push origin my_branch`
6. Once finished or more regularly: merge changes in OpenDA into your work
* `git fetch origin master` to update your local copy
* `git merge master`
7. Push changes to OpenDA on github again `git pus origin my_branch`
8. Create a pull request on github

1. Clone your OpenDA repository `git clone https://github.com/OpenDA-Association/OpenDA.git`

2. Create a branch with a name that describes your intended developments. `git checkout -b my_branch`

3. Write and test your code in your branch.

4. Commit to local copy and push to your fork of OpenDA

- `git add bla`
- `git commit -m "my description"`
- `git push origin my_branch`

5. Once finished or more regularly: merge changes in OpenDA into your work

- `git fetch origin master` to update your local copy
- `git merge master`

6. Push changes to OpenDA on github again `git pus origin my_branch`

7. Create a pull request on github

## Questions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
public class AsciiKeywordDataObject implements IDataObject{

private static final Logger logger = LoggerFactory.getLogger(AsciiKeywordDataObject.class);
MessageFormat logFormatter = new MessageFormat("");
private MessageFormat logFormatter = new MessageFormat("");

private String fileName = null;
private static final String keyWordPrefix ="#oda:";
Expand Down Expand Up @@ -230,9 +230,7 @@ public void finish() {
//write to file
File outputFile = new File(fileName);
try{
if(outputFile.isFile()){
if ( ! outputFile.delete() ) throw new RuntimeException("Cannot delete " + outputFile);
}
if(outputFile.isFile() && ! outputFile.delete() ) throw new RuntimeException("Cannot delete " + outputFile);
}catch (Exception e) {
logger.error("DictionaryDataObject: trouble removing file " + this.fileName +" :\n" + e.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash

echo "compute.sh on instanceDir" $1
echo "compute.sh on instanceDir $1"
echo "compute on instanceDir" $1 > compute-out.txt

echo "COMPLETED" >> compute-out.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash

echo "compute.sh on instanceDir" $1
echo "compute on instanceDir" $1 > compute-out.txt
echo "compute.sh on instanceDir" "$1"
echo "compute on instanceDir" "$1" > compute-out.txt

echo "COMPLETED" >> compute-out.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash

echo "compute.sh on instanceDir" $1
echo "compute on instanceDir" $1 > compute-out.txt
echo "compute.sh on instanceDir" "$1"
echo "compute on instanceDir" "$1" > compute-out.txt

echo "COMPLETED" >> compute-out.txt
4 changes: 2 additions & 2 deletions core/native/install_cygwin_dll.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
cygdlls=$(ls .libs/cyg*.dll 2>/dev/null)
if [ x$cygdlls != x ]; then
cp $cygdlls $2
if [ "x$cygdlls" != x ]; then
cp "$cygdlls" "$2"
fi
26 changes: 13 additions & 13 deletions core/native/linux_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ else
fi
fi
#defaults for 64/32bit (=look at architecture of this computer)
export RAWARCH=`uname -m`
export RAWARCH=$(uname -m)
if [ "$RAWARCH" == "x86_64" ]; then
export ARCH=64
else
Expand All @@ -56,11 +56,11 @@ export IGNORENETCDF="no"

#test for windows mingw
export OSTYPE="unknown"
export TMPVAR=`uname -s|grep -i mingw`
export TMPVAR=$(uname -s|grep -i mingw)
if [ ! -z "$TMPVAR" ]; then
OSTYPE="win"
fi
export TMPVAR=`uname -s|grep -i linux`
export TMPVAR=$(uname -s|grep -i linux)
if [ ! -z "$TMPVAR" ]; then
OSTYPE="linux"
fi
Expand Down Expand Up @@ -102,7 +102,7 @@ if [ "$FORT" == "ifort" ];then
fi
fi
if [ "$FORT" == "gnu" ];then
export GFORTRANPATH=`which gfortran 2>/dev/null`
export GFORTRANPATH=$(which gfortran 2>/dev/null)
if [ ! -z "$GFORTRANPATH" ]; then
export MYFORT="$GFORTRANPATH"
else
Expand Down Expand Up @@ -133,7 +133,7 @@ if [ -z "$NETCDF_ROOT" ]; then
echo "Netcdf already compiled"
else
echo "Starting compilation of Netcdf"
pushd $BASE/external/netcdf
pushd "$BASE/external/netcdf"
./netcdf_install.sh $ARCH $FORT shared | tee netcdf_install.log
popd
fi
Expand All @@ -156,7 +156,7 @@ if [ -z "$MPI_ROOT" ]; then
echo "Mpich2 already compiled"
else
echo "Starting compilation of mpich2"
pushd $BASE/external/mpi
pushd "$BASE/external/mpi"
./mpi_install.sh $ARCH $FORT shared | tee mpi_install.log
popd
fi
Expand Down Expand Up @@ -189,8 +189,8 @@ fi
#
# OpenDA settings
#
pushd $BASE
$BASE/autoreconf_fix.sh
pushd "$BASE"
"$BASE/autoreconf_fix.sh"
popd

# compile in a temporary direcory to avoid mixing sources and objects
Expand All @@ -214,7 +214,7 @@ else
fi

if [ -d "$BASE/$SYSTEM" ];then
rm -rf $BASE/$SYSTEM
rm -rf "$BASE/$SYSTEM"
fi


Expand Down Expand Up @@ -247,10 +247,10 @@ if [ ! -d "$BASE/../native_bin/$SYSTEM" ]; then
mkdir -p $BASE/../native_bin/$SYSTEM
fi
#mpi
rsync -ruav $BASE/external/mpi/$SYSTEM/ $BASE/../native_bin/$SYSTEM/
rsync -ruav "$BASE/external/mpi/$SYSTEM/ $BASE/../native_bin/$SYSTEM/"
#workaround: !!! teamcity does not like +'s and mpicxx is indentical
rm -f $BASE/../native_bin/$SYSTEM/bin/mpic++
rm -f "$BASE/../native_bin/$SYSTEM/bin/mpic++"
#netcdf
rsync -ruav $BASE/external/netcdf/$SYSTEM/ $BASE/../native_bin/$SYSTEM/
rsync -ruav "$BASE/external/netcdf/$SYSTEM/ $BASE/../native_bin/$SYSTEM/"
#openda
rsync -ruav $BASE/$SYSTEM/ $BASE/../native_bin/$SYSTEM/
rsync -ruav "$BASE/$SYSTEM/ $BASE/../native_bin/$SYSTEM/"
4 changes: 2 additions & 2 deletions core/native/src/cta/cta_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void * CTA_Malloc(size_t size){
void *ptr = malloc(size);
#ifdef DEBUG
if (! ptr){
printf("CTA_Malloc: Warning: malloc returns NULL. (size=%zd)\n",size);
printf("CTA_Malloc: Warning: malloc returns NULL. (size=%zu)\n",size);
}
else {
// memset(ptr,'@', size);
Expand All @@ -49,7 +49,7 @@ void * CTA_Realloc(void *ptr, size_t size){
void *ptrOut = realloc(ptr, size);
#ifdef DEBUG
if (! ptrOut){
printf("CTA_Malloc: Warning: malloc returns NULL. (size=%zd)\n",size);
printf("CTA_Malloc: Warning: malloc returns NULL. (size=%zu)\n",size);
}
#endif
return ptrOut;
Expand Down
4 changes: 2 additions & 2 deletions core/native/update_simona.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ if [ check_env ] ; then
do
for file in $group.a $group.la $group.so $group.so.0 $group.so.0.0.0
do
if [ -e $ODA_COSTA_LIB/$file ] ; then
if [ -e "$ODA_COSTA_LIB/$file" ] ; then
cp -vfup "$ODA_COSTA_LIB/$file" "$SIM_COSTA_LIB/$file.$UI_NAME"
fi
done
done

# Perform a simake.pl in the src/external/costa directory
echo "Running simake.pl..."
cd $SIM_COSTA
cd "$SIM_COSTA"
simake.pl
fi

4 changes: 2 additions & 2 deletions core/tests/native_advec1d/clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
rm -f openda_logfile.txt
rm *_results.m
rm -f *.log
rm ./*_results.m
rm -f ./*.log
4 changes: 2 additions & 2 deletions core/tests/native_heat/clean.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/sh

rm -f *_results.m
rm -f *.log
rm -f ./*_results.m
rm -f ./*.log
rm -f openda_logfile.txt
rm -rf enkf_nc/*
rm -rf denkf_nc/*
Expand Down
8 changes: 4 additions & 4 deletions core/tests/native_oscillator/clean.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/bash
rm -f *-results.txt
rm -f *_results.m
rm -f ./*-results.txt
rm -f ./*_results.m
rm -f openda_logfile.txt
rm -f *.log
rm -f *.orp
rm -f ./*.log
rm -f ./*.orp
rm -f netcdf_output/*.nc
4 changes: 2 additions & 2 deletions core/tests/native_parallel/masterworker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ "$BINDIR" == "not set" ]; then
fi

mpiexec -np 2 Application.sh -p PolluteEnKFOpenDaConfigMW.oda : \
-np 2 $BINDIR/pollute2d_worker pollute2d_worker_config.xml : \
-np 2 "$BINDIR/pollute2d_worker pollute2d_worker_config.xml" : \
-np 1 Application.sh -p PolluteEnKFOpenDaConfigMW.oda : \
-np 2 $BINDIR/pollute2d_worker pollute2d_worker_config.xml
-np 2 "$BINDIR/pollute2d_worker pollute2d_worker_config.xml"

Loading