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