Commit 25ee3399 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Commented debug and boundary-check options for F90 compilation.

Prepared Environment for IDRIS.
parent 32b2f261
......@@ -14,15 +14,19 @@
# Functions
#
function hasanaconda (){
condahost="camelot climserv ciclad"
h=$(hostname)
res=1
for ch in ${condahost} ; do
if [ $(echo $h | grep ${ch} | wc -c) != "0" ] ; then
res=0
fi
done
return $res
ipsl="ipsl camelot climserv ciclad"
idris="idris jean-zay"
h=$(hostname -d)
if [[ "$h" == *"ipsl"* ]] ; then
echo "IPSL"
eval "$1='ipsl'"
elif [[ "$h" == *"idris"* ]] ; then
echo "IDRIS"
eval "$1='idris'"
else
echo "unknown : $h"
eval "$1='unknown'"
fi
}
function checkenv (){
rm -f checkenv.py
......@@ -48,30 +52,63 @@ EOF
#
# Main
#
if ( hasanaconda ) ; then
loc=''
hasanaconda loc
if [ loc != "unknown" ] ; then
#
# Make sure the right version of Python
#
module unload python
module load python/3.6-anaconda50
#
# Test if the MPI environment is installed.
#
if [ ! -e ${HOME}/.conda/envs/MPI ] ; then
#
# Create the MPI environment as it does not exist.
#
conda create -y -n MPI mpi4py numba astropy netcdf4 matplotlib basemap ConfigParser
source activate MPI
conda install -y cartopy
conda install -y --channel astropy spherical-geometry
fi
#
# Activate the MPI environment
#
source activate MPI
case $loc in
"ipsl")
module unload python
module load python/3.6-anaconda50
#
# Test if the MPI environment is installed.
#
if [ ! -e ${HOME}/.conda/envs/MPI ] ; then
#
# Create the MPI environment as it does not exist.
#
conda create -y -n MPI mpi4py numba astropy netcdf4 matplotlib basemap ConfigParser
source activate MPI
conda install -y cartopy
conda install -y --channel astropy spherical-geometry
else
source activate MPI
fi
;;
"idris")
module load python/3.7.3
if [[ -L ${HOME}/.conda && -d ${HOME}/.conda ]] ; then
if [ ! -e ${WORK}/.conda/envs/MPI ] ; then
conda create -y -n MPI mpi4py numba astropy netcdf4 matplotlib basemap ConfigParser cartopy
conda activate MPI
if [[ -L ${HOME}/.local && -d ${HOME}/.local ]] ; then
export PYTHONUSERBASE=$WORK/.local
if [ $(find $PYTHONUSERBASE -name spherical_geometry -ls | wc -l) -le 0 ] ; then
git clone https://github.com/spacetelescope/spherical_geometry.git
cd spherical_geometry
python setup.py install --user
fi
else
echo "Make sure \$HOME/.link is a link to your \$WORK/.local"
fi
else
conda activate MPI
fi
else
echo "Make sure \$HOME/.conda is a link to your \$WORK/.conda"
fi
;;
*)
echo "Environment for $loc is not foreseen yet"
exit
;;
esac
fi
#
# Verify we can load all the needed modules.
#
#
checkenv
......@@ -4,10 +4,10 @@ obj = defprec.o ioipsl.o constantes_var.o haversine.o grid.o routing_reg.o routi
#
FC = gfortran
FFLAG = -fPIC
FDBG = -g -fbounds-check
#FDBG = -g -fbounds-check
#
FPY = f2py
PDBG = --debug
#PDBG = --debug
#
all : routing_interface.so
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment