[1279] | 1 | #!/bin/bash |
---|
| 2 | # $Id: makelmdz_fcm 1802 2013-07-19 14:03:57Z ymeurdesoif $ |
---|
| 3 | # This is a script in Bash. |
---|
| 4 | |
---|
[1140] | 5 | # FH : on ne crée plus le fichier arch.mk qui est supposé exister par |
---|
[783] | 6 | # FH : ailleurs. |
---|
[1140] | 7 | # FH : ulterieurement, ce fichier sera pré-existant pour une série |
---|
| 8 | # FH : de configurations en versions optimisées et debug qui seront |
---|
| 9 | # FH : liés (ln -s) avec arch.mk en fonction de l'architecture. |
---|
| 10 | # FH : Pour le moment, cette version est en test et on peut créer les |
---|
| 11 | # FH : arch.mk en lançant une première fois makegcm. |
---|
[783] | 12 | # |
---|
[1279] | 13 | ##set -x |
---|
[783] | 14 | ######################################################################## |
---|
| 15 | # options par defaut pour la commande make |
---|
| 16 | ######################################################################## |
---|
| 17 | |
---|
[1279] | 18 | dim="96x72x19" |
---|
| 19 | physique=lmd |
---|
| 20 | filtre=filtrez |
---|
| 21 | grille=reg |
---|
| 22 | couple=false |
---|
| 23 | veget=false |
---|
| 24 | chimie=false |
---|
| 25 | parallel=none |
---|
[1680] | 26 | paramem="par" |
---|
[1279] | 27 | compil_mod=prod |
---|
| 28 | io=ioipsl |
---|
| 29 | LIBPREFIX="" |
---|
| 30 | cosp=false |
---|
[1802] | 31 | job=1 |
---|
| 32 | full='' |
---|
[783] | 33 | |
---|
[1279] | 34 | LMDGCM=`/bin/pwd` |
---|
| 35 | LIBOGCM=$LMDGCM/libo |
---|
| 36 | LIBFGCM=$LMDGCM/libf |
---|
[1327] | 37 | COSP_PATH=$LMDGCM/.void_dir |
---|
[1578] | 38 | fcm_path=$LMDGCM/tools/fcm/bin |
---|
[783] | 39 | |
---|
| 40 | ######################################################################## |
---|
| 41 | # Quelques initialisations de variables du shell. |
---|
| 42 | ######################################################################## |
---|
| 43 | |
---|
[1279] | 44 | CPP_KEY="" |
---|
| 45 | INCLUDE="" |
---|
| 46 | LIB="" |
---|
| 47 | adjnt="" |
---|
| 48 | COMPIL_FFLAGS="%PROD_FFLAGS" |
---|
| 49 | PARA_FFLAGS="" |
---|
| 50 | PARA_LD="" |
---|
| 51 | EXT_SRC="" |
---|
[783] | 52 | |
---|
| 53 | ######################################################################## |
---|
| 54 | # lecture des options de mymake |
---|
| 55 | ######################################################################## |
---|
| 56 | |
---|
[1279] | 57 | while (($# > 0)) |
---|
| 58 | do |
---|
| 59 | case $1 in |
---|
| 60 | "-h") cat <<fin |
---|
[783] | 61 | Usage : |
---|
[1772] | 62 | makelmdz_fcm [options] -arch nom_arch exec |
---|
| 63 | [-h] : brief help |
---|
| 64 | [-d [[IMx]JMx]LM] : IM, JM, LM are the dimensions in x, y, z (default: $dim) |
---|
| 65 | [-p PHYS] : set of physical parametrizations (in libf/phyPHYS), (default: lmd) |
---|
| 66 | [-prod / -dev / -debug] : compilation mode production (default) / developement / debug |
---|
| 67 | [-c false/MPI1/MPI2] : coupling with ocean model : MPI1/MPI2/false (default: false) |
---|
| 68 | [-v false/orchidee2.0/orchidee1.9/true] : version of the vegetation model to include (default: false) |
---|
| 69 | false : no vegetation model |
---|
| 70 | orchidee2.0 : compile using ORCHIDEE 2.0 (or more recent version) |
---|
| 71 | orchidee1.9 : compile using ORCHIDEE up to the version including OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6 |
---|
| 72 | true : (obsolete; for backward compatibility) use ORCHIDEE tag 1.9-1.9.6 |
---|
| 73 | [-chimie INCA/false] : with INCA chemistry model or without (default: false) |
---|
| 74 | [-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp |
---|
| 75 | [-g GRI] : grid configuration in dyn3d/GRI_xy.h (default: reg, inclues a zoom) |
---|
| 76 | [-io IO] : Input/Output library (default: ioipsl) |
---|
| 77 | [-include INCLUDES] : extra include path to add |
---|
| 78 | [-cpp CPP_KEY] : additional preprocessing definitions |
---|
| 79 | [-adjnt] : adjoint model, not operational ... |
---|
| 80 | [-mem] : reduced memory dynamics (if in parallel mode) |
---|
| 81 | [-filtre NOMFILTRE] : use filtre from libf/NOMFILTRE (default: filtrez) |
---|
| 82 | [-link LINKS] : additional links with other libraries |
---|
[1802] | 83 | [-j n] : active parallel compiling on ntask |
---|
| 84 | [-full] : full recompiling |
---|
[1772] | 85 | [-fcm_path path] : path to the fcm tool (default: tools/fcm/bin) |
---|
| 86 | [-ext_src path] : path to an additional set of routines to compile with the model |
---|
| 87 | -arch nom_arch : target architecture |
---|
| 88 | exec : executable to build |
---|
[783] | 89 | fin |
---|
[1279] | 90 | exit;; |
---|
[783] | 91 | |
---|
[1279] | 92 | "-d") |
---|
| 93 | dim=$2 ; shift ; shift ;; |
---|
| 94 | |
---|
| 95 | "-p") |
---|
| 96 | physique="$2" ; shift ; shift ;; |
---|
[783] | 97 | |
---|
[1279] | 98 | "-g") |
---|
| 99 | grille="$2" ; shift ; shift ;; |
---|
[783] | 100 | |
---|
[1279] | 101 | "-c") |
---|
| 102 | couple="$2" ; shift ; shift ;; |
---|
[783] | 103 | |
---|
[1279] | 104 | "-prod") |
---|
| 105 | compil_mod="prod" ; shift ;; |
---|
[1002] | 106 | |
---|
[1279] | 107 | "-dev") |
---|
| 108 | compil_mod="dev" ; shift ;; |
---|
[1002] | 109 | |
---|
[1279] | 110 | "-debug") |
---|
| 111 | compil_mod="debug" ; shift ;; |
---|
[1002] | 112 | |
---|
[1279] | 113 | "-io") |
---|
| 114 | io="$2" ; shift ; shift ;; |
---|
[783] | 115 | |
---|
[1279] | 116 | "-v") |
---|
| 117 | veget="$2" ; shift ; shift ;; |
---|
[783] | 118 | |
---|
[1279] | 119 | "-chimie") |
---|
| 120 | chimie="$2" ; shift ; shift ;; |
---|
[783] | 121 | |
---|
[1279] | 122 | "-parallel") |
---|
| 123 | parallel="$2" ; shift ; shift ;; |
---|
| 124 | |
---|
| 125 | "-include") |
---|
| 126 | INCLUDE="$INCLUDE -I$2" ; shift ; shift ;; |
---|
[783] | 127 | |
---|
[1279] | 128 | "-cpp") |
---|
| 129 | CPP_KEY="$CPP_KEY $2" ; shift ; shift ;; |
---|
[1132] | 130 | |
---|
[1279] | 131 | "-adjnt") |
---|
[1772] | 132 | echo "not operational ... work to be done here ";exit |
---|
[1279] | 133 | opt_dep="$opt_dep adjnt" ; adjnt="-ladjnt -ldyn3d " |
---|
| 134 | optim="$optim -Dadj" ; shift ;; |
---|
[783] | 135 | |
---|
[1279] | 136 | "-cosp") |
---|
| 137 | cosp="$2" ; shift ; shift ;; |
---|
[1680] | 138 | |
---|
| 139 | "-mem") |
---|
| 140 | paramem="mem" ; shift ;; |
---|
[783] | 141 | |
---|
[1279] | 142 | "-filtre") |
---|
| 143 | filtre=$2 ; shift ; shift ;; |
---|
[783] | 144 | |
---|
[1279] | 145 | "-link") |
---|
| 146 | LIB="$LIB $2" ; shift ; shift ;; |
---|
[1136] | 147 | |
---|
[1279] | 148 | "-fcm_path") |
---|
| 149 | fcm_path=$2 ; shift ; shift ;; |
---|
[783] | 150 | |
---|
[1279] | 151 | "-ext_src") |
---|
| 152 | EXT_SRC=$2 ; shift ; shift ;; |
---|
[1802] | 153 | "-j") |
---|
| 154 | job=$2 ; shift ; shift ;; |
---|
| 155 | "-full") |
---|
| 156 | full="-full" ; shift ;; |
---|
[783] | 157 | |
---|
[1279] | 158 | "-arch") |
---|
| 159 | arch=$2 ; shift ; shift ;; |
---|
[783] | 160 | |
---|
[1279] | 161 | *) |
---|
| 162 | code="$1" ; shift ;; |
---|
| 163 | esac |
---|
| 164 | done |
---|
| 165 | |
---|
[1136] | 166 | ############################################################### |
---|
[1755] | 167 | # path to fcm |
---|
[1136] | 168 | ############################################################### |
---|
[1755] | 169 | # handle case when provided path to fcm was given as a relative |
---|
| 170 | # path (from makelmdz_fcm script directory) and not an absolute path |
---|
| 171 | if [[ ${fcm_path:0:1} != "/" ]] ; then |
---|
| 172 | # prepend with makelmdz_fcm location |
---|
| 173 | fcm_path=$(cd $(dirname $0) ; pwd)"/"${fcm_path} |
---|
| 174 | fi |
---|
[783] | 175 | |
---|
[1757] | 176 | # add fcm_path to PATH |
---|
| 177 | export PATH=${fcm_path}:${PATH} |
---|
| 178 | |
---|
[1755] | 179 | echo "Path to fcm:" |
---|
| 180 | echo ${fcm_path} |
---|
[1136] | 181 | |
---|
[783] | 182 | ############################################################### |
---|
[1140] | 183 | # lecture des chemins propres à l'architecture de la machine # |
---|
[783] | 184 | ############################################################### |
---|
[1279] | 185 | rm -f .void_file |
---|
| 186 | echo > .void_file |
---|
[1327] | 187 | rm -rf .void_dir |
---|
| 188 | mkdir .void_dir |
---|
[1279] | 189 | rm -f arch.path |
---|
| 190 | ln -s arch/arch-${arch}.path ./arch.path |
---|
[783] | 191 | source arch.path |
---|
| 192 | |
---|
| 193 | ######################################################################## |
---|
| 194 | # Definition des clefs CPP, des chemins des includes et modules |
---|
| 195 | # et des libraries |
---|
| 196 | ######################################################################## |
---|
| 197 | |
---|
[1279] | 198 | if [[ "$compil_mod" == "prod" ]] |
---|
| 199 | then |
---|
| 200 | COMPIL_FFLAGS="%PROD_FFLAGS" |
---|
| 201 | elif [[ "$compil_mod" == "dev" ]] |
---|
| 202 | then |
---|
| 203 | COMPIL_FFLAGS="%DEV_FFLAGS" |
---|
| 204 | elif [[ "$compil_mod" == "debug" ]] |
---|
| 205 | then |
---|
| 206 | COMPIL_FFLAGS="%DEBUG_FFLAGS" |
---|
| 207 | fi |
---|
[783] | 208 | |
---|
[1279] | 209 | if [[ "$physique" != "nophys" ]] |
---|
| 210 | then |
---|
[1615] | 211 | #We'll use some physics |
---|
| 212 | CPP_KEY="$CPP_KEY CPP_PHYS" |
---|
| 213 | if [[ "${physique:0:3}" == "lmd" ]] |
---|
| 214 | then |
---|
| 215 | #For lmd physics, default planet type is Earth |
---|
[1279] | 216 | CPP_KEY="$CPP_KEY CPP_EARTH" |
---|
[1615] | 217 | fi |
---|
[1279] | 218 | fi |
---|
[783] | 219 | |
---|
[1279] | 220 | if [[ "$chimie" == "INCA" ]] |
---|
| 221 | then |
---|
| 222 | CPP_KEY="$CPP_KEY INCA" |
---|
| 223 | INCLUDE="$INCLUDE -I${INCA_INCDIR}" |
---|
| 224 | LIB="$LIB -L${INCA_LIBDIR} -lchimie" |
---|
| 225 | fi |
---|
[783] | 226 | |
---|
[1279] | 227 | if [[ "$couple" != "false" ]] |
---|
| 228 | then |
---|
| 229 | CPP_KEY="$CPP_KEY CPP_COUPLE" |
---|
| 230 | INCLUDE="$INCLUDE -I${OASIS_INCDIR}" |
---|
| 231 | LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.${couple} -lmpp_io" |
---|
| 232 | fi |
---|
[783] | 233 | |
---|
[1279] | 234 | if [[ "$parallel" == "mpi" ]] |
---|
| 235 | then |
---|
| 236 | CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI" |
---|
| 237 | PARA_FFLAGS="%MPI_FFLAGS" |
---|
| 238 | PARA_LD="%MPI_LD" |
---|
| 239 | elif [[ "$parallel" == "omp" ]] |
---|
| 240 | then |
---|
| 241 | CPP_KEY="$CPP_KEY CPP_PARA CPP_OMP" |
---|
| 242 | PARA_FFLAGS="%OMP_FFLAGS" |
---|
| 243 | PARA_LD="%OMP_LD" |
---|
| 244 | elif [[ "$parallel" == "mpi_omp" ]] |
---|
| 245 | then |
---|
| 246 | CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI CPP_OMP" |
---|
| 247 | PARA_FFLAGS="%MPI_FFLAGS %OMP_FFLAGS" |
---|
| 248 | PARA_LD="%MPI_LD %OMP_LD" |
---|
| 249 | fi |
---|
[783] | 250 | |
---|
[1279] | 251 | if [[ ( "$parallel" == "omp" || "$parallel" == "mpi_omp" ) \ |
---|
| 252 | && "$compil_mod" == "debug" ]] |
---|
| 253 | then |
---|
| 254 | echo "Usually, parallelization with OpenMP requires some optimization." |
---|
| 255 | echo "We suggest switching to \"-dev\"." |
---|
| 256 | fi |
---|
[783] | 257 | |
---|
[1772] | 258 | if [[ "$veget" == "orchidee2.0" ]] |
---|
[1279] | 259 | then |
---|
[1772] | 260 | # orchidee2.0 : |
---|
| 261 | # Compile with ORCHIDEE 2.0 (or more recent) |
---|
[1279] | 262 | CPP_KEY="$CPP_KEY CPP_VEGET" |
---|
| 263 | INCLUDE="${INCLUDE} -I${ORCH_INCDIR}" |
---|
[1772] | 264 | LIB="${LIB} -L${ORCH_LIBDIR} -l${LIBPREFIX}orchidee " |
---|
| 265 | elif [[ "$veget" == "orchidee1.9" ]] |
---|
| 266 | then |
---|
| 267 | # orchidee1.9 : |
---|
| 268 | # Compile with ORCHIDEE version up to the inclusion of OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6 |
---|
| 269 | CPP_KEY="$CPP_KEY CPP_VEGET ORCHIDEE_NOOPENMP" |
---|
| 270 | INCLUDE="${INCLUDE} -I${ORCH_INCDIR}" |
---|
[1789] | 271 | LIB="${LIB} -L${ORCH_LIBDIR} -l${LIBPREFIX}sechiba -l${LIBPREFIX}parameters -l${LIBPREFIX}stomate -l${LIBPREFIX}parallel -l${LIBPREFIX}orglob" |
---|
[1772] | 272 | elif [[ "$veget" == "true" ]] |
---|
| 273 | then |
---|
| 274 | # true : |
---|
| 275 | # Obsolete, for backward compatibility. To be used with ORCHIDEE tag 1.9-1.9.6 |
---|
| 276 | # For this case, cpp flag ORCHIDEE_NOOPENMP must be added to the makelmdz_fcm arguments |
---|
| 277 | CPP_KEY="$CPP_KEY CPP_VEGET" |
---|
| 278 | INCLUDE="${INCLUDE} -I${ORCH_INCDIR}" |
---|
[1789] | 279 | LIB="${LIB} -L${ORCH_LIBDIR} -l${LIBPREFIX}sechiba -l${LIBPREFIX}parameters -l${LIBPREFIX}stomate -l${LIBPREFIX}parallel -l${LIBPREFIX}orglob" |
---|
[1772] | 280 | elif [[ "$veget" != "false" ]] |
---|
| 281 | then |
---|
| 282 | echo "Option -v $veget does not exist" |
---|
| 283 | echo "Use ./makelmdz_fcm -h for more information" |
---|
| 284 | exit |
---|
[1279] | 285 | fi |
---|
[783] | 286 | |
---|
[1279] | 287 | if [[ $io == ioipsl ]] |
---|
| 288 | then |
---|
| 289 | CPP_KEY="$CPP_KEY CPP_IOIPSL" |
---|
| 290 | INCLUDE="$INCLUDE -I${IOIPSL_INCDIR}" |
---|
| 291 | LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl" |
---|
| 292 | fi |
---|
| 293 | if [[ "$cosp" == "true" ]] |
---|
| 294 | then |
---|
| 295 | CPP_KEY="$CPP_KEY CPP_COSP" |
---|
[1327] | 296 | COSP_PATH="$LIBFGCM/cosp" |
---|
[1279] | 297 | # LIB="${LIB} -l${LIBPREFIX}cosp" |
---|
| 298 | fi |
---|
[783] | 299 | |
---|
[1551] | 300 | INCLUDE="$INCLUDE ${NETCDF_INCDIR}" |
---|
| 301 | LIB="$LIB ${NETCDF_LIBDIR}" |
---|
| 302 | |
---|
[783] | 303 | ######################################################################## |
---|
| 304 | # calcul du nombre de dimensions |
---|
| 305 | ######################################################################## |
---|
| 306 | |
---|
| 307 | |
---|
[1279] | 308 | dim_full=$dim |
---|
| 309 | dim=`echo $dim | sed -e 's/[^0-9]/ /g'` |
---|
| 310 | set $dim |
---|
| 311 | dimc=$# |
---|
[783] | 312 | echo calcul de la dimension |
---|
| 313 | echo dim $dim |
---|
| 314 | echo dimc $dimc |
---|
| 315 | |
---|
| 316 | |
---|
| 317 | ######################################################################## |
---|
| 318 | # Gestion des dimensions du modele. |
---|
[1114] | 319 | # on cree ou remplace le fichier des dimensions |
---|
[783] | 320 | ######################################################################## |
---|
| 321 | |
---|
[1695] | 322 | cd $LIBFGCM/grid |
---|
| 323 | if [[ -f dimensions.h ]] |
---|
| 324 | then |
---|
| 325 | echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' |
---|
| 326 | echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." |
---|
| 327 | echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," |
---|
| 328 | echo vous pouvez continuer en repondant oui. |
---|
| 329 | echo "Voulez-vous vraiment continuer?" |
---|
[1755] | 330 | echo "" |
---|
| 331 | echo "WARNING: you are probably already compiling the model somewhere else." |
---|
| 332 | echo "Wait until the first compilation is finished before launching this one." |
---|
| 333 | echo "If you are sure that you are not compiling elsewhere, just answer " |
---|
| 334 | echo "yes (or 'oui') to the question below to proceed." |
---|
| 335 | echo "Do you wish to continue?" |
---|
[1695] | 336 | read reponse |
---|
[1755] | 337 | if [[ $reponse == "oui" || $reponse == "yes" ]] |
---|
[1695] | 338 | then |
---|
[1696] | 339 | \rm -f $LIBFGCM/grid/dimensions.h |
---|
[1695] | 340 | else |
---|
| 341 | exit |
---|
| 342 | fi |
---|
| 343 | fi |
---|
| 344 | |
---|
| 345 | |
---|
[783] | 346 | cd $LIBFGCM/grid/dimension |
---|
[1114] | 347 | ./makdim $dim |
---|
[783] | 348 | cat $LIBFGCM/grid/dimensions.h |
---|
| 349 | cd $LMDGCM |
---|
| 350 | |
---|
| 351 | |
---|
| 352 | ######################################################################## |
---|
| 353 | # Differentes dynamiques (3d, 2d, 1d) |
---|
| 354 | ######################################################################## |
---|
| 355 | |
---|
[1279] | 356 | dimension=`echo $dim | wc -w` |
---|
[783] | 357 | echo dimension $dimension |
---|
| 358 | |
---|
[1279] | 359 | if (( $dimension == 3 )) |
---|
| 360 | then |
---|
[783] | 361 | cd $LIBFGCM/grid |
---|
| 362 | \rm fxyprim.h |
---|
| 363 | cp -p fxy_${grille}.h fxyprim.h |
---|
[1279] | 364 | else |
---|
| 365 | echo "Probleme dans les dimensions de la dynamique !!" |
---|
| 366 | echo "Non reactive pour l'instant !!!" |
---|
| 367 | fi |
---|
[783] | 368 | |
---|
| 369 | ###################################################################### |
---|
| 370 | # Traitement special pour le nouveau rayonnement de Laurent Li. |
---|
| 371 | # ---> YM desactive pour le traitemement en parallele |
---|
| 372 | ###################################################################### |
---|
| 373 | |
---|
[1279] | 374 | #if [[ -f $libf/phy$physique/raddim.h ]] |
---|
| 375 | #then |
---|
| 376 | # if [[ -f $libf/phy$physique/raddim.$dimh.h ]] |
---|
| 377 | #then |
---|
[783] | 378 | # \rm -f $libf/phy$physique/raddim.h |
---|
| 379 | # cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h |
---|
| 380 | # echo $libf/phy$physique/raddim.$dimh.h |
---|
| 381 | # cat $libf/phy$physique/raddim.h |
---|
| 382 | # else |
---|
| 383 | # echo On peut diminuer la taille de l executable en creant |
---|
| 384 | # echo le fichier $libf/phy$physique/raddim.$dimh.h |
---|
| 385 | # \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h |
---|
[1279] | 386 | # fi |
---|
| 387 | #fi |
---|
[783] | 388 | |
---|
| 389 | ###################################################################### |
---|
| 390 | # Gestion du filtre qui n'existe qu'en 3d. |
---|
| 391 | ###################################################################### |
---|
| 392 | |
---|
[1279] | 393 | if (( `expr $dimc \> 2` == 1 )) |
---|
| 394 | then |
---|
| 395 | filtre="FILTRE=$filtre" |
---|
[783] | 396 | else |
---|
[1279] | 397 | filtre="FILTRE= L_FILTRE= " |
---|
| 398 | fi |
---|
[783] | 399 | echo MACRO FILTRE $filtre |
---|
| 400 | |
---|
| 401 | echo $dimc |
---|
| 402 | |
---|
| 403 | |
---|
| 404 | |
---|
| 405 | ###################################################################### |
---|
| 406 | # Creation du suffixe de la configuration |
---|
| 407 | ###################################################################### |
---|
| 408 | |
---|
| 409 | |
---|
[1279] | 410 | SUFF_NAME=_${dim_full} |
---|
| 411 | SUFF_NAME=${SUFF_NAME}_phy${physique} |
---|
[783] | 412 | |
---|
[1279] | 413 | if [[ "$parallel" != "none" ]] |
---|
| 414 | then |
---|
| 415 | SUFF_NAME=${SUFF_NAME}_para |
---|
[1680] | 416 | DYN=dyn${dimc}d${paramem} |
---|
| 417 | if [[ "$paramem" == "mem" ]] |
---|
| 418 | then |
---|
| 419 | SUFF_NAME=${SUFF_NAME}_${paramem} |
---|
| 420 | fi |
---|
[783] | 421 | else |
---|
[1279] | 422 | SUFF_NAME=${SUFF_NAME}_seq |
---|
| 423 | DYN=dyn${dimc}d |
---|
| 424 | fi |
---|
[783] | 425 | |
---|
[1772] | 426 | if [[ $veget != "false" ]] |
---|
[1279] | 427 | then |
---|
| 428 | SUFF_NAME=${SUFF_NAME}_orch |
---|
| 429 | fi |
---|
[783] | 430 | |
---|
[1279] | 431 | if [[ $couple != "false" ]] |
---|
| 432 | then |
---|
| 433 | SUFF_NAME=${SUFF_NAME}_couple |
---|
| 434 | fi |
---|
[783] | 435 | |
---|
[1279] | 436 | if [[ $chimie == "INCA" ]] |
---|
| 437 | then |
---|
| 438 | SUFF_NAME=${SUFF_NAME}_inca |
---|
| 439 | fi |
---|
[783] | 440 | |
---|
| 441 | cd $LMDGCM |
---|
[1279] | 442 | config_fcm="config.fcm" |
---|
[783] | 443 | rm -f $config_fcm |
---|
| 444 | touch $config_fcm |
---|
| 445 | rm -f bin/${code}${SUFF_NAME}.e |
---|
| 446 | rm -f arch.fcm |
---|
[1279] | 447 | rm -f arch.opt |
---|
[783] | 448 | |
---|
| 449 | echo "%ARCH $arch" >> $config_fcm |
---|
| 450 | echo "%INCDIR $INCLUDE" >> $config_fcm |
---|
| 451 | echo "%LIB $LIB" >> $config_fcm |
---|
| 452 | echo "%ROOT_PATH $PWD" >> $config_fcm |
---|
| 453 | echo "%LIBF $LIBFGCM" >> $config_fcm |
---|
| 454 | echo "%LIBO $LIBOGCM" >> $config_fcm |
---|
| 455 | echo "%DYN $DYN" >> $config_fcm |
---|
| 456 | echo "%PHYS phy${physique}" >> $config_fcm |
---|
[1327] | 457 | echo "%COSP $COSP_PATH" >> $config_fcm |
---|
[783] | 458 | echo "%CPP_KEY $CPP_KEY" >> $config_fcm |
---|
| 459 | echo "%EXEC $code" >> $config_fcm |
---|
| 460 | echo "%SUFF_NAME $SUFF_NAME" >> $config_fcm |
---|
[1002] | 461 | echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> $config_fcm |
---|
| 462 | echo "%PARA_FFLAGS $PARA_FFLAGS" >> $config_fcm |
---|
| 463 | echo "%PARA_LD $PARA_LD" >> $config_fcm |
---|
[1279] | 464 | echo "%EXT_SRC $EXT_SRC" >> $config_fcm |
---|
[783] | 465 | |
---|
[1002] | 466 | |
---|
| 467 | |
---|
[1137] | 468 | ln -s arch/arch-${arch}.fcm arch.fcm |
---|
[1279] | 469 | if test -f arch/arch-${arch}.opt && [ $compil_mod = "prod" ] |
---|
| 470 | then |
---|
| 471 | ln -s arch/arch-${arch}.opt arch.opt |
---|
| 472 | else |
---|
| 473 | ln -s .void_file arch.opt |
---|
| 474 | fi |
---|
| 475 | |
---|
| 476 | |
---|
[1002] | 477 | rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock |
---|
[1802] | 478 | ./build_gcm ${fcm_path} -j $job $full |
---|
[783] | 479 | |
---|
[1279] | 480 | rm -rf tmp_src |
---|
| 481 | rm -rf config |
---|
[783] | 482 | ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config config |
---|
| 483 | ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/tmp tmp_src |
---|
[1695] | 484 | |
---|
[1696] | 485 | if [[ -r $LIBFGCM/grid/dimensions.h ]] |
---|
[1695] | 486 | then |
---|
| 487 | # Cleanup: remove dimension.h file |
---|
[1696] | 488 | \rm -f $LIBFGCM/grid/dimensions.h |
---|
[1695] | 489 | fi |
---|