diff --git a/Environment b/Environment index 718631864a5b316c1a7aa081196f83793d68a871..804a8faac3faf28ca4a6b7af01e662f74b2588cb 100755 --- a/Environment +++ b/Environment @@ -14,16 +14,23 @@ # 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" + case $(hostname -d) in + climserv*|private.ipsl.fr|ipsl.polytechnique.fr) + echo "IPSL" + eval "$1='ipsl'" + ;; + idris*|jean-zay*) + echo "IDRIS" + eval "$1='idris'" + ;; + *) + echo "unknown machine : $(hostname -d)" + eval "$1='unknown'" + esac } + function checkenv (){ rm -f checkenv.py cat <<EOF > checkenv.py @@ -48,30 +55,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 diff --git a/F90subroutines/Makefile b/F90subroutines/Makefile index 602711b154971bfdd20b7b72011033a6c29e066f..43aad9f825d9d149fd5d9a40b03007b916094f9e 100644 --- a/F90subroutines/Makefile +++ b/F90subroutines/Makefile @@ -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