Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
IPSL
LMD
InTro
RoutingPP
Commits
2ae87fc1
Commit
2ae87fc1
authored
Oct 15, 2021
by
Anthony
Browse files
Add run.def for HydroLakes and Environment file
parent
36a5f672
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
127 additions
and
0 deletions
+127
-0
Tools/HydroDATA_shapefile/Environment_GEOM
Tools/HydroDATA_shapefile/Environment_GEOM
+104
-0
Tools/HydroDATA_shapefile/run.def.HydroLakes
Tools/HydroDATA_shapefile/run.def.HydroLakes
+23
-0
No files found.
Tools/HydroDATA_shapefile/Environment_GEOM
0 → 100755
View file @
2ae87fc1
#!/bin/bash
#
#########################################
#
# Script to build and maintain en environment to run
# the python code in this directory. We verify that
# all needed packages are available.
# This is based on the anaconda python system : https://www.anaconda.com/distribution/
#
# Usage : source Environment
#
#########################################
#
# Functions
#
function
hasanaconda
(){
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
from osgeo import ogr
import netCDF4
import configparser
import numba
import pyproj
print ("OK")
EOF
python checkenv.py
>
/dev/null
if
[
$?
-gt
0
]
;
then
echo
"Environment not OK. Some packages must be missing."
echo
"This was tested with the checkenv.py code."
else
rm
-f
checkenv.py
fi
}
#
# Main
#
loc
=
''
hasanaconda loc
if
[
loc
!=
"unknown"
]
;
then
#
# Make sure the right version of Python
#
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/GEOM
]
;
then
#
# Create the MPI environment as it does not exist.
#
conda create
-y
-n
GEOM
-c
conda-forge
python
=
3.7.
*
cython GDAL pyproj rasterio configparser netcdf4 numba shapely pip
source
activate GEOM
pip
install
argparse
else
source
activate GEOM
fi
;;
"idris"
)
module load python/3.7.3
if
[[
-L
${
HOME
}
/.conda
&&
-d
${
HOME
}
/.conda
]]
;
then
if
[
!
-e
${
WORK
}
/.conda/envs/GEOM
]
;
then
conda create
-y
-n
GEOM
-c
conda-forge
python
=
3.7.
*
cython GDAL pyproj rasterio configparser netcdf4 numba shapely pip
conda activate GEOM
pip
install
argparse
else
conda activate GEOM
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
Tools/HydroDATA_shapefile/run.def.HydroLakes
0 → 100644
View file @
2ae87fc1
[OverAll]
#
EarthRadius = 6370000.
#
# If Debug = True, there will not have overlap calculation (everything = 1)
# Quicker because it s the heavier step, allow to check if everything works
#
Debug = False
# [DEF] input_type : geogrid, hydro
#
input_type = hydro
dinput = /bdd/ORCHIDEE_Forcing/Routing/Hydro4ORCH/MERIT_Global.nc
# output file direction
doutput = ./MERIT_frac_lakes.nc
# Shapefile direction
shpdir = /homedata/aschrapffer/TODEMTOOLS/HydroLAKES_polys_v10_shp/HydroLAKES_polys_v10.shp
# Name of the output variable
varnamefrac = lake_frac
varnameid = lake_id
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment