[4210] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | #set -vx |
---|
| 4 | |
---|
| 5 | ########################################################################### |
---|
| 6 | # Author : Laurent Fairhead et Frédéric Hourdin |
---|
| 7 | # Usage : install_lmdz.sh -help |
---|
| 8 | # |
---|
| 9 | # bash installation script of the LMDZ model on different computer types : |
---|
| 10 | # Linux PC, "mesocentre" (IPSL-UPMC, IPSL-X), super-computer (IDRIS) |
---|
| 11 | # |
---|
| 12 | # The model is downloaded in the following directory tree |
---|
| 13 | # $MODEL/modipsl/modeles/... |
---|
| 14 | # using the "modipsl" infrastructure created by the "IPSL" |
---|
| 15 | # for coupled (atmosphere/ocean/vegetation/chemistry) climate modeling |
---|
| 16 | # activities. |
---|
| 17 | # Here we only download atmospheric (LMDZ) and vegetation (ORCHIDEE) |
---|
| 18 | # components. |
---|
| 19 | # |
---|
| 20 | # The sources of the models can be found in the "modeles" directory. |
---|
[4218] | 21 | # In the present case, LMDZ, ORCHIDEE, and IOIPSL or XIOS (handling of |
---|
| 22 | # input-outputs using the NetCDF library). |
---|
[4210] | 23 | # |
---|
| 24 | # The script downloads various source files (including a version of NetCDF) |
---|
| 25 | # and utilities, compiles the model, and runs a test simulation in a |
---|
| 26 | # minimal configuration. |
---|
| 27 | # |
---|
| 28 | # Prerequisites : pgf90/gfortran, bash or ksh, wget , gunzip, tar, ... |
---|
| 29 | # |
---|
| 30 | # Modif 18/11/2011 |
---|
| 31 | # changes for option real 8. |
---|
| 32 | # We compile with -r8 (or equivalent) and -DNC_DOUBLE for the GCM |
---|
| 33 | # but with -r4 for netcdf. Variable real must be set to |
---|
| 34 | # r4 or r8 at the beginning of the script below. |
---|
| 35 | # |
---|
| 36 | ########################################################################### |
---|
| 37 | |
---|
| 38 | echo install_lmdz.sh DEBUT `date` |
---|
| 39 | set -e |
---|
| 40 | |
---|
| 41 | ################################################################ |
---|
| 42 | # Choice of installation options |
---|
| 43 | ################################################################ |
---|
| 44 | |
---|
| 45 | ################################################################ |
---|
| 46 | # A function to fetch files either locally or on the internet |
---|
| 47 | ################################################################ |
---|
| 48 | function myget { #1st and only argument should be file name |
---|
[4215] | 49 | # Path on local computer where to look for the datafile |
---|
| 50 | if [ -f /u/lmdz/WWW/LMDZ/pub/$1 ] ; then |
---|
[4405] | 51 | \cp -f -p /u/lmdz/WWW/LMDZ/pub/$1 . |
---|
[4215] | 52 | elif [ -f ~/LMDZ/pub/$1 ] ; then |
---|
[4405] | 53 | \cp -f -p ~/LMDZ/pub/$1 . |
---|
[4215] | 54 | else |
---|
[4405] | 55 | wget --no-check-certificate -nv http://lmdz.lmd.jussieu.fr/pub/$1 |
---|
| 56 | save_pub_locally=0 |
---|
| 57 | if [ $save_pub_locally = 1 ] ; then # saving wget files on ~/LMDZ/pub |
---|
| 58 | dir=~/LMDZ/pub/`dirname $1` ; mkdir -p $dir |
---|
| 59 | cp -r `basename $1` $dir |
---|
| 60 | fi |
---|
[4210] | 61 | fi |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | # 04_2021 : tester si r4 marche encore ! |
---|
| 65 | #real=r4 |
---|
| 66 | real=r8 |
---|
| 67 | |
---|
| 68 | |
---|
| 69 | ######################################################################### |
---|
| 70 | # Valeur par défaut des parametres |
---|
| 71 | ######################################################################### |
---|
| 72 | svn="" |
---|
| 73 | #version=trunk |
---|
[4375] | 74 | version=20221201.trunk |
---|
[4210] | 75 | |
---|
| 76 | getlmdzor=1 |
---|
[4237] | 77 | netcdf=1 # 1: for automatic installation; |
---|
[4267] | 78 | # or 0: do not install NetCDF and look for it in standard locations; |
---|
| 79 | # or absolute path: look for NetCDF there |
---|
[4210] | 80 | check_linux=1 |
---|
| 81 | ioipsl=1 |
---|
| 82 | bench=1 |
---|
| 83 | pclinux=1 |
---|
| 84 | pcmac=0 # default: not on a Mac |
---|
| 85 | compiler=gfortran |
---|
[4269] | 86 | if [ `gfortran -dumpversion | cut -d. -f1` -ge 11 ] ; then allow_arg_mismatch="-fallow-argument-mismatch" ; fi |
---|
[4210] | 87 | SCM=0 |
---|
| 88 | # surface/vegetation scheme treatment |
---|
| 89 | # controlled by the single variable veget which can have the following values |
---|
| 90 | # - NONE: bucket scheme (default) |
---|
| 91 | # - CMIP6: orchidee version used in CMIP exercise, rev 5661 |
---|
| 92 | # - number: orchidee version number |
---|
| 93 | veget=NONE |
---|
| 94 | # choose the resolution for the bench runs |
---|
| 95 | # grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE) |
---|
| 96 | # 96x71x19 standard configuration |
---|
| 97 | grid_resolution=144x142x79 |
---|
| 98 | grid_resolution=96x95x39 |
---|
| 99 | grid_resolution=48x36x19 |
---|
| 100 | grid_resolution=32x32x39 |
---|
| 101 | # choose the physiq version you want to test |
---|
| 102 | #physiq=NPv6.0.14splith |
---|
| 103 | physiq= |
---|
| 104 | |
---|
| 105 | ## parallel can take the values none/mpi/omp/mpi_omp |
---|
| 106 | parallel=mpi_omp |
---|
| 107 | parallel=none |
---|
| 108 | idris_acct=lmd |
---|
[4417] | 109 | trusting=testing |
---|
[4210] | 110 | OPT_GPROF="" |
---|
| 111 | OPT_MAKELMDZ="" |
---|
| 112 | MODEL="" |
---|
| 113 | |
---|
| 114 | ## also compile XIOS? (and more recent NetCDF/HDF5 libraries) Default=no |
---|
| 115 | with_xios="n" |
---|
| 116 | opt_makelmdz_xios="" |
---|
| 117 | |
---|
| 118 | ## compile with oldrad/rrtm/ecrad radiatif code (Default=rrtm) |
---|
| 119 | rad=rrtm |
---|
| 120 | |
---|
| 121 | ## compile_with_fcm=1 : use makelmdz_fcm (1) or makelmdz (0) |
---|
| 122 | compile_with_fcm=1 |
---|
| 123 | |
---|
| 124 | #Compilation with Cosp (cosp=NONE/v1/v2 ; default=NONE) |
---|
| 125 | cosp=NONE |
---|
| 126 | opt_cosp="" |
---|
| 127 | |
---|
| 128 | # Check if on a Mac |
---|
| 129 | if [ `uname` = "Darwin" ] |
---|
| 130 | then |
---|
| 131 | pcmac=1 |
---|
| 132 | export MAKE=make |
---|
| 133 | fi |
---|
| 134 | #echo "pcmac="$pcmac |
---|
| 135 | |
---|
| 136 | env_file="" |
---|
| 137 | |
---|
| 138 | ######################################################################### |
---|
| 139 | # Options interactives |
---|
| 140 | ######################################################################### |
---|
| 141 | while (($# > 0)) |
---|
[4215] | 142 | do |
---|
| 143 | case $1 in |
---|
[4405] | 144 | "-h") cat <<........fin |
---|
[4210] | 145 | $0 [ -v version ] [ -r svn_release ] |
---|
| 146 | [ -parallel PARA ] [ -d GRID_RESOLUTION ] [ -bench 0/1 ] |
---|
| 147 | [-name LOCAL_MODEL_NAME] [-gprof] [-opt_makelmdz] [-rad RADIATIF] |
---|
| 148 | |
---|
| 149 | -v "version" like 20150828.trunk |
---|
| 150 | see http://www.lmd.jussieu.fr/~lmdz/Distrib/LISMOI.trunk |
---|
| 151 | |
---|
| 152 | -r "svn_release" : either the svn release number or "last" |
---|
| 153 | |
---|
| 154 | -compiler gfortran|ifort|pgf90 (default: gfortran) |
---|
| 155 | |
---|
| 156 | -parallel PARA : can be mpi_omp (mpi with openMP) or none (for sequential) |
---|
| 157 | |
---|
| 158 | -d GRID_RESOLUTION should be among the available benchs if -bench 1 |
---|
| 159 | among which : 48x36x19, 48x36x39 |
---|
| 160 | if wanting to run a bench simulation in addition to compilation |
---|
| 161 | default : 48x36x19 |
---|
| 162 | |
---|
| 163 | -bench activating the bench or not (0/1). Default 1 |
---|
| 164 | |
---|
[4421] | 165 | -testing/unstable |
---|
[4417] | 166 | |
---|
[4210] | 167 | -name LOCAL_MODEL_NAME : default = LMDZversion.release |
---|
| 168 | |
---|
[4211] | 169 | -netcdf 0, 1 or PATH |
---|
[4405] | 170 | 0: do not download NetCDF, look for it in standard locations |
---|
| 171 | 1: download and compile NetCDF |
---|
| 172 | PATH: full path to an existing installed NetCDF library |
---|
[4210] | 173 | |
---|
| 174 | -xios also download and compile the XIOS library |
---|
| 175 | (requires the NetCDF4-HDF5 library, also installed by default) |
---|
| 176 | (requires to also have -parallel mpi_omp) |
---|
| 177 | |
---|
| 178 | -gprof to compile with -pg to enable profiling with gprof |
---|
| 179 | |
---|
| 180 | -cosp to run without our with cospv1 or cospv2 [none/v1/v2] |
---|
| 181 | |
---|
| 182 | -rad RADIATIF can be oldrad, rrtm or ecrad radiatif code |
---|
| 183 | |
---|
| 184 | -nofcm to compile without fcm |
---|
| 185 | |
---|
| 186 | -SCM install 1D version automatically |
---|
| 187 | |
---|
| 188 | -debug compile everything in debug mode |
---|
| 189 | |
---|
| 190 | -opt_makelmdz to call makelmdz or makelmdz_fcm with additional options |
---|
| 191 | |
---|
| 192 | -physiq to choose which physics package to use |
---|
| 193 | |
---|
| 194 | -env_file specify an arch.env file to overwrite the existing one |
---|
| 195 | |
---|
| 196 | -veget surface model to run [NONE/CMIP6/xxxx] |
---|
| 197 | |
---|
| 198 | ........fin |
---|
[4405] | 199 | exit ;; |
---|
| 200 | "-v") version=$2 ; shift ; shift ;; |
---|
| 201 | "-r") svn=$2 ; shift ; shift ;; |
---|
| 202 | "-compiler") compiler=$2 |
---|
[4215] | 203 | case $compiler in |
---|
[4405] | 204 | "gfortran"|"ifort"|"pgf90") compiler=$2 ; shift |
---|
| 205 | shift ;; |
---|
| 206 | *) echo "Only gfortran , ifort or pgf90 for the " \ |
---|
| 207 | "compiler option" |
---|
| 208 | exit |
---|
[4215] | 209 | esac ;; |
---|
[4405] | 210 | "-d") grid_resolution=$2 ; shift ; shift ;; |
---|
| 211 | "-gprof") OPT_GPROF="-pg" ; shift ;; |
---|
[4417] | 212 | "-unstable"|"-testing") trusting=`echo $1 | cut -c2-` ; shift ;; |
---|
[4405] | 213 | "-cosp") cosp=$2 |
---|
| 214 | case $cosp in |
---|
[4215] | 215 | "none"|"v1"|"v2") cosp=$2 ; shift ; shift ;; |
---|
| 216 | *) echo Only none v1 v2 for cosp option ; exit |
---|
[4405] | 217 | esac ;; |
---|
| 218 | "-nofcm") compile_with_fcm=0 ; echo This option will be reactivated soon '(promesse du 8dec2022)' ; exit 1 ; shift ;; |
---|
| 219 | "-SCM") SCM=1 ; shift ;; |
---|
| 220 | "-opt_makelmdz") OPT_MAKELMDZ="$2" ; shift ; shift ;; |
---|
| 221 | "-rrtm") rrtm="$2" |
---|
| 222 | if [ "$2" = "false" ] ; then |
---|
| 223 | rad="oldrad" |
---|
| 224 | else |
---|
| 225 | rad="rrtm" |
---|
| 226 | fi |
---|
| 227 | shift ; shift ;; |
---|
| 228 | "-rad") rad=$2 |
---|
| 229 | case $rad in |
---|
[4215] | 230 | "oldrad"|"rrtm"|"ecrad") rad=$2 ; shift ; shift ;; |
---|
| 231 | *) echo Only oldrad rrtm ecrad for rad option ; exit |
---|
[4405] | 232 | esac ;; |
---|
| 233 | "-parallel") parallel=$2 |
---|
[4215] | 234 | case $parallel in |
---|
[4405] | 235 | "none"|"mpi"|"omp"|"mpi_omp") parallel=$2 ; shift |
---|
| 236 | shift ;; |
---|
| 237 | *) echo Only none mpi omp mpi_omp for the parallel \ |
---|
| 238 | option |
---|
| 239 | exit |
---|
[4215] | 240 | esac ;; |
---|
[4405] | 241 | "-bench") bench=$2 ; shift ; shift ;; |
---|
| 242 | "-debug") optim=-debug ; shift ;; |
---|
| 243 | "-name") MODEL=$2 ; shift ; shift ;; |
---|
| 244 | "-netcdf") case $2 in |
---|
[4398] | 245 | 0|1) netcdf=$2 ;; |
---|
| 246 | *) netcdf=`ls -d $2` ; if [ $? != 0 ] ; then echo No directory $2 ; exit 1 ; fi |
---|
| 247 | esac |
---|
| 248 | shift ; shift ;; |
---|
[4405] | 249 | "-physiq") physiq=$2 ; shift ; shift ;; |
---|
| 250 | "-xios") with_xios="y" ; shift ;; |
---|
| 251 | "-env_file") env_file=$2 ; shift ; shift ;; |
---|
| 252 | "-veget") veget=$2 ; shift ; shift ;; |
---|
| 253 | *) ./install_lmdz.sh -h ; exit |
---|
[4215] | 254 | esac |
---|
[4210] | 255 | done |
---|
| 256 | |
---|
[4218] | 257 | # Option de compilation du rayonnement : depend de $mysvn ><= r4185, |
---|
| 258 | # sera donc definie plus bas |
---|
| 259 | |
---|
[4210] | 260 | #opt_rad="" |
---|
| 261 | #case $rad in |
---|
| 262 | # rrtm) opt_rad="-rad rrtm" ;; |
---|
| 263 | # ecrad) opt_rad="-rad ecrad" ;; |
---|
| 264 | #esac |
---|
| 265 | |
---|
| 266 | |
---|
| 267 | # Option de compilation pour Cosp |
---|
| 268 | opt_cosp="" |
---|
| 269 | case cosp in |
---|
[4215] | 270 | v1) opt_cosp="-cosp true" ;; |
---|
| 271 | v2) opt_cosp="-cospv2 true" ;; |
---|
[4210] | 272 | esac |
---|
| 273 | |
---|
| 274 | # Check on veget version |
---|
| 275 | #if [ "$veget" != 'NONE' -a "$veget" != "CMIP6" -a "$veget" != +([0-9]) ] ; then |
---|
| 276 | if [ $veget != 'NONE' -a $veget != "CMIP6" ] ; then |
---|
| 277 | re='^[0-9]+$' |
---|
| 278 | if ! [[ $veget =~ $re ]] ; then |
---|
[4405] | 279 | echo 'Valeur de l option veget non valable' |
---|
| 280 | exit |
---|
[4210] | 281 | fi |
---|
| 282 | fi |
---|
| 283 | |
---|
| 284 | #Define veget-related suffix for gcm name |
---|
| 285 | if [ "$veget" = 'NONE' ] ; then |
---|
| 286 | suff_orc='' |
---|
[4218] | 287 | #For use with tutorial, orchidee_rev is also defined (will be |
---|
| 288 | #written in surface_env at the end of the script) |
---|
[4210] | 289 | orchidee_rev='' |
---|
| 290 | else |
---|
| 291 | suff_orc='_orch' |
---|
| 292 | fi |
---|
| 293 | |
---|
| 294 | |
---|
[4218] | 295 | if [ $parallel = none ] ; then |
---|
| 296 | sequential=1; suff_exe='_seq' |
---|
| 297 | else |
---|
| 298 | sequential=0; suff_exe='_para_mem' |
---|
| 299 | fi |
---|
[4210] | 300 | |
---|
| 301 | #Chemin pour placer le modele |
---|
| 302 | if [ "$MODEL" = "" ] ; then MODEL=./LMDZ$version$svn$optim ; fi |
---|
| 303 | |
---|
| 304 | |
---|
| 305 | arch=local |
---|
| 306 | |
---|
| 307 | |
---|
| 308 | if [ $compiler = g95 ] ; then echo g95 is not supported anymore ; exit ; fi |
---|
| 309 | |
---|
| 310 | ################################################################ |
---|
| 311 | # Specificite des machines |
---|
| 312 | ################################################################ |
---|
| 313 | |
---|
| 314 | hostname=`hostname` |
---|
| 315 | if [ "$pclinux" = 1 ] ; then o_ins_make="-t g95" ; else o_ins_make="" ; fi |
---|
| 316 | |
---|
| 317 | case ${hostname:0:5} in |
---|
| 318 | |
---|
[4215] | 319 | jean-) compiler="mpiifort" ; |
---|
| 320 | par_comp="mpiifort" ; |
---|
| 321 | o_ins_make="-t jeanzay" ; |
---|
| 322 | make=gmake ; |
---|
| 323 | module purge |
---|
| 324 | module load intel-compilers/19.0.4 ; |
---|
| 325 | #module load intel-mpi/19.0.4 ; |
---|
| 326 | #module load intel-mkl/19.0.4 ; |
---|
| 327 | module load hdf5/1.10.5-mpi ; |
---|
| 328 | module load netcdf/4.7.2-mpi ; |
---|
| 329 | module load netcdf-fortran/4.5.2-mpi ; |
---|
| 330 | module load subversion/1.9.7 ; |
---|
| 331 | export NETCDF_LIBDIR=./ |
---|
| 332 | export NETCDFFORTRAN_INCDIR=./ |
---|
| 333 | export NETCDFFORTRAN_LIBDIR=./ |
---|
| 334 | arch=X64_JEANZAY ;; |
---|
[4210] | 335 | |
---|
[4215] | 336 | cicla|camel) compiler="gfortran" ; |
---|
[4405] | 337 | module purge |
---|
| 338 | module load gnu/10.2.0 |
---|
| 339 | module load openmpi/4.0.5 |
---|
| 340 | module load hdf5/1.10.7-mpi |
---|
| 341 | module load netcdf-c/4.7.4-mpi |
---|
| 342 | module load netcdf-fortran/4.5.3-mpi |
---|
| 343 | netcdf=/net/nfs/tools/PrgEnv/linux-scientific6-x86_64/gcc-10.2.0/netcdf-fortran-4.5.3-k3drgfqok3lip62hnm3tsyof4cjen5sk |
---|
| 344 | module load svn/1.14.0 |
---|
[4211] | 345 | |
---|
[4405] | 346 | if [ $parallel != none ] ; then |
---|
| 347 | root_mpi=/net/nfs/tools/meso-sl6/openmpi/4.0.5-gcc-10.2.0 |
---|
| 348 | path_mpi=$root_mpi/bin ; |
---|
| 349 | par_comp=${path_mpi}/mpif90 ; |
---|
| 350 | mpirun=${path_mpi}/mpirun ; |
---|
| 351 | fi ; |
---|
| 352 | arch=local ; |
---|
| 353 | make=make ; |
---|
| 354 | o_ins_make="-t g95" ;; |
---|
[4210] | 355 | |
---|
[4215] | 356 | *) if [ $parallel = none -o -f /usr/bin/mpif90 ] ; then |
---|
| 357 | path_mpi=`which mpif90 | sed -e s:/mpif90::` ; |
---|
| 358 | if [ -d /usr/lib64/openmpi ] ; then |
---|
| 359 | root_mpi="/usr/lib64/openmpi" |
---|
| 360 | else |
---|
| 361 | root_mpi="/usr" |
---|
| 362 | fi |
---|
| 363 | else |
---|
[4405] | 364 | echo "Cannot find mpif90" ; |
---|
| 365 | if [ $parallel = none ] ; then exit ; fi ; |
---|
[4215] | 366 | fi ; |
---|
| 367 | if [ $parallel != none ] ; then |
---|
[4405] | 368 | root_mpi=$(which mpif90 | sed -e s:/bin/mpif90::) |
---|
| 369 | path_mpi=$(which mpif90 | sed -e s:/mpif90::) |
---|
| 370 | export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH |
---|
[4215] | 371 | fi |
---|
| 372 | par_comp=${path_mpi}/mpif90 ; |
---|
| 373 | mpirun=${path_mpi}/mpirun ; |
---|
| 374 | arch=local ; |
---|
| 375 | make=make ; |
---|
| 376 | o_ins_make="-t g95" |
---|
[4210] | 377 | esac |
---|
| 378 | |
---|
| 379 | # Flags for parallelism: |
---|
| 380 | if [ $parallel != none ] ; then |
---|
[4215] | 381 | # MPI_LD are the flags needed for linking with MPI |
---|
| 382 | MPI_LD="-L${root_mpi}/lib -lmpi" |
---|
| 383 | if [ "$compiler" = "gfortran" ] ; then |
---|
[4405] | 384 | # MPI_FLAGS are the flags needed for compilation with MPI |
---|
| 385 | MPI_FLAGS="-fcray-pointer" |
---|
| 386 | # OMP_FLAGS are the flags needed for compilation with OpenMP |
---|
| 387 | OMP_FLAGS="-fopenmp -fcray-pointer" |
---|
| 388 | # OMP_LD are the flags needed for linking with OpenMP |
---|
| 389 | OMP_LD="-fopenmp" |
---|
[4215] | 390 | elif [ "$compiler" = "ifort" ] ; then |
---|
[4405] | 391 | MPI_FLAGS="" |
---|
| 392 | OMP_FLAGS="-openmp" |
---|
| 393 | OMP_LD="-openmp" |
---|
[4215] | 394 | else # pgf90 |
---|
[4405] | 395 | MPI_FLAGS="" |
---|
| 396 | OMP_FLAGS="-mp" |
---|
| 397 | OMP_LD="-mp" |
---|
[4215] | 398 | fi |
---|
[4210] | 399 | fi |
---|
| 400 | |
---|
| 401 | ##################################################################### |
---|
| 402 | # Test for old gfortran compilers |
---|
| 403 | # If the compiler is too old (older than 4.3.x) we test if the |
---|
| 404 | # temporary gfortran44 patch is available on the computer in which |
---|
| 405 | # case the compiler is changed from gfortran to gfortran44 |
---|
| 406 | # Must be aware than parallelism can not be activated in this case |
---|
| 407 | ##################################################################### |
---|
| 408 | |
---|
| 409 | if [ "$compiler" = "gfortran" ] ; then |
---|
[4215] | 410 | gfortran=gfortran |
---|
| 411 | gfortranv=`gfortran --version | \ |
---|
[4210] | 412 | head -1 | awk ' { print $NF } ' | awk -F. ' { print $1 * 10 + $2 } '` |
---|
[4215] | 413 | if [ $gfortranv -le 43 ] ; then |
---|
[4405] | 414 | echo ERROR : Your gfortran compiler is too old |
---|
| 415 | echo 'Please choose a new one (ifort) and change the line' |
---|
| 416 | echo compiler=xxx |
---|
| 417 | echo in the install_lmdz.sh script and rerun it |
---|
| 418 | if [ `which gfortran44 | wc -w` -ne 0 ] ; then |
---|
[4215] | 419 | gfortran=gfortran44 |
---|
[4405] | 420 | else |
---|
[4215] | 421 | echo gfotran trop vieux ; exit |
---|
[4405] | 422 | fi |
---|
[4215] | 423 | fi |
---|
| 424 | compiler=$gfortran |
---|
[4210] | 425 | fi |
---|
| 426 | ##################################################################### |
---|
| 427 | |
---|
| 428 | ## if also compiling XIOS, parallel must be mpi_omp |
---|
| 429 | if [ "$with_xios" = "y" -a "$parallel" != "mpi_omp" ] ; then |
---|
[4215] | 430 | echo "Error, you must set -parallel mpi_omp if you want XIOS" |
---|
| 431 | exit |
---|
[4210] | 432 | fi |
---|
| 433 | |
---|
| 434 | if [ "$with_xios" = "y" ] ; then |
---|
[4215] | 435 | opt_makelmdz_xios="-io xios" |
---|
[4210] | 436 | fi |
---|
| 437 | |
---|
| 438 | if [ "$cosp" = "v2" -a "$with_xios" = "n" ] ; then |
---|
[4215] | 439 | echo "Error, Cospv2 cannot run without Xios" |
---|
| 440 | exit |
---|
[4210] | 441 | fi |
---|
| 442 | |
---|
| 443 | echo '################################################################' |
---|
| 444 | echo Choix des options de compilation |
---|
| 445 | echo '################################################################' |
---|
| 446 | |
---|
| 447 | export FC=$compiler |
---|
| 448 | export F90=$compiler |
---|
| 449 | export F77=$compiler |
---|
| 450 | export CPPFLAGS= |
---|
| 451 | OPTIMNC=$OPTIM |
---|
| 452 | BASE_LD="$OPT_GPROF" |
---|
| 453 | OPTPREC="$OPT_GPROF" |
---|
[4218] | 454 | ARFLAGS="rs" |
---|
[4418] | 455 | if [ "`lsb_release -i -s`" = "Ubuntu" ] ; then |
---|
[4398] | 456 | if [ "`lsb_release -r -s | cut -d. -f1`" -ge 16 ] ; then |
---|
| 457 | ARFLAGS="rU" |
---|
[4218] | 458 | fi |
---|
| 459 | fi |
---|
[4210] | 460 | |
---|
| 461 | if [ "$compiler" = "$gfortran" ] ; then |
---|
[4267] | 462 | OPTIM="-O3 $allow_arg_mismatch" |
---|
| 463 | OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=snan $allow_arg_mismatch" |
---|
| 464 | OPTDEV="-Wall -fbounds-check $allow_arg_mismatch" |
---|
| 465 | fmod='I ' |
---|
| 466 | OPTPREC="$OPTPREC -cpp -ffree-line-length-0" |
---|
| 467 | if [ $real = r8 ] ; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE" ; fi |
---|
| 468 | export F90FLAGS=" -ffree-form $OPTIMNC" |
---|
| 469 | export FFLAGS=" $OPTIMNC" |
---|
| 470 | export CC=gcc |
---|
| 471 | export CXX=g++ |
---|
| 472 | export fpp_flags="-P -C -traditional -ffreestanding" |
---|
[4210] | 473 | |
---|
| 474 | elif [ $compiler = mpif90 ] ; then |
---|
[4215] | 475 | OPTIM='-O3' |
---|
| 476 | OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all" |
---|
| 477 | OPTDEV="-Wall -fbounds-check" |
---|
| 478 | BASE_LD="$BASE_LD -lblas" |
---|
| 479 | fmod='I ' |
---|
[4218] | 480 | if [ $real = r8 ] ; then |
---|
[4405] | 481 | OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer" |
---|
[4218] | 482 | fi |
---|
[4215] | 483 | export F90FLAGS=" -ffree-form $OPTIMNC" |
---|
| 484 | export FFLAGS=" $OPTIMNC" |
---|
| 485 | export CC=gcc |
---|
| 486 | export CXX=g++ |
---|
[4210] | 487 | |
---|
| 488 | elif [ $compiler = pgf90 ] ; then |
---|
[4215] | 489 | OPTIM='-O2 -Mipa -Munroll -Mnoframe -Mautoinline -Mcache_align' |
---|
| 490 | OPTDEB='-g -Mdclchk -Mbounds -Mchkfpstk -Mchkptr -Minform=inform -Mstandard -Ktrap=fp -traceback' |
---|
| 491 | OPTDEV='-g -Mbounds -Ktrap=fp -traceback' |
---|
| 492 | fmod='module ' |
---|
| 493 | if [ $real = r8 ] ; then OPTPREC="$OPTPREC -r8 -DNC_DOUBLE" ; fi |
---|
| 494 | export CPPFLAGS="-DpgiFortran" |
---|
| 495 | export CC=pgcc |
---|
| 496 | export CFLAGS="-O2 -Msignextend" |
---|
| 497 | export CXX=pgCC |
---|
| 498 | export CXXFLAGS="-O2 -Msignextend" |
---|
| 499 | export FFLAGS="-O2 $OPTIMNC" |
---|
| 500 | export F90FLAGS="-O2 $OPTIMNC" |
---|
| 501 | compile_with_fcm=1 |
---|
[4210] | 502 | |
---|
[4221] | 503 | elif [[ $compiler = ifort || $compiler = mpiifort ]] ; then |
---|
[4215] | 504 | OPTIM="-O2 -fp-model strict -ip -align all " |
---|
| 505 | OPTDEV="-p -g -O2 -traceback -fp-stack-check -ftrapuv -check" |
---|
| 506 | OPTDEB="-g -no-ftz -traceback -ftrapuv -fp-stack-check -check" |
---|
| 507 | fmod='module ' |
---|
| 508 | if [ $real = r8 ] ; then OPTPREC="$OPTPREC -real-size 64 -DNC_DOUBLE" ; fi |
---|
| 509 | export CPP="icc -E" |
---|
| 510 | export FFLAGS="-O2 -ip -fpic -mcmodel=large" |
---|
| 511 | export FCFLAGS="-O2 -ip -fpic -mcmodel=large" |
---|
| 512 | export CC=icc |
---|
| 513 | export CFLAGS="-O2 -ip -fpic -mcmodel=large" |
---|
| 514 | export CXX=icpc |
---|
| 515 | export CXXFLAGS="-O2 -ip -fpic -mcmodel=large" |
---|
| 516 | export fpp_flags="-P -traditional" |
---|
| 517 | # Pourquoi forcer la compilation fcm. Marche mieux sans |
---|
| 518 | #compile_with_fcm=1 |
---|
[4210] | 519 | else |
---|
[4215] | 520 | echo unexpected compiler $compiler ; exit |
---|
[4210] | 521 | fi |
---|
| 522 | |
---|
| 523 | OPTIMGCM="$OPTIM $OPTPREC" |
---|
| 524 | |
---|
| 525 | hostname=`hostname` |
---|
| 526 | |
---|
| 527 | ########################################################################## |
---|
| 528 | # If installing on known machines such as Jean-Zay at IDRIS, |
---|
| 529 | # don't check for available software and don't install netcdf |
---|
| 530 | if [ ${hostname:0:5} = jean- ] ; then |
---|
[4215] | 531 | netcdf=0 # no need to recompile netcdf, alreday available |
---|
| 532 | check_linux=0 |
---|
| 533 | pclinux=0 |
---|
| 534 | ioipsl=0 # no need to recompile ioipsl, already available |
---|
| 535 | #netcdf="/smplocal/pub/NetCDF/4.1.3" |
---|
| 536 | compiler="mpiifort" |
---|
| 537 | fmod='module ' |
---|
| 538 | if [ $real = r8 ] ; then OPTPREC="$OPTPREC -i4 -r8 -DNC_DOUBLE" ; fi |
---|
| 539 | OPTIM="-auto -align all -O2 -fp-model strict -xHost " |
---|
| 540 | OPTIMGCM="$OPTIM $OPTPREC" |
---|
[4210] | 541 | fi |
---|
| 542 | ########################################################################## |
---|
| 543 | |
---|
| 544 | |
---|
| 545 | mkdir -p $MODEL |
---|
| 546 | echo $MODEL |
---|
| 547 | MODEL=`( cd $MODEL ; pwd )` # to get absolute path, if necessary |
---|
| 548 | |
---|
| 549 | |
---|
| 550 | if [ "$check_linux" = 1 ] ; then |
---|
[4372] | 551 | echo '################################################################' |
---|
[4215] | 552 | echo Check if required software is available |
---|
| 553 | echo '################################################################' |
---|
[4210] | 554 | |
---|
[4215] | 555 | #### Ehouarn: test if the required shell is available |
---|
| 556 | #### Maj FH-LF-AS 2021-04 : default=bash ; if bash missing, use ksh |
---|
| 557 | use_shell="bash" # default |
---|
| 558 | if [ "`which bash`" = "" ] ; then |
---|
[4405] | 559 | echo "no bash ; we will use ksh" |
---|
| 560 | use_shell="ksh" |
---|
| 561 | if [ "`which ksh`" = "" ] ; then |
---|
| 562 | echo "bash (or ksh) needed!! Install it!" |
---|
| 563 | exit |
---|
| 564 | fi |
---|
[4215] | 565 | fi |
---|
[4210] | 566 | |
---|
[4372] | 567 | for logiciel in wget tar gzip make $compiler gcc cmake m4 c++ ; do |
---|
[4405] | 568 | if [ "`which $logiciel`" = "" ] ; then |
---|
| 569 | echo You must first install $logiciel on your system |
---|
| 570 | exit |
---|
| 571 | fi |
---|
[4215] | 572 | done |
---|
[4210] | 573 | |
---|
[4215] | 574 | if [ $pclinux = 1 ] ; then |
---|
[4405] | 575 | cd $MODEL |
---|
| 576 | cat <<eod > tt.f90 |
---|
[4210] | 577 | print*,'coucou' |
---|
| 578 | end |
---|
| 579 | eod |
---|
[4405] | 580 | $compiler tt.f90 -o a.out |
---|
| 581 | ./a.out >| tt |
---|
| 582 | if [ "`cat tt | sed -e 's/ //g' `" != "coucou" ] ; then |
---|
| 583 | echo problem installing with compiler $compiler ; exit ; fi |
---|
| 584 | \rm tt a.out tt.f90 |
---|
[4215] | 585 | fi |
---|
[4210] | 586 | fi |
---|
| 587 | |
---|
| 588 | ########################################################################### |
---|
| 589 | if [ $getlmdzor = 1 -a ! -d $MODEL/modipsl ] ; then |
---|
[4267] | 590 | ########################################################################### |
---|
| 591 | echo '##########################################################' |
---|
| 592 | echo Download a slightly modified version of LMDZ |
---|
| 593 | echo '##########################################################' |
---|
| 594 | cd $MODEL |
---|
| 595 | getlog=`pwd`/get.log |
---|
| 596 | echo logfile : $getlog |
---|
[4417] | 597 | myget src_archives/$trusting/modipsl.$version.tar.gz >> get.log 2>&1 |
---|
[4267] | 598 | echo install_lmdz.sh wget_OK `date` |
---|
| 599 | gunzip modipsl.$version.tar.gz >> get.log 2>&1 |
---|
[4286] | 600 | tar xf modipsl.$version.tar >> get.log 2>&1 |
---|
[4267] | 601 | \rm modipsl.$version.tar |
---|
[4210] | 602 | fi |
---|
| 603 | |
---|
| 604 | ########################################################################### |
---|
[4217] | 605 | if [ $netcdf = 1 ] ; then |
---|
[4405] | 606 | ########################################################################### |
---|
[4215] | 607 | cd $MODEL |
---|
| 608 | netcdflog=`pwd`/netcdf.log |
---|
[4405] | 609 | echo '----------------------------------------------------------' |
---|
[4215] | 610 | echo Compiling the Netcdf library |
---|
[4405] | 611 | echo '----------------------------------------------------------' |
---|
[4215] | 612 | echo log file : $netcdflog |
---|
[4212] | 613 | |
---|
[4405] | 614 | case $compiler in |
---|
| 615 | gfortran) opt1="-compiler gnu" ; opt2="-CC gcc -FC gfortran -CXX g++" ;; |
---|
| 616 | ifort) opt1="-compiler intel" ; opt2="-CC icc -FC ifort -CXX icpc" ;; |
---|
| 617 | pgf90) opt1="-compiler pgf90" ; opt2="-CC pgcc -FC pgf90 -CXX pgCC" ;; |
---|
| 618 | *) echo "unexpected compiler $compiler" for netcdf ; exit 1 |
---|
| 619 | esac |
---|
[4212] | 620 | |
---|
[4405] | 621 | case $with_xios in |
---|
| 622 | n) script_install_netcdf=install_netcdf4_hdf5_seq.bash |
---|
| 623 | ncdfdir=$MODEL/netcdf4_hdf5_seq |
---|
| 624 | opt_=$opt1 ;; |
---|
| 625 | y) script_install_netcdf=install_netcdf4_hdf5.bash |
---|
| 626 | ncdfdir=$MODEL/netcdf4_hdf5 |
---|
| 627 | opt_="$opt2 -MPI $root_mpi" ;; |
---|
| 628 | *) echo with_xios=$with_xios, should be n or y ; exit 1 |
---|
| 629 | esac |
---|
| 630 | |
---|
| 631 | if [[ ! -d $ncdfdir ]] ; then |
---|
[4411] | 632 | myget script_install/$script_install_netcdf >> $netcdflog 2>&1 |
---|
[4405] | 633 | chmod u=rwx $script_install_netcdf |
---|
| 634 | ./$script_install_netcdf -prefix $ncdfdir $opt_ >> $netcdflog 2>&1 |
---|
| 635 | fi |
---|
| 636 | |
---|
| 637 | #---------------------------------------------------------------------------- |
---|
| 638 | # LF rajout d'une verrue, pour une raison non encore expliquee, |
---|
| 639 | # la librairie est parfois rangée dans lib64 et non dans lib |
---|
| 640 | # par certains compilateurs |
---|
| 641 | if [ ! -e lib -a -d lib64 ] ; then ln -s lib64 lib; fi |
---|
| 642 | #---------------------------------------------------------------------------- |
---|
| 643 | |
---|
[4215] | 644 | echo install_lmdz.sh netcdf_OK `date` |
---|
[4210] | 645 | |
---|
[4405] | 646 | elif [ $netcdf = 0 ] ; then |
---|
[4215] | 647 | ncdfdir=/usr |
---|
[4210] | 648 | else |
---|
[4215] | 649 | ncdfdir=$netcdf |
---|
[4210] | 650 | fi |
---|
| 651 | |
---|
[4238] | 652 | cat >test_netcdf90.f90 <<EOF |
---|
[4239] | 653 | use netcdf |
---|
[4238] | 654 | print *, "NetCDF library version: ", nf90_inq_libvers() |
---|
| 655 | end |
---|
| 656 | EOF |
---|
| 657 | |
---|
[4405] | 658 | $compiler -I$ncdfdir/include test_netcdf90.f90 -L$ncdfdir/lib -lnetcdff \ |
---|
| 659 | -lnetcdf -Wl,-rpath=$ncdfdir/lib && ./a.out |
---|
[4238] | 660 | |
---|
| 661 | if (($? == 0)) |
---|
| 662 | then |
---|
| 663 | rm test_netcdf90.f90 a.out |
---|
| 664 | else |
---|
| 665 | echo "Failed test program using NetCDF-Fortran." |
---|
| 666 | echo "You can:" |
---|
| 667 | echo "- check that you have NetCDF-Fortran installed in your system" |
---|
| 668 | echo "- or specify an installation directory with option -netcdf of" \ |
---|
[4405] | 669 | "install_lmdz.sh" |
---|
[4238] | 670 | echo "- or download and compile NetCDF-Fortran with option -netcdf 1 of" \ |
---|
[4405] | 671 | "install_lmdz.sh" |
---|
[4238] | 672 | exit 1 |
---|
| 673 | fi |
---|
| 674 | |
---|
[4210] | 675 | #========================================================================= |
---|
| 676 | if [[ ! -f $MODEL/modipsl/lib/libioipsl.a ]] |
---|
| 677 | then |
---|
[4215] | 678 | if [ $ioipsl = 1 ] ; then |
---|
[4405] | 679 | #===================================================================== |
---|
| 680 | echo OK ioipsl=$ioipsl |
---|
| 681 | echo '##########################################################' |
---|
| 682 | echo 'Installing MODIPSL, the installation package manager for the ' |
---|
| 683 | echo 'IPSL models and tools' |
---|
| 684 | echo '##########################################################' |
---|
| 685 | echo `date` |
---|
[4210] | 686 | |
---|
[4405] | 687 | cd $MODEL/modipsl |
---|
| 688 | \rm -rf lib/* |
---|
| 689 | cd util |
---|
| 690 | cp AA_make.gdef AA_make.orig |
---|
| 691 | F_C="$compiler -c " |
---|
| 692 | if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] |
---|
| 693 | then |
---|
| 694 | F_C="$compiler -c -cpp " |
---|
| 695 | fi |
---|
| 696 | if [ "$compiler" = "pgf90" ] ; then F_C="$compiler -c -Mpreprocess" ; fi |
---|
| 697 | sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp |
---|
| 698 | sed -e "s:F_L = g95:F_L = $compiler:" \ |
---|
| 699 | -e "s:F_C = g95 -c -cpp:F_C = $F_C": \ |
---|
| 700 | -e 's/g95.*.w_w.*.(F_D)/g95 w_w = '"$OPTIMGCM"'/' \ |
---|
| 701 | -e 's:g95.*.NCDF_INC.*.$:g95 NCDF_INC= '"$ncdfdir"'/include:' \ |
---|
| 702 | -e 's:g95.*.NCDF_LIB.*.$:g95 NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdff -lnetcdf:' \ |
---|
| 703 | -e 's:g95 L_O =:g95 L_O = -Wl,-rpath='"$ncdfdir"'/lib:' \ |
---|
| 704 | -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \ |
---|
| 705 | -e 's:#-Q- g95 M_K = gmake:#-Q- g95 M_K = make:' \ |
---|
| 706 | tmp >| AA_make.gdef |
---|
[4210] | 707 | |
---|
[4405] | 708 | if [ $pcmac == 1 ] |
---|
| 709 | then |
---|
| 710 | cp AA_make.gdef tmp |
---|
| 711 | sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef |
---|
| 712 | fi |
---|
[4210] | 713 | |
---|
| 714 | |
---|
[4405] | 715 | # We use lines for g95 even for the other compilers to run ins_make |
---|
| 716 | if [ "$use_shell" = "ksh" ] ; then |
---|
| 717 | ./ins_make $o_ins_make |
---|
| 718 | else # bash |
---|
| 719 | sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash |
---|
| 720 | if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then |
---|
| 721 | # Bidouille pour compiler sur ada des vieux modipsl.tar |
---|
| 722 | echo 'Warning jean-zay not in AA_make.gdef' |
---|
| 723 | echo 'Think about updating' |
---|
| 724 | exit 1 |
---|
| 725 | fi |
---|
[4210] | 726 | |
---|
[4405] | 727 | chmod u=rwx ins_make.bash |
---|
| 728 | ./ins_make.bash $o_ins_make |
---|
| 729 | fi # of if [ "$use_shell" = "ksh" ] |
---|
[4210] | 730 | |
---|
[4405] | 731 | echo install_lmdz.sh MODIPSL_OK `date` |
---|
[4210] | 732 | |
---|
[4405] | 733 | cd $MODEL/modipsl/modeles/IOIPSL/src |
---|
| 734 | ioipsllog=`pwd`/ioipsl.log |
---|
| 735 | echo '##########################################################' |
---|
| 736 | echo 'Compiling IOIPSL, the interface library with Netcdf' |
---|
| 737 | echo '##########################################################' |
---|
| 738 | echo `date` |
---|
| 739 | echo log file : $ioipsllog |
---|
[4210] | 740 | |
---|
[4405] | 741 | if [ "$use_shell" = "bash" ] ; then |
---|
| 742 | cp Makefile Makefile.ksh |
---|
| 743 | sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile |
---|
| 744 | fi |
---|
| 745 | # if [ "$pclinux" = 1 ] ; then |
---|
| 746 | # Build IOIPSL modules and library |
---|
| 747 | $make clean |
---|
| 748 | $make > $ioipsllog 2>&1 |
---|
| 749 | if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then |
---|
| 750 | # copy module files to lib |
---|
| 751 | cp -f *.mod ../../../lib |
---|
| 752 | fi |
---|
| 753 | # Build IOIPSL tools (ie: "rebuild", if present) |
---|
| 754 | if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then |
---|
| 755 | cd $MODEL/modipsl/modeles/IOIPSL/tools |
---|
| 756 | # adapt Makefile & rebuild script if in bash |
---|
| 757 | if [ "$use_shell" = "bash" ] ; then |
---|
| 758 | cp Makefile Makefile.ksh |
---|
| 759 | sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile |
---|
| 760 | cp rebuild rebuild.ksh |
---|
| 761 | sed -e 's:/bin/ksh:/bin/bash:g' \ |
---|
| 762 | -e 's:print -u2:echo:g' \ |
---|
| 763 | -e 's:print:echo:g' rebuild.ksh > rebuild |
---|
| 764 | fi |
---|
| 765 | $make clean |
---|
| 766 | $make > $ioipsllog 2>&1 |
---|
| 767 | fi |
---|
| 768 | # fi # of if [ "$pclinux" = 1 ] |
---|
[4210] | 769 | |
---|
[4215] | 770 | else # of if [ $ioipsl = 1 ] |
---|
[4405] | 771 | if [ ${hostname:0:5} = jean- ] ; then |
---|
| 772 | cd $MODEL/modipsl |
---|
| 773 | cd util |
---|
[4215] | 774 | if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then |
---|
[4405] | 775 | echo 'Warning jean-zay not in AA_make.gdef' |
---|
| 776 | echo 'Think about updating' |
---|
| 777 | exit 1 |
---|
[4215] | 778 | fi |
---|
| 779 | ./ins_make $o_ins_make |
---|
[4405] | 780 | # Compile IOIPSL on jean-zay |
---|
[4215] | 781 | cd $MODEL/modipsl/modeles/IOIPSL/src |
---|
| 782 | gmake > ioipsl.log |
---|
| 783 | cd $MODEL/modipsl/modeles/IOIPSL/tools |
---|
| 784 | gmake > ioipsl.log |
---|
[4210] | 785 | |
---|
[4405] | 786 | fi |
---|
| 787 | echo install_lmdz.sh ioipsl_OK `date` |
---|
[4215] | 788 | fi # of if [ $ioipsl = 1 ] |
---|
[4210] | 789 | fi |
---|
| 790 | # Saving ioipsl lib for possible parallel compile |
---|
[4215] | 791 | cd $MODEL/modipsl |
---|
| 792 | tar cf ioipsl.tar lib/ bin/ |
---|
[4210] | 793 | |
---|
| 794 | #========================================================================= |
---|
| 795 | if [ "$with_xios" = "y" ] ; then |
---|
[4215] | 796 | echo '##########################################################' |
---|
| 797 | echo 'Compiling XIOS' |
---|
| 798 | echo '##########################################################' |
---|
| 799 | cd $MODEL/modipsl/modeles |
---|
| 800 | xioslog=`pwd`/xios.log |
---|
| 801 | #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_xios.bash |
---|
[4411] | 802 | myget script_install/install_xios.bash |
---|
[4215] | 803 | chmod u=rwx install_xios.bash |
---|
| 804 | if [ ${hostname:0:5} = jean- ] ; then |
---|
[4405] | 805 | svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5 \ |
---|
| 806 | XIOS |
---|
| 807 | cd XIOS/arch |
---|
| 808 | svn update |
---|
| 809 | cd .. |
---|
| 810 | echo "Compiling XIOS, start" `date` \ |
---|
| 811 | "(it takes about 20 min on Jean-Zay)" |
---|
| 812 | echo "log file: $xioslog" |
---|
| 813 | ./make_xios --prod --arch $arch --job 4 > xios.log 2>&1 |
---|
[4215] | 814 | else |
---|
[4405] | 815 | ./install_xios.bash -prefix $MODEL/modipsl/modeles \ |
---|
| 816 | -netcdf ${ncdfdir} -hdf5 ${ncdfdir} \ |
---|
| 817 | -MPI $root_mpi -arch $arch > xios.log 2>&1 |
---|
[4215] | 818 | fi # of case Jean-Zay |
---|
| 819 | if [ -f XIOS/lib/libxios.a ] ; then |
---|
[4405] | 820 | echo "XIOS library successfully generated" |
---|
| 821 | echo install_lmdz.sh XIOS_OK `date` |
---|
[4215] | 822 | fi |
---|
[4210] | 823 | fi |
---|
| 824 | |
---|
| 825 | #============================================================================ |
---|
| 826 | veget_version=false |
---|
| 827 | if [ "$veget" != 'NONE' ] ; then |
---|
[4215] | 828 | cd $MODEL/modipsl/modeles/ORCHIDEE |
---|
| 829 | set +e ; svn upgrade ; set -e |
---|
| 830 | if [ "$veget" = "CMIP6" ] ; then |
---|
[4405] | 831 | veget_version=orchidee2.0 |
---|
| 832 | orchidee_rev=6592 |
---|
[4215] | 833 | else # specific orchidee revision newer than CMIP6, on 2_1 or 2_2 branches |
---|
[4405] | 834 | veget_version=orchidee2.1 |
---|
| 835 | orchidee_rev=$veget |
---|
| 836 | if [ $veget -lt 4465 ] ; then |
---|
| 837 | echo 'Stopping, ORCHIDEE version too old, script needs work on ' \ |
---|
| 838 | 'the CPP flags to pass to makelmdz' |
---|
| 839 | exit 1 |
---|
| 840 | fi |
---|
| 841 | set +e |
---|
| 842 | # which branch is my version on? |
---|
| 843 | orcbranch=`svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r $veget |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}'` |
---|
| 844 | # switch to that branch |
---|
| 845 | echo IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at \ |
---|
| 846 | orchidee-help@listes.ipsl.fr |
---|
| 847 | svn switch -r $veget --accept theirs-full \ |
---|
| 848 | svn://forge.ipsl.jussieu.fr/orchidee/$orcbranch |
---|
| 849 | svn log -r $veget | grep $veget |
---|
| 850 | if [ $? -gt 0 ] ; then |
---|
[4218] | 851 | echo 'Cannot update ORCHIDEE as not on the right branch for ' \ |
---|
[4405] | 852 | 'ORCHIDEE' |
---|
[4215] | 853 | exit |
---|
[4405] | 854 | fi |
---|
| 855 | set -e |
---|
| 856 | set +e ; svn update -r $veget ; set -e |
---|
[4215] | 857 | fi |
---|
| 858 | # Correctif suite debug Jean-Zay |
---|
[4218] | 859 | sed -i -e 's/9010 FORMAT(A52,F17.14)/9010 FORMAT(A52,F20.14)/' \ |
---|
[4405] | 860 | src_stomate/stomate.f90 |
---|
[4215] | 861 | opt_orc="-prod" ; if [ "$optim" = "-debug" ] ; then opt_orc="-debug" ; fi |
---|
[4210] | 862 | |
---|
[4215] | 863 | orchideelog=`pwd`/orchidee.log |
---|
| 864 | echo '########################################################' |
---|
| 865 | echo 'Compiling ORCHIDEE, the continental surface model ' |
---|
| 866 | echo '########################################################' |
---|
| 867 | echo Start of the first compilation of orchidee, in sequential mode: `date` |
---|
| 868 | echo log file : $orchideelog |
---|
[4210] | 869 | |
---|
[4215] | 870 | export ORCHPATH=`pwd` |
---|
| 871 | xios_orchid="-noxios" |
---|
| 872 | if [ "$with_xios" = "y" ] ; then |
---|
[4405] | 873 | xios_orchid="-xios" |
---|
[4215] | 874 | fi |
---|
| 875 | if [ -d tools ] ; then |
---|
[4405] | 876 | ################################################################### |
---|
| 877 | # Pour les experts qui voudraient changer de version d'orchidee. |
---|
| 878 | # Attention : necessite d'avoir le password pour orchidee |
---|
[4210] | 879 | |
---|
[4405] | 880 | # Correctif suite debug Jean-Zay |
---|
| 881 | if [ -f src_global/time.f90 ] ; then |
---|
| 882 | sed -i -e 's/CALL tlen2itau/\!CALL tlen2itau/' src_global/time.f90 |
---|
| 883 | fi |
---|
| 884 | ################################################################### |
---|
| 885 | if [ "$veget_version" == "false" ] ; then |
---|
| 886 | veget_version=orchidee2.0 |
---|
| 887 | fi |
---|
| 888 | cd arch |
---|
| 889 | sed -e s:"%COMPILER .*.$":"%COMPILER $compiler":1 \ |
---|
| 890 | -e s:"%LINK .*.$":"%LINK $compiler":1 \ |
---|
| 891 | -e s:"%FPP_FLAGS .*.$":"%FPP_FLAGS $fpp_flags":1 \ |
---|
| 892 | -e s:"%PROD_FFLAGS .*.$":"%PROD_FFLAGS $OPTIM":1 \ |
---|
| 893 | -e s:"%DEV_FFLAGS .*.$":"%DEV_FFLAGS $OPTDEV":1 \ |
---|
| 894 | -e s:"%DEBUG_FFLAGS .*.$":"%DEBUG_FFLAGS $OPTDEB":1 \ |
---|
| 895 | -e s:"%BASE_FFLAGS .*.$":"%BASE_FFLAGS $OPTPREC":1 \ |
---|
| 896 | -e s:"%BASE_LD .*.$":"%BASE_LD $BASE_LD":1 \ |
---|
| 897 | -e s:"%ARFLAGS .*.$":"%ARFLAGS $ARFLAGS":1 \ |
---|
| 898 | arch-gfortran.fcm > arch-local.fcm |
---|
| 899 | echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" \ |
---|
| 900 | > arch-local.path |
---|
| 901 | echo "NETCDF_INCDIR=${ncdfdir}/include" >> arch-local.path |
---|
| 902 | echo "IOIPSL_INCDIR=$ORCHPATH/../../lib" >> arch-local.path |
---|
| 903 | echo "IOIPSL_LIBDIR=$ORCHPATH/../../lib" >> arch-local.path |
---|
| 904 | echo 'XIOS_INCDIR=${ORCHDIR}/../XIOS/inc' >> arch-local.path |
---|
| 905 | echo 'XIOS_LIBDIR="${ORCHDIR}/../XIOS/lib -lxios"' >> arch-local.path |
---|
| 906 | cd ../ |
---|
[4210] | 907 | |
---|
[4405] | 908 | echo ./makeorchidee_fcm -j $xios_orchid $opt_orc -parallel none \ |
---|
| 909 | -arch $arch |
---|
| 910 | ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel none \ |
---|
| 911 | -arch $arch > $orchideelog 2>&1 |
---|
| 912 | pwd |
---|
[4215] | 913 | else # of "if [ -d tools ]" |
---|
[4405] | 914 | if [ -d src_parallel ] ; then |
---|
| 915 | liste_src="parallel parameters global stomate sechiba driver" |
---|
| 916 | if [ "$veget_version" == "false" ] ; then |
---|
| 917 | veget_version=orchidee2.0 |
---|
| 918 | fi |
---|
| 919 | fi |
---|
| 920 | for d in $liste_src ; do |
---|
| 921 | src_d=src_$d |
---|
| 922 | echo src_d $src_d |
---|
| 923 | echo ls ; ls |
---|
| 924 | if [ ! -d $src_d ] ; then |
---|
| 925 | echo Problem orchidee : no $src_d ; exit |
---|
| 926 | fi |
---|
| 927 | cd $src_d ; \rm -f *.mod make ; $make clean |
---|
| 928 | $make > $orchideelog 2>&1 |
---|
| 929 | if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then |
---|
| 930 | cp -f *.mod ../../../lib |
---|
| 931 | fi |
---|
| 932 | cd .. |
---|
| 933 | done |
---|
[4215] | 934 | fi # of "if [ -d tools ]" |
---|
| 935 | echo install_lmdz.sh orchidee_compil_seq_OK `date` |
---|
[4210] | 936 | fi # of if [ "$veget" != 'NONE' ] |
---|
| 937 | |
---|
| 938 | |
---|
| 939 | #============================================================================ |
---|
| 940 | # Ehouarn: the directory name LMDZ* depends on version/tar file... |
---|
| 941 | if [ -d $MODEL/modipsl/modeles/LMD* ] ; then |
---|
[4215] | 942 | echo '###############################################################' |
---|
| 943 | echo 'Preparing LMDZ compilation : arch file, svn switch if needed...' |
---|
| 944 | echo '###############################################################' |
---|
| 945 | cd $MODEL/modipsl/modeles/LMD* |
---|
| 946 | LMDZPATH=`pwd` |
---|
[4210] | 947 | else |
---|
[4215] | 948 | echo "ERROR: No LMD* directory !!!" |
---|
| 949 | exit |
---|
[4210] | 950 | fi |
---|
| 951 | |
---|
| 952 | ########################################################### |
---|
| 953 | # For those who want to use fcm to compile via : |
---|
| 954 | # makelmdz_fcm -arch local ..... |
---|
| 955 | ############################################################ |
---|
| 956 | |
---|
| 957 | |
---|
| 958 | |
---|
| 959 | cd $MODEL/modipsl/modeles/LMDZ* |
---|
| 960 | lmdzlog=`pwd`/lmdz.log |
---|
| 961 | |
---|
| 962 | ################################################################## |
---|
| 963 | # Possibly update LMDZ if a specific svn release is requested |
---|
| 964 | ################################################################## |
---|
| 965 | |
---|
| 966 | set +e ; svn upgrade ; set -e |
---|
| 967 | |
---|
| 968 | if [ "$svn" = "last" ] ; then svnopt="" ; else svnopt="-r $svn" ; fi |
---|
| 969 | if [ "$svn" != "" ] ; then |
---|
| 970 | set +e ; svn info | grep -q 'http:' |
---|
| 971 | if [ $? = 0 ] ; then |
---|
[4218] | 972 | svn switch --relocate http://svn.lmd.jussieu.fr/LMDZ \ |
---|
[4405] | 973 | https://svn.lmd.jussieu.fr/LMDZ |
---|
[4210] | 974 | fi |
---|
| 975 | svn update $svnopt |
---|
[4372] | 976 | set -e |
---|
[4210] | 977 | fi |
---|
| 978 | |
---|
[4372] | 979 | #--------------------------------------------------------------------- |
---|
[4218] | 980 | # Retrieve the final svn release number, and adjust compilation |
---|
| 981 | # options accordingly |
---|
[4372] | 982 | # If svn not available, will use the svn writen in $MODEL/Readm*md |
---|
| 983 | # For old version it assumes that it is before 4185 (the version |
---|
| 984 | # for which the test was introduced |
---|
| 985 | #--------------------------------------------------------------------- |
---|
[4210] | 986 | |
---|
[4372] | 987 | set +e ; mysvn=`svnversion . | egrep -o "[0-9]+" 2>/dev/null` ; set -e |
---|
| 988 | if [ "$mysvn" = "" ] ; then mysvn=`grep 'Revision: [0-9]' $MODEL/Read*.md | awk ' { print $2 } ' 2>/dev/null` ; fi |
---|
| 989 | if [ "$mysvn" = "" ] ; then mysvn=4190 ; fi |
---|
| 990 | |
---|
[4427] | 991 | if [[ "$pclinux" = "1" && ! -f arch/arch-local.path ]] ; then |
---|
| 992 | |
---|
| 993 | # create local 'arch' files (if on Linux PC): |
---|
| 994 | cd arch |
---|
| 995 | # arch-local.path file |
---|
| 996 | # test for version as arch.pth file changed format with rev 4426 |
---|
| 997 | if [ "$mysvn" -gt 4425 ] ; then |
---|
| 998 | echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib \"" > arch-local.path |
---|
| 999 | echo "NETCDF_LIB=\"-lnetcdff -lnetcdf\"" >> arch-local.path |
---|
| 1000 | echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path |
---|
| 1001 | echo 'NETCDF95_INCDIR=-I$LMDGCM/../../include' >> arch-local.path |
---|
| 1002 | echo 'NETCDF95_LIBDIR=-L$LMDGCM/../../lib' >> arch-local.path |
---|
| 1003 | echo 'NETCDF95_LIB=-lnetcdf95' >> arch-local.path |
---|
| 1004 | echo 'IOIPSL_INCDIR=-I$LMDGCM/../../lib' >> arch-local.path |
---|
| 1005 | echo 'IOIPSL_LIBDIR=-L$LMDGCM/../../lib' >> arch-local.path |
---|
| 1006 | echo 'IOIPSL_LIB=-lioipsl' >> arch-local.path |
---|
| 1007 | echo 'XIOS_INCDIR=-I$LMDGCM/../XIOS/inc' >> arch-local.path |
---|
| 1008 | echo 'XIOS_LIBDIR=-L$LMDGCM/../XIOS/lib' >> arch-local.path |
---|
| 1009 | echo "XIOS_LIB=\"-lxios -lstdc++\"" >> arch-local.path |
---|
| 1010 | echo 'ORCH_INCDIR=-I$LMDGCM/../../lib' >> arch-local.path |
---|
| 1011 | echo 'ORCH_LIBDIR=-L$LMDGCM/../../lib' >> arch-local.path |
---|
| 1012 | else |
---|
| 1013 | echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" \ |
---|
| 1014 | > arch-local.path |
---|
| 1015 | echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path |
---|
| 1016 | echo 'NETCDF95_INCDIR=$LMDGCM/../../include' >> arch-local.path |
---|
| 1017 | echo 'NETCDF95_LIBDIR=$LMDGCM/../../lib' >> arch-local.path |
---|
| 1018 | echo 'IOIPSL_INCDIR=$LMDGCM/../../lib' >> arch-local.path |
---|
| 1019 | echo 'IOIPSL_LIBDIR=$LMDGCM/../../lib' >> arch-local.path |
---|
| 1020 | echo 'XIOS_INCDIR=$LMDGCM/../XIOS/inc' >> arch-local.path |
---|
| 1021 | echo 'XIOS_LIBDIR=$LMDGCM/../XIOS/lib' >> arch-local.path |
---|
| 1022 | echo 'ORCH_INCDIR=$LMDGCM/../../lib' >> arch-local.path |
---|
| 1023 | echo 'ORCH_LIBDIR=$LMDGCM/../../lib' >> arch-local.path |
---|
| 1024 | fi |
---|
| 1025 | |
---|
| 1026 | if [ $pcmac == 1 ] ; then |
---|
| 1027 | BASE_LD="$BASE_LD -Wl,-rpath,${ncdfdir}/lib" |
---|
| 1028 | else |
---|
| 1029 | BASE_LD="$BASE_LD -Wl,-rpath=${ncdfdir}/lib" |
---|
| 1030 | fi |
---|
| 1031 | # Arch-local.fcm file (adapted from arch-linux-32bit.fcm) |
---|
| 1032 | |
---|
| 1033 | if [ $real = r8 ] ; then FPP_DEF=NC_DOUBLE ; else FPP_DEF="" ; fi |
---|
| 1034 | sed -e s:"%COMPILER .*.$":"%COMPILER $compiler":1 \ |
---|
| 1035 | -e s:"%LINK .*.$":"%LINK $compiler":1 \ |
---|
| 1036 | -e s:"%PROD_FFLAGS .*.$":"%PROD_FFLAGS $OPTIM":1 \ |
---|
| 1037 | -e s:"%DEV_FFLAGS .*.$":"%DEV_FFLAGS $OPTDEV":1 \ |
---|
| 1038 | -e s:"%DEBUG_FFLAGS .*.$":"%DEBUG_FFLAGS $OPTDEB":1 \ |
---|
| 1039 | -e s:"%BASE_FFLAGS .*.$":"%BASE_FFLAGS $OPTPREC":1 \ |
---|
| 1040 | -e s:"%FPP_DEF .*.$":"%FPP_DEF $FPP_DEF":1 \ |
---|
| 1041 | -e s:"%BASE_LD .*.$":"%BASE_LD $BASE_LD":1 \ |
---|
| 1042 | -e s:"%ARFLAGS .*.$":"%ARFLAGS $ARFLAGS":1 \ |
---|
| 1043 | arch-linux-32bit.fcm > arch-local.fcm |
---|
| 1044 | |
---|
| 1045 | cd .. |
---|
| 1046 | ### Adapt "bld.cfg" (add the shell): |
---|
| 1047 | #whereisthatshell=$(which ${use_shell}) |
---|
| 1048 | #echo "bld::tool::SHELL $whereisthatshell" >> bld.cfg |
---|
| 1049 | |
---|
| 1050 | fi # of if [ "$pclinux" = 1 ] |
---|
[4372] | 1051 | #--------------------------------------------------------------------- |
---|
[4210] | 1052 | # Option de compilation du rayonnement : depend de $mysvn ><= r4185 |
---|
[4372] | 1053 | #--------------------------------------------------------------------- |
---|
[4210] | 1054 | opt_rad="" |
---|
| 1055 | |
---|
| 1056 | case $rad in |
---|
| 1057 | oldrad) iflag_rrtm=0 ; NSW=2 ; opt_rad="" ;; |
---|
[4218] | 1058 | rrtm) iflag_rrtm=1 ; NSW=6 |
---|
[4405] | 1059 | if [ $mysvn -le 4185 ] ; then |
---|
| 1060 | opt_rad="-rrtm true" |
---|
| 1061 | else |
---|
| 1062 | opt_rad="-rad rrtm" |
---|
| 1063 | fi ;; |
---|
[4210] | 1064 | ecrad) iflag_rrtm=2 ; NSW=6 ; opt_rad="-rad ecrad" ;; |
---|
| 1065 | *) echo Only oldrad rrtm ecrad for rad option ; exit |
---|
| 1066 | esac |
---|
| 1067 | |
---|
[4218] | 1068 | if [ $mysvn -le 4185 -a $rad = "ecrad" ] ; then |
---|
| 1069 | echo "ecrad only available for LMDZ rev starting with 4186 " ; exit |
---|
| 1070 | fi |
---|
[4210] | 1071 | |
---|
| 1072 | ################################################################## |
---|
| 1073 | |
---|
[4213] | 1074 | |
---|
| 1075 | if [[ ! -f libf/misc/netcdf95.F90 && ! -d $MODEL/NetCDF95-0.2 ]] |
---|
| 1076 | then |
---|
| 1077 | cd $MODEL |
---|
[4417] | 1078 | myget src_archives/netcdf/NetCDF95-0.2.tar.gz |
---|
[4213] | 1079 | tar -xf NetCDF95-0.2.tar.gz |
---|
| 1080 | rm NetCDF95-0.2.tar.gz |
---|
| 1081 | cd NetCDF95-0.2 |
---|
| 1082 | mkdir build |
---|
| 1083 | cd build |
---|
| 1084 | cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$ncdfdir \ |
---|
[4405] | 1085 | -DCMAKE_INSTALL_PREFIX=$MODEL/modipsl |
---|
[4213] | 1086 | make install |
---|
| 1087 | cd $MODEL/modipsl/modeles/LMDZ* |
---|
| 1088 | fi |
---|
| 1089 | |
---|
[4210] | 1090 | echo '##################################################################' |
---|
| 1091 | echo "Preparing script compile.sh for LMDZ compilation" |
---|
| 1092 | echo "It will only be run automatically if bench=1/tuto" |
---|
| 1093 | echo Here bench=$bench |
---|
| 1094 | echo '##################################################################' |
---|
| 1095 | |
---|
[4218] | 1096 | if [ "$env_file" != "" ] ; then |
---|
| 1097 | mv arch/arch-${arch}.env arch/arch-${arch}.orig |
---|
| 1098 | \cp -f $env_file arch/arch-${arch}.env |
---|
| 1099 | fi |
---|
[4210] | 1100 | |
---|
[4218] | 1101 | if [ $compile_with_fcm = 1 ] ; then |
---|
| 1102 | makelmdz="makelmdz_fcm $optim -arch $arch -j 8 " |
---|
| 1103 | else |
---|
| 1104 | makelmdz="makelmdz $optim -arch $arch" |
---|
| 1105 | fi |
---|
[4210] | 1106 | |
---|
| 1107 | # sequential compilation |
---|
| 1108 | if [ "$sequential" = 1 ] ; then |
---|
[4215] | 1109 | echo Sequential compilation command, saved in compile.sh: |
---|
[4218] | 1110 | echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp " \ |
---|
[4405] | 1111 | "-d ${grid_resolution} -v $veget_version gcm " |
---|
[4218] | 1112 | echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp " \ |
---|
[4405] | 1113 | "-d ${grid_resolution} -v $veget_version gcm " > compile.sh |
---|
[4215] | 1114 | chmod +x ./compile.sh |
---|
| 1115 | if [ $bench = 1 ] ; then |
---|
[4405] | 1116 | echo install_lmdz.sh start_lmdz_seq_compilation `date` |
---|
| 1117 | echo log file: $lmdzlog |
---|
| 1118 | ./compile.sh > $lmdzlog 2>&1 |
---|
| 1119 | echo install_lmdz.sh end_lmdz_seq_compilation `date` |
---|
[4215] | 1120 | fi |
---|
[4210] | 1121 | fi # fin sequential |
---|
| 1122 | |
---|
| 1123 | # compiling in parallel mode |
---|
| 1124 | if [ $parallel != "none" ] ; then |
---|
| 1125 | echo '##########################################################' |
---|
[4215] | 1126 | echo ' Parallel compile ' |
---|
[4210] | 1127 | echo '##########################################################' |
---|
[4215] | 1128 | echo "(after saving the sequential libs and binaries)" |
---|
| 1129 | cd $MODEL/modipsl |
---|
| 1130 | tar cf sequential.tar bin/ lib/ |
---|
| 1131 | \rm -rf bin/ lib/ |
---|
| 1132 | tar xf ioipsl.tar |
---|
| 1133 | # |
---|
| 1134 | # Orchidee |
---|
| 1135 | # |
---|
| 1136 | cd $ORCHPATH |
---|
| 1137 | if [ -d src_parallel -a $veget != 'NONE' ] ; then |
---|
[4405] | 1138 | cd arch |
---|
| 1139 | sed \ |
---|
| 1140 | -e s:"%COMPILER.*.$":"%COMPILER $par_comp":1 \ |
---|
| 1141 | -e s:"%LINK.*.$":"%LINK $par_comp":1 \ |
---|
| 1142 | -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS $MPI_FLAGS":1 \ |
---|
| 1143 | -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS $OMP_FLAGS":1 \ |
---|
| 1144 | -e s:"%MPI_LD.*.$":"%MPI_LD $MPI_LD":1 \ |
---|
| 1145 | -e s:"%OMP_LD.*.$":"%OMP_LD $OMP_LD":1 \ |
---|
| 1146 | arch-local.fcm > tmp.fcm |
---|
[4210] | 1147 | |
---|
[4405] | 1148 | mv tmp.fcm arch-local.fcm |
---|
| 1149 | cd ../ |
---|
| 1150 | echo Compiling ORCHIDEE in parallel mode `date` |
---|
| 1151 | echo logfile $orchideelog |
---|
| 1152 | echo "NOTE : to recompile it when necessary, use ./compile_orc.sh " \ |
---|
| 1153 | "in modipsl/modeles/ORCHIDEE" |
---|
| 1154 | echo ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc \ |
---|
| 1155 | -parallel $parallel -arch $arch > compile_orc.sh |
---|
| 1156 | echo ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc \ |
---|
| 1157 | -parallel $parallel -arch $arch >> compile_orc.sh |
---|
| 1158 | echo echo Now you must also recompile LMDZ, by running ./compile.sh \ |
---|
| 1159 | in modeles/LMDZ >> compile_orc.sh |
---|
| 1160 | chmod u+x compile_orc.sh |
---|
| 1161 | ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc \ |
---|
| 1162 | -parallel $parallel -arch $arch > $orchideelog 2>&1 |
---|
| 1163 | ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel $parallel \ |
---|
| 1164 | -arch $arch >> $orchideelog 2>&1 |
---|
| 1165 | echo End of ORCHIDEE compilation in parallel mode `date` |
---|
[4215] | 1166 | elif [ $veget != 'NONE' ] ; then |
---|
[4405] | 1167 | echo '##########################################################' |
---|
| 1168 | echo ' Orchidee version too old ' |
---|
| 1169 | echo ' Please update to new version ' |
---|
| 1170 | echo '##########################################################' |
---|
| 1171 | exit |
---|
[4215] | 1172 | fi # of [ -d src_parallel -a $veget != 'NONE' ] |
---|
[4210] | 1173 | |
---|
[4215] | 1174 | # LMDZ |
---|
| 1175 | cd $LMDZPATH |
---|
| 1176 | if [ $arch = local ] ; then |
---|
[4405] | 1177 | cd arch |
---|
| 1178 | sed -e s:"%COMPILER.*.$":"%COMPILER $par_comp":1 \ |
---|
| 1179 | -e s:"%LINK.*.$":"%LINK $par_comp":1 \ |
---|
| 1180 | -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS $MPI_FLAGS":1 \ |
---|
| 1181 | -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS $OMP_FLAGS":1 \ |
---|
| 1182 | -e s:"%ARFLAGS.*.$":"%ARFLAGS $ARFLAGS":1 \ |
---|
| 1183 | -e s@"%BASE_LD.*.$"@"%BASE_LD -Wl,-rpath=${root_mpi}/lib:${ncdfdir}/lib"@1 \ |
---|
| 1184 | -e s:"%MPI_LD.*.$":"%MPI_LD $MPI_LD":1 \ |
---|
| 1185 | -e s:"%OMP_LD.*.$":"%OMP_LD $OMP_LD":1 \ |
---|
| 1186 | arch-local.fcm > tmp.fcm |
---|
| 1187 | mv tmp.fcm arch-local.fcm |
---|
| 1188 | cd ../ |
---|
[4215] | 1189 | fi |
---|
| 1190 | rm -f compile.sh |
---|
| 1191 | echo resol=${grid_resolution} >> compile.sh |
---|
| 1192 | if [ ${hostname:0:5} = jean- -a "$cosp" = "v2" ] ; then |
---|
[4210] | 1193 | |
---|
[4405] | 1194 | echo LMDZ compilation command in parallel mode, saved in compile.sh, \ |
---|
| 1195 | is : |
---|
| 1196 | echo "(ATTENTION le probleme de cospv2 sur jean-zay en mode prod " \ |
---|
| 1197 | "n est pas corrige ! )" |
---|
| 1198 | # ATTENTION le probleme de cospv2 sur jean-zay en mode prod n |
---|
| 1199 | # est pas corrige |
---|
| 1200 | echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \ |
---|
| 1201 | $opt_makelmdz_xios -d \$resol -v $veget_version -mem \ |
---|
| 1202 | -parallel $parallel gcm >> compile.sh |
---|
| 1203 | echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \ |
---|
| 1204 | $opt_makelmdz_xios -d \$resol -v $veget_version -mem \ |
---|
| 1205 | -parallel $parallel gcm |
---|
[4215] | 1206 | else |
---|
[4405] | 1207 | echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \ |
---|
| 1208 | $opt_makelmdz_xios -d \$resol -v $veget_version -mem \ |
---|
| 1209 | -parallel $parallel gcm >> compile.sh |
---|
| 1210 | echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \ |
---|
| 1211 | $opt_makelmdz_xios -d \$resol -v $veget_version -mem \ |
---|
| 1212 | -parallel $parallel gcm |
---|
[4215] | 1213 | fi |
---|
| 1214 | chmod +x ./compile.sh |
---|
[4210] | 1215 | |
---|
[4215] | 1216 | if [ $bench = 1 ] ; then |
---|
[4405] | 1217 | echo Compiling LMDZ in parallel mode `date`, LMDZ log file: $lmdzlog |
---|
| 1218 | ./compile.sh > $lmdzlog 2>&1 |
---|
[4215] | 1219 | fi |
---|
| 1220 | |
---|
[4210] | 1221 | fi # of if [ $parallel != "none" ] |
---|
| 1222 | |
---|
| 1223 | |
---|
| 1224 | ################################################################## |
---|
| 1225 | # Verification du succes de la compilation |
---|
| 1226 | ################################################################## |
---|
| 1227 | |
---|
| 1228 | # Recherche de l'executable dont le nom a change au fil du temps ... |
---|
| 1229 | # suffix contains radiative option starting with revision 4186 |
---|
| 1230 | if [ $mysvn -ge 4186 ] ; then suff_exe=_${rad}${suff_exe} ; fi |
---|
| 1231 | gcm="" |
---|
[4219] | 1232 | |
---|
[4218] | 1233 | for exe in gcm.e bin/gcm_${grid_resolution}_phylmd${suff_exe}${suff_orc}.e |
---|
| 1234 | do |
---|
| 1235 | if [ -f $exe ] ; then gcm=$exe ; fi |
---|
[4210] | 1236 | done |
---|
| 1237 | |
---|
| 1238 | if [ "$gcm" = "" ] ; then |
---|
[4215] | 1239 | if [ $bench = 1 ] ; then |
---|
[4405] | 1240 | echo 'Compilation failed !! Cannot run the benchmark;' |
---|
| 1241 | exit |
---|
[4215] | 1242 | else |
---|
[4405] | 1243 | echo 'Compilation not done (only done when bench=1)' |
---|
[4215] | 1244 | fi |
---|
[4210] | 1245 | else |
---|
[4215] | 1246 | echo '##########################################################' |
---|
| 1247 | echo 'Compilation successfull !! ' `date` |
---|
| 1248 | echo '##########################################################' |
---|
| 1249 | echo The executable is $gcm |
---|
[4210] | 1250 | fi |
---|
| 1251 | |
---|
| 1252 | ################################################################## |
---|
| 1253 | # Below, we run a benchmark if bench=1 or tuto |
---|
| 1254 | ################################################################## |
---|
| 1255 | |
---|
| 1256 | if [ $bench = tuto ] ; then |
---|
[4286] | 1257 | myget Training/tutorial.tar ; tar xf tutorial.tar ; cd TUTORIAL |
---|
[4218] | 1258 | ./init.sh |
---|
[4210] | 1259 | |
---|
| 1260 | elif [[ $bench = 1 && ! -d BENCH${grid_resolution} ]] ; then |
---|
[4215] | 1261 | # TOUTE CETTE SECTION DEVRAIT DISPARAITRE POUR UNE COMMANDE |
---|
| 1262 | # OU DES BENCHS PAR MOTS CLES COMME tuto |
---|
[4210] | 1263 | |
---|
[4215] | 1264 | echo '##########################################################' |
---|
| 1265 | echo ' Running a test run ' |
---|
| 1266 | echo '##########################################################' |
---|
[4210] | 1267 | |
---|
[4215] | 1268 | \rm -rf BENCH${grid_resolution} |
---|
| 1269 | bench=bench_lmdz_${grid_resolution} |
---|
| 1270 | echo install_lmdz.sh before bench download `date` |
---|
| 1271 | #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/$bench.tar.gz |
---|
| 1272 | myget 3DBenchs/$bench.tar.gz |
---|
| 1273 | echo install_lmdz.sh after bench download `date` |
---|
[4286] | 1274 | tar xf $bench.tar.gz |
---|
[4210] | 1275 | |
---|
[4215] | 1276 | if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then |
---|
[4405] | 1277 | cd BENCH${grid_resolution} |
---|
| 1278 | # copier les fichiers namelist input et output our COSP |
---|
| 1279 | cp ../DefLists/cosp*_input_nl.txt . |
---|
| 1280 | cp ../DefLists/cosp*_output_nl.txt . |
---|
| 1281 | # Activer la cles ok_cosp pour tourner avec COSP |
---|
| 1282 | sed -e 's@ok_cosp=n@ok_cosp=y@' config.def > tmp |
---|
| 1283 | \mv -f tmp config.def |
---|
| 1284 | cd .. |
---|
[4215] | 1285 | fi |
---|
[4210] | 1286 | |
---|
[4215] | 1287 | if [ -n "$physiq" ]; then |
---|
[4405] | 1288 | cd BENCH${grid_resolution} |
---|
| 1289 | if [ -f physiq.def_${physiq} ]; then |
---|
| 1290 | cp physiq.def_${physiq} physiq.def |
---|
| 1291 | echo using physiq.def_${physiq} |
---|
| 1292 | else |
---|
| 1293 | echo using standard physiq.def |
---|
| 1294 | fi |
---|
| 1295 | cd .. |
---|
[4215] | 1296 | else |
---|
[4405] | 1297 | echo using standard physiq.def |
---|
[4215] | 1298 | fi |
---|
[4210] | 1299 | |
---|
[4215] | 1300 | if [ "$with_xios" = "y" ] ; then |
---|
[4405] | 1301 | cd BENCH${grid_resolution} |
---|
| 1302 | cp ../DefLists/iodef.xml . |
---|
| 1303 | cp ../DefLists/context_lmdz.xml . |
---|
| 1304 | cp ../DefLists/field_def_lmdz.xml . |
---|
| 1305 | # A raffiner par la suite |
---|
| 1306 | echo A FAIRE : Copier les *xml en fonction de l option cosp |
---|
| 1307 | cp ../DefLists/field_def_cosp*.xml . |
---|
| 1308 | cp ../DefLists/file_def_hist*xml . |
---|
| 1309 | # adapt iodef.xml to use attached mode |
---|
| 1310 | sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' \ |
---|
| 1311 | iodef.xml > tmp |
---|
| 1312 | \mv -f tmp iodef.xml |
---|
[4210] | 1313 | |
---|
[4405] | 1314 | # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE. |
---|
| 1315 | # except for histday |
---|
| 1316 | for histfile in file_def_hist*xml |
---|
| 1317 | do |
---|
| 1318 | if [ "$histfile" = "file_def_histday_lmdz.xml" ] ; then |
---|
| 1319 | sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' \ |
---|
| 1320 | $histfile > tmp |
---|
| 1321 | \mv -f tmp $histfile |
---|
| 1322 | sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile \ |
---|
| 1323 | > tmp |
---|
| 1324 | \mv -f tmp $histfile |
---|
| 1325 | sed -e 's@compression_level="2"@compression_level="0"@' \ |
---|
| 1326 | $histfile > tmp |
---|
| 1327 | \mv -f tmp $histfile |
---|
| 1328 | else |
---|
| 1329 | sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' \ |
---|
| 1330 | $histfile > tmp |
---|
| 1331 | \mv -f tmp $histfile |
---|
| 1332 | fi |
---|
| 1333 | done |
---|
| 1334 | # and add option "ok_all_xml=y" in config.def |
---|
| 1335 | echo "### XIOS outputs" >> config.def |
---|
| 1336 | echo 'ok_all_xml=.true.' >> config.def |
---|
[4210] | 1337 | |
---|
[4405] | 1338 | #activer les sorties pour Cosp |
---|
| 1339 | if [ "$cosp" = "v1" ] ; then |
---|
| 1340 | histfile=file_def_histdayCOSP_lmdz.xml |
---|
| 1341 | sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp |
---|
| 1342 | \mv -f tmp $histfile |
---|
| 1343 | sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp |
---|
| 1344 | \mv -f tmp $histfile |
---|
| 1345 | sed -e 's@compression_level="2"@compression_level="0"@' \ |
---|
| 1346 | $histfile > tmp |
---|
| 1347 | \mv -f tmp $histfile |
---|
| 1348 | fi |
---|
| 1349 | if [ "$cosp" = "v2" ] ; then |
---|
| 1350 | histfile=file_def_histdayCOSPv2_lmdz.xml |
---|
| 1351 | sed -e 's@compression_level="2"@compression_level="0"@' \ |
---|
| 1352 | $histfile > tmp |
---|
| 1353 | \mv -f tmp $histfile |
---|
| 1354 | contextfile=context_lmdz.xml |
---|
| 1355 | sed -e 's@src="./file_def_histdayCOSP_lmdz.xml"@src="./file_def_histdayCOSPv2_lmdz.xml"@' \ |
---|
| 1356 | $contextfile > tmp |
---|
| 1357 | \mv -f tmp $contextfile |
---|
| 1358 | sed -e 's@src="./file_def_histmthCOSP_lmdz.xml"@src="./file_def_histmthCOSPv2_lmdz.xml"@' \ |
---|
| 1359 | $contextfile > tmp |
---|
| 1360 | \mv -f tmp $contextfile |
---|
| 1361 | sed -e 's@src="./file_def_histhfCOSP_lmdz.xml"@src="./file_def_histhfCOSPv2_lmdz.xml"@' \ |
---|
| 1362 | $contextfile > tmp |
---|
| 1363 | \mv -f tmp $contextfile |
---|
| 1364 | fieldfile=field_def_lmdz.xml |
---|
| 1365 | sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile \ |
---|
| 1366 | > tmp |
---|
| 1367 | \mv -f tmp $fieldfile |
---|
| 1368 | fi |
---|
[4210] | 1369 | |
---|
[4405] | 1370 | cd .. |
---|
[4215] | 1371 | fi |
---|
[4210] | 1372 | |
---|
[4215] | 1373 | # Cas Bensh avec ecrad |
---|
| 1374 | if [ "$rad" = "ecrad" ] ; then |
---|
[4405] | 1375 | cd BENCH${grid_resolution} |
---|
| 1376 | cp ../DefLists/namelist_ecrad . |
---|
| 1377 | cp -r ../libf/phylmd/ecrad/data . |
---|
| 1378 | cd .. |
---|
[4215] | 1379 | fi |
---|
[4210] | 1380 | |
---|
[4215] | 1381 | # Adjusting bench physiq.def to radiative code chosen |
---|
| 1382 | cd BENCH${grid_resolution} |
---|
[4218] | 1383 | sed -e 's/iflag_rrtm=.*.$/iflag_rrtm='$iflag_rrtm'/' \ |
---|
[4405] | 1384 | -e 's/NSW=.*.$/NSW='$NSW'/' physiq.def > tmpdef |
---|
[4215] | 1385 | \mv tmpdef physiq.def |
---|
| 1386 | cd .. |
---|
[4210] | 1387 | |
---|
[4215] | 1388 | cp $gcm BENCH${grid_resolution}/gcm.e |
---|
[4210] | 1389 | |
---|
[4215] | 1390 | cd BENCH${grid_resolution} |
---|
| 1391 | # On cree le fichier bench.sh au besoin |
---|
| 1392 | # Dans le cas 48x36x39 le bench.sh existe deja en parallele |
---|
[4210] | 1393 | |
---|
[4215] | 1394 | if [ "$grid_resolution" = "48x36x39" ] ; then |
---|
[4405] | 1395 | echo On ne touche pas au bench.sh |
---|
| 1396 | # But we have to adapt "run_local.sh" for $mpirun |
---|
| 1397 | sed -e "s@mpirun@$mpirun@g" run_local.sh > tmp |
---|
| 1398 | mv -f tmp run_local.sh |
---|
| 1399 | chmod u=rwx run_local.sh |
---|
[4215] | 1400 | elif [ "${parallel:0:3}" = "mpi" ] ; then |
---|
[4405] | 1401 | # Lancement avec deux procs mpi et 2 openMP |
---|
| 1402 | echo "export OMP_STACKSIZE=800M" > bench.sh |
---|
| 1403 | if [ "${parallel:4:3}" = "omp" ] ; then |
---|
[4215] | 1404 | echo "export OMP_NUM_THREADS=2" >> bench.sh |
---|
[4405] | 1405 | fi |
---|
| 1406 | if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then |
---|
[4215] | 1407 | if [ ${hostname:0:5} = jean- ] ; then |
---|
[4405] | 1408 | chmod +x ../arch.env |
---|
| 1409 | ../arch.env |
---|
| 1410 | echo "ulimit -s 2000000" >> bench.sh |
---|
[4215] | 1411 | else |
---|
[4405] | 1412 | echo "ulimit -s 200000" >> bench.sh |
---|
| 1413 | fi |
---|
| 1414 | else |
---|
[4215] | 1415 | echo "ulimit -s unlimited" >> bench.sh |
---|
[4405] | 1416 | fi |
---|
| 1417 | if [ ${hostname:0:5} = jean- ] ; then |
---|
[4215] | 1418 | . ../arch/arch-${arch}.env |
---|
[4218] | 1419 | echo "srun -n 2 -A $idris_acct@cpu gcm.e > listing 2>&1" \ |
---|
[4405] | 1420 | >> bench.sh |
---|
| 1421 | else |
---|
[4215] | 1422 | echo "$mpirun -np 2 gcm.e > listing 2>&1" >> bench.sh |
---|
[4405] | 1423 | fi |
---|
| 1424 | # Add rebuild, using reb.sh if it is there |
---|
| 1425 | echo 'if [ -f reb.sh ] ; then' >> bench.sh |
---|
| 1426 | echo ' ./reb.sh histday ; ./reb.sh histmth ; ./reb.sh histhf ; ' \ |
---|
| 1427 | './reb.sh histins ; ./reb.sh stomate_history ; ' \ |
---|
| 1428 | './reb.sh sechiba_history ; ./reb.sh sechiba_out_2 ' >> bench.sh |
---|
| 1429 | echo 'fi' >> bench.sh |
---|
[4215] | 1430 | else |
---|
[4405] | 1431 | echo "./gcm.e > listing 2>&1" > bench.sh |
---|
[4215] | 1432 | fi |
---|
| 1433 | # Getting orchidee stuff |
---|
| 1434 | if [ $veget == 'CMIP6' ] ; then |
---|
[4405] | 1435 | #echo 'myget 3DBenchs/BENCHorch11.tar.gz' |
---|
| 1436 | #myget 3DBenchs/BENCHorch11.tar.gz |
---|
| 1437 | #tar xvzf BENCHorch11.tar.gz |
---|
| 1438 | echo 'myget 3DBenchs/BENCHCMIP6.tar.gz' |
---|
| 1439 | myget 3DBenchs/BENCHCMIP6.tar.gz |
---|
| 1440 | tar xvzf BENCHCMIP6.tar.gz |
---|
| 1441 | sed -e "s:VEGET=n:VEGET=y:" config.def > tmp |
---|
| 1442 | mv -f tmp config.def |
---|
| 1443 | if [ "$with_xios" = "y" ] ; then |
---|
[4215] | 1444 | cp ../../ORCHIDEE/src_xml/context_orchidee.xml . |
---|
[4218] | 1445 | echo '<context id="orchidee" src="./context_orchidee.xml"/>' \ |
---|
[4405] | 1446 | > add.tmp |
---|
[4215] | 1447 | cp ../../ORCHIDEE/src_xml/field_def_orchidee.xml . |
---|
| 1448 | cp ../../ORCHIDEE/src_xml/file_def_orchidee.xml . |
---|
| 1449 | cp ../../ORCHIDEE/src_xml/file_def_input_orchidee.xml . |
---|
| 1450 | if [ -f ../../ORCHIDEE/src_xml/context_input_orchidee.xml ] ; then |
---|
[4405] | 1451 | cp ../../ORCHIDEE/src_xml/context_input_orchidee.xml . |
---|
| 1452 | echo '<context id="orchidee" ' \ |
---|
| 1453 | 'src="./context_input_orchidee.xml"/>' >> add.tmp |
---|
[4215] | 1454 | fi |
---|
| 1455 | sed -e '/id="LMDZ"/r add.tmp' iodef.xml > tmp |
---|
| 1456 | mv tmp iodef.xml |
---|
[4218] | 1457 | sed -e'{/sechiba1/ s/enabled="_AUTO_"/type="one_file" enabled=".TRUE."/}' \ |
---|
[4405] | 1458 | file_def_orchidee.xml > tmp |
---|
| 1459 | \mv -f tmp file_def_orchidee.xml |
---|
[4218] | 1460 | sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' \ |
---|
[4405] | 1461 | file_def_orchidee.xml > tmp |
---|
| 1462 | \mv -f tmp file_def_orchidee.xml |
---|
[4218] | 1463 | sed -e 's@output_level="_AUTO_"@output_level="1"@' \ |
---|
[4405] | 1464 | file_def_orchidee.xml > tmp |
---|
| 1465 | \mv -f tmp file_def_orchidee.xml |
---|
[4218] | 1466 | sed -e 's@output_freq="_AUTO_"@output_freq="1d"@' \ |
---|
[4405] | 1467 | file_def_orchidee.xml > tmp |
---|
| 1468 | \mv -f tmp file_def_orchidee.xml |
---|
[4218] | 1469 | sed -e 's@compression_level="4"@compression_level="0"@' \ |
---|
[4405] | 1470 | file_def_orchidee.xml > tmp |
---|
| 1471 | \mv -f tmp file_def_orchidee.xml |
---|
[4218] | 1472 | sed -e 's@XIOS_ORCHIDEE_OK = n@XIOS_ORCHIDEE_OK = y@' \ |
---|
[4405] | 1473 | orchidee.def > tmp |
---|
| 1474 | \mv -f tmp orchidee.def |
---|
| 1475 | fi |
---|
[4215] | 1476 | fi |
---|
[4220] | 1477 | |
---|
| 1478 | if [[ -f ../arch.env ]] |
---|
| 1479 | then |
---|
[4405] | 1480 | source ../arch.env |
---|
[4220] | 1481 | fi |
---|
| 1482 | |
---|
[4215] | 1483 | echo EXECUTION DU BENCH |
---|
| 1484 | set +e |
---|
| 1485 | date ; ./bench.sh > out.bench 2>&1 ; date |
---|
| 1486 | set -e |
---|
| 1487 | tail listing |
---|
[4210] | 1488 | |
---|
| 1489 | |
---|
[4215] | 1490 | echo '##########################################################' |
---|
| 1491 | echo 'Simulation finished in' `pwd` |
---|
| 1492 | echo 'You have compiled with:' |
---|
| 1493 | cat ../compile.sh |
---|
| 1494 | if [ $parallel = "none" ] ; then |
---|
[4405] | 1495 | echo 'You may re-run it with : cd ' `pwd` ' ; gcm.e' |
---|
| 1496 | echo 'or ./bench.sh' |
---|
[4215] | 1497 | else |
---|
[4405] | 1498 | echo 'You may re-run it with : ' |
---|
| 1499 | echo 'cd ' `pwd` '; ./bench.sh' |
---|
| 1500 | # echo 'ulimit -s unlimited' |
---|
| 1501 | # echo 'export OMP_NUM_THREADS=2' |
---|
| 1502 | # echo 'export OMP_STACKSIZE=800M' |
---|
| 1503 | # echo "$mpirun -np 2 gcm.e " |
---|
[4215] | 1504 | fi |
---|
| 1505 | echo '##########################################################' |
---|
[4210] | 1506 | |
---|
| 1507 | fi # bench |
---|
| 1508 | |
---|
| 1509 | |
---|
| 1510 | ################################################################# |
---|
| 1511 | # Installation eventuelle du 1D |
---|
| 1512 | ################################################################# |
---|
| 1513 | |
---|
| 1514 | if [ $SCM = 1 ] ; then |
---|
[4215] | 1515 | cd $MODEL |
---|
| 1516 | myget 1D/1D.tar.gz |
---|
[4286] | 1517 | tar xf 1D.tar.gz |
---|
[4215] | 1518 | cd 1D |
---|
[4422] | 1519 | if [ $rad = oldrad ] ; then |
---|
| 1520 | sed -i'' -e 's/^rad=.*$/rad=oldrad/' run.sh |
---|
| 1521 | sed -i'' -e 's/^rad=.*$/rad=oldrad/' bin/compile |
---|
| 1522 | fi |
---|
[4409] | 1523 | echo Running 1D/run.sh, log in `pwd`/run1d.log |
---|
| 1524 | ./run.sh > `pwd`/run1d.log 2>&1 & |
---|
[4210] | 1525 | fi |
---|
| 1526 | |
---|
[4409] | 1527 | |
---|
[4210] | 1528 | ################################################################# |
---|
| 1529 | # sauvegarde des options veget pour utilisation eventuelle tutorial_prod |
---|
| 1530 | ################################################################# |
---|
| 1531 | cd $MODEL/modipsl/modeles |
---|
| 1532 | #echo surface_env file created in $MODEL |
---|
| 1533 | echo 'veget='$veget > surface_env |
---|
| 1534 | #opt_veget="-v $veget_version" |
---|
| 1535 | #echo 'opt_veget="'$opt_veget\" >> surface_env |
---|
| 1536 | echo 'opt_veget="'-v $veget_version\" >> surface_env |
---|
| 1537 | echo 'orchidee_rev='$orchidee_rev >> surface_env |
---|
| 1538 | echo 'suforch='$suff_orc >> surface_env |
---|