[524] | 1 | #!/bin/csh |
---|
| 2 | # |
---|
| 3 | # $Header$ |
---|
| 4 | # |
---|
| 5 | #set verbose echo |
---|
[714] | 6 | ######################################################################## |
---|
| 7 | # options par defaut pour la commande make |
---|
| 8 | ######################################################################## |
---|
| 9 | set dim="48x32x19" |
---|
| 10 | set physique=lmd |
---|
| 11 | set phys="PHYS=$physique" |
---|
| 12 | set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I. ' |
---|
| 13 | set ntrac = 4 |
---|
| 14 | set filtre=filtrez |
---|
| 15 | set grille=reg |
---|
| 16 | set couple=false |
---|
| 17 | set veget=false |
---|
| 18 | set chimie=false |
---|
| 19 | set psmile=false |
---|
| 20 | set parallel=false |
---|
| 21 | set vampir=false |
---|
| 22 | set OPT_STACK='-Wf,-init stack=nan' |
---|
| 23 | set OPT_STACK=' ' |
---|
| 24 | set OPTIMI='-C debug -eC ' |
---|
| 25 | set OPTIMI=' -ftrace ' |
---|
| 26 | set OPT_LINUX='-O3' |
---|
| 27 | set io=ioipsl |
---|
[524] | 28 | |
---|
[714] | 29 | set FC_LINUX=pgf90 |
---|
| 30 | |
---|
[524] | 31 | ######################################################################## |
---|
| 32 | # path a changer contenant les sources et les objets du modele |
---|
| 33 | ######################################################################## |
---|
| 34 | |
---|
| 35 | ###### VERSION LMDZ.4 |
---|
[714] | 36 | #set LMDGCM=/workdir/p86cozic/INCA_dev/LMDZ4 |
---|
| 37 | #setenv LIBOGCM $LMDGCM/libo |
---|
| 38 | set LMDGCM="`pwd`" |
---|
| 39 | #setenv LIBOGCM $LMDGCM/libo |
---|
| 40 | # |
---|
| 41 | setenv IOIPSLDIR /u/fairhead/modipsl_ioipsl_3/lib |
---|
| 42 | setenv MODIPSLDIR /u/fairhead/modipsl_ioipsl_3/lib |
---|
| 43 | setenv NCDFINC /distrib/local/netcdf/pgi_32bits/include |
---|
| 44 | setenv NCDFLIB /distrib/local/netcdf/pgi_32bits/lib/ |
---|
[524] | 45 | |
---|
| 46 | setenv localdir "`pwd`" |
---|
[714] | 47 | set MODIPSL=0 |
---|
| 48 | echo $localdir | grep modipsl >& /dev/null |
---|
| 49 | if ( ! $status ) then |
---|
| 50 | set MODIPSL=1 |
---|
| 51 | setenv LMDGCM $localdir |
---|
| 52 | cd ../.. |
---|
| 53 | setenv LIBOGCM "`pwd`/lib" |
---|
| 54 | setenv IOIPSLDIR $LIBOGCM |
---|
| 55 | setenv MODIPSLDIR $LIBOGCM |
---|
| 56 | cd $localdir |
---|
| 57 | if ( `hostname` == rhodes ) then |
---|
| 58 | set NCDFINC=`grep sxnec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` |
---|
| 59 | set NCDFLIB=`grep sxnec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` |
---|
| 60 | else |
---|
| 61 | if ( `hostname` == nymphea0 ) then |
---|
| 62 | set NCDFINC=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` |
---|
| 63 | set NCDFLIB=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` |
---|
| 64 | else if ( `hostname` == mercure ) then |
---|
| 65 | set NCDFINC=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` |
---|
| 66 | set NCDFLIB=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` |
---|
| 67 | else |
---|
| 68 | echo 'Probleme de definition des variables NCDFINC et NCDFLIB' |
---|
| 69 | endif |
---|
| 70 | endif |
---|
| 71 | else |
---|
[524] | 72 | if ( ! $?LMDGCM ) then |
---|
| 73 | echo You must initialize the variable LMDGCM in your environnement |
---|
| 74 | echo for instance: "setenv LMDGCM /usr/myself/supergcm" in .cshrc |
---|
| 75 | exit |
---|
| 76 | endif |
---|
| 77 | if ( ! $?LIBOGCM ) then |
---|
| 78 | set LIBOGCM=$LMDGCM/libo |
---|
| 79 | endif |
---|
| 80 | if ( ! $?IOIPSLDIR ) then |
---|
| 81 | echo You must initialize the variable IOIPSLDIR in your environnement |
---|
| 82 | echo for instance: "setenv IOIPSLDIR /usr/myself/ioipsl" in .cshrc |
---|
| 83 | exit |
---|
[714] | 84 | else |
---|
| 85 | setenv MODIPSLDIR $IOIPSLDIR |
---|
[524] | 86 | endif |
---|
| 87 | if ( ! $?NCDFLIB ) then |
---|
| 88 | echo You must initialize the variable NCDFLIB in your environnement |
---|
| 89 | echo for instance: "setenv NCDFLIB /usr/myself/netcdf" in .cshrc |
---|
| 90 | exit |
---|
| 91 | endif |
---|
| 92 | if ( ! $?NCDFINC ) then |
---|
| 93 | echo You must initialize the variable NCDFINC in your environnement |
---|
| 94 | echo for instance: "setenv NCDFINC /usr/myself/netcdf" in .cshrc |
---|
| 95 | exit |
---|
| 96 | endif |
---|
| 97 | endif |
---|
| 98 | set model=$LMDGCM |
---|
| 99 | set libo=$LIBOGCM |
---|
[714] | 100 | |
---|
| 101 | ######################################################################## |
---|
| 102 | # Les differentes platformes reconnues |
---|
| 103 | ######################################################################## |
---|
| 104 | |
---|
| 105 | set HP=0 |
---|
| 106 | set IBM=0 |
---|
| 107 | set SUN=0 |
---|
| 108 | set VPP=0 |
---|
| 109 | set CRAY=0 |
---|
| 110 | set DEC=0 |
---|
| 111 | set LINUX=0 |
---|
| 112 | set NEC=0 |
---|
| 113 | set XNEC=0 |
---|
| 114 | set X6NEC=0 |
---|
| 115 | if ( `uname` == HP-UX ) then |
---|
| 116 | set machine=HP |
---|
| 117 | set HP=1 |
---|
| 118 | else if (`uname` == UNIX_System_V ) then |
---|
| 119 | set machine=VPP |
---|
| 120 | set VPP=1 |
---|
| 121 | else if (`uname` == SunOS ) then |
---|
| 122 | set machine=SUN |
---|
| 123 | set SUN=1 |
---|
| 124 | else if ( `uname` == AIX ) then |
---|
| 125 | set machine=IBM |
---|
| 126 | set IBM=1 |
---|
| 127 | else if ( `uname` == OSF1 ) then |
---|
| 128 | set machine=ALPHA |
---|
| 129 | set DEC=1 |
---|
| 130 | else if ( `uname` == Linux && `hostname` != mercure ) then |
---|
| 131 | set machine=LINUX |
---|
| 132 | set LINUX=1 |
---|
| 133 | else if ( `hostname` == atlas || `hostname` == axis || `hostname` == etoile ) then |
---|
| 134 | set machine=CRAY |
---|
| 135 | set CRAY=1 |
---|
| 136 | else if ( `uname` == SUPER-UX ) then |
---|
| 137 | set machine=NEC |
---|
| 138 | set NEC=1 |
---|
| 139 | else if ( `hostname` == rhodes) then |
---|
| 140 | set machine=XNEC |
---|
| 141 | set XNEC=1 |
---|
| 142 | else if ( `hostname` == mercure) then |
---|
| 143 | set machine=X6NEC |
---|
| 144 | set X6NEC=1 |
---|
| 145 | else |
---|
| 146 | echo Vous travaillez sur une machine non prevue par le reglement |
---|
| 147 | exit |
---|
| 148 | endif |
---|
| 149 | |
---|
[524] | 150 | if ( ! -d $libo ) then |
---|
| 151 | mkdir $libo |
---|
| 152 | endif |
---|
| 153 | |
---|
[714] | 154 | |
---|
| 155 | if $VPP then |
---|
| 156 | set netcdf=netcdf_v |
---|
| 157 | else |
---|
| 158 | set netcdf=netcdf |
---|
| 159 | endif |
---|
[524] | 160 | ######################################################################## |
---|
| 161 | # Quelques initialisations de variables du shell. |
---|
| 162 | ######################################################################## |
---|
| 163 | |
---|
| 164 | set dyn= |
---|
| 165 | set opt_link="" |
---|
| 166 | set adjnt="" |
---|
| 167 | set opt_dep="" |
---|
[714] | 168 | set libchimie="" |
---|
[524] | 169 | |
---|
| 170 | set optim="" |
---|
| 171 | set optimbis="" |
---|
| 172 | set optim90="" |
---|
| 173 | set oplink="" |
---|
| 174 | |
---|
| 175 | ######################################################################## |
---|
[714] | 176 | # Optimisations par defaut suivant les machines |
---|
[524] | 177 | ######################################################################## |
---|
| 178 | |
---|
[714] | 179 | echo "Optimisations par defaut suivant les machines" |
---|
| 180 | set libf=$model/libf |
---|
| 181 | #setenv localdir "LOCAL_DIR=`pwd`" |
---|
| 182 | #setenv localdir "`pwd`" |
---|
| 183 | cd $model |
---|
| 184 | ############# |
---|
| 185 | if $CRAY then |
---|
| 186 | ############# |
---|
| 187 | # set optim="-Wf'-ei' -dp -Wf'-a static'" |
---|
| 188 | set optimbis=" -DCRAY " |
---|
| 189 | set optim90="-Wp'-P' -DCRAY -p$IOIPSLDIR "'-p$(LIBO) -eiv ' |
---|
| 190 | set optim="$optim90" |
---|
| 191 | set oplink="-Wl'-DSTACK=128 -f indef' -L$IOIPSLDIR -lioipsl -L$NCDFLIB -lnetcdf " |
---|
| 192 | set mod_loc_dir=" " |
---|
| 193 | set mod_suffix=" " |
---|
| 194 | ################# |
---|
| 195 | else if $SUN then |
---|
| 196 | ################# |
---|
| 197 | set optim=" -fast " |
---|
| 198 | set optimbis=" " |
---|
| 199 | set optim90=" -fast -fixed " |
---|
| 200 | set optimtru90=" -fast -free " |
---|
| 201 | set opt_link="-lf77compat -L$MODIPSLDIR -lsechiba -lparameters -lstomate -lioipsl -L$NCDFLIB -lnetcdf " |
---|
| 202 | set mod_loc_dir=$localdir |
---|
| 203 | set mod_suffix=mod |
---|
| 204 | ################# |
---|
| 205 | else if $HP then |
---|
| 206 | ################# |
---|
| 207 | set optim=" +U77 -O +E1 " |
---|
| 208 | set optimbis=" " |
---|
| 209 | ################# |
---|
| 210 | else if $IBM then |
---|
| 211 | ################# |
---|
| 212 | set optim=" -O3 -qtune=pwr2 -qarch=pwr2" |
---|
| 213 | set optimbis=" " |
---|
| 214 | ################# |
---|
| 215 | else if $VPP then |
---|
| 216 | ################# |
---|
| 217 | # set optim="-Dasuxm -On, -g -Ad -Potilax -Eciplume -Si" |
---|
| 218 | # set optimbis=" -Wv,-m3 -Wp,-DVPP -Z $LMDGCM/listage" |
---|
| 219 | set optimbis=" -Wp,-DNC_DOUBLE -Ad -Z $LMDGCM/listage -X9" |
---|
| 220 | set optim90="$optim $optimbis -X9 -w" |
---|
| 221 | set mod_loc_dir=$MODIPSLDIR |
---|
| 222 | set mod_suffix=mod |
---|
| 223 | ################# |
---|
| 224 | else if $DEC then |
---|
| 225 | ################# |
---|
| 226 | set optim=" " |
---|
| 227 | set optimbis=" " |
---|
| 228 | ################# |
---|
| 229 | else if $LINUX then |
---|
| 230 | ################# |
---|
| 231 | if ( $FC_LINUX == "pgf90" ) then |
---|
| 232 | set optim="-fast " |
---|
| 233 | set optim90=" -fast " |
---|
| 234 | # set optimtru90=" -fast -c -Mfree -module $MODIPSLDIR " |
---|
| 235 | set optimtru90=" -fast -c -Mfree " |
---|
| 236 | else if ( $FC_LINUX == 'g95' ) then |
---|
| 237 | set optim=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic " |
---|
| 238 | set optim90=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic " |
---|
| 239 | set optimtru90=" $OPT_LINUX -fno-second-underscore -ffree-form -fstatic " |
---|
| 240 | else |
---|
| 241 | echo 'compilateur linux non reconnu' |
---|
| 242 | exit |
---|
| 243 | endif |
---|
| 244 | set mod_loc_dir=$MODIPSLDIR |
---|
| 245 | set mod_suffix=mod |
---|
| 246 | ################# |
---|
| 247 | else if $NEC then |
---|
| 248 | ################# |
---|
| 249 | set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "' |
---|
| 250 | set optimtru90=' -clear -f4 -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "' |
---|
| 251 | set optim="$optim90" |
---|
| 252 | set optimbis=" " |
---|
| 253 | set opt_link=" -C hopt -float0 -ew -P static -L$MODIPSLDIR -lioipsl $NCDFLIB -lnetcdf_i8r8_v " |
---|
| 254 | set mod_loc_dir="." |
---|
| 255 | set mod_suffix="mod" |
---|
| 256 | ################# |
---|
| 257 | else if $XNEC then |
---|
| 258 | ################# |
---|
| 259 | set optdbl='-dw -Wf\"-A dbl4\"' |
---|
| 260 | set optim90=' -clear -float0 -f3 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume "' |
---|
| 261 | set optimtru90=' -clear -f4 -float0 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R2 -R3 -R4 -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume"' |
---|
| 262 | set optim="$optim90" |
---|
| 263 | set optimbis=" " |
---|
| 264 | set mod_suffix="mod" |
---|
| 265 | set mod_loc_dir="./" |
---|
| 266 | ################# |
---|
| 267 | else if $X6NEC then |
---|
| 268 | ################# |
---|
| 269 | set optdbl='-dw -Wf\"-A dbl4\"' |
---|
| 270 | set optim90=' -clear -float0 -f3 -size_t64 -P stack -Wf "-init stack=nan -init heap=nan" -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume "' |
---|
| 271 | set optimtru90=' -clear -f4 -float0 -size_t64 -P stack -Wf "-init stack=nan -init heap=nan" -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R2 -R3 -R4 -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume"' |
---|
| 272 | set optim="$optim90" |
---|
| 273 | set optimbis=" " |
---|
| 274 | set mod_suffix="mod" |
---|
| 275 | set mod_loc_dir="./" |
---|
| 276 | else |
---|
| 277 | set optim="" |
---|
| 278 | set optimbis=" " |
---|
| 279 | endif |
---|
[524] | 280 | |
---|
[714] | 281 | set nomlib=$machine |
---|
[524] | 282 | |
---|
| 283 | ######################################################################## |
---|
| 284 | # lecture des options de mymake |
---|
| 285 | ######################################################################## |
---|
| 286 | |
---|
| 287 | top: |
---|
| 288 | if ($#argv > 0) then |
---|
| 289 | switch ($1:q) |
---|
| 290 | |
---|
| 291 | case -h: |
---|
| 292 | |
---|
| 293 | ######################################################################## |
---|
| 294 | # Manuel en ligne |
---|
| 295 | ######################################################################## |
---|
| 296 | more <<eod |
---|
| 297 | |
---|
| 298 | |
---|
| 299 | makegcm [Options] prog |
---|
| 300 | |
---|
| 301 | |
---|
| 302 | |
---|
| 303 | |
---|
| 304 | Par default, la commande makegcm: |
---|
| 305 | --------------------------------- |
---|
| 306 | |
---|
| 307 | 1. compile une serie de sous programmes se trouvant dans des sous-repertoires |
---|
| 308 | de $LMDGCM/libf. |
---|
| 309 | Les sous programmes sont ensuite stokes sur dans des librairies FORTRAN |
---|
| 310 | sur $LIBOGCM. |
---|
| 311 | |
---|
| 312 | 2. Ensuite, makegcm compile le programme prog.f se trouvant par default sur |
---|
| 313 | $LMDGCM/libf/dyn3d et effectue le lien avec l ensemble des librairies. |
---|
| 314 | |
---|
| 315 | La variable '$LMDGCM' doit etre initialisee dans votre .cshrc ou en dur |
---|
| 316 | dans la comande makegcm. |
---|
| 317 | |
---|
| 318 | La commande makegcm est faite pour permettre de gerer en parallele des |
---|
| 319 | versions differentes du modele, compilees avec des options de compilation |
---|
| 320 | et des dimensions differentes sans avoir a chaque fois a recompiler tout |
---|
| 321 | le modele. |
---|
| 322 | |
---|
| 323 | Les librairies FORTRAN sont stoquees sur le directory $LIBOGCM. |
---|
| 324 | |
---|
| 325 | |
---|
| 326 | OPTIONS: |
---|
| 327 | -------- |
---|
| 328 | |
---|
| 329 | Les options suivantes peuvent etre definies soit par defaut en editant le |
---|
| 330 | "script" makegcm, soit en interactif: |
---|
| 331 | |
---|
| 332 | -d imxjmxlm ou im, jm, et lm sont resp. le nombre de longitudes, latitudes |
---|
| 333 | et couches verticales. |
---|
| 334 | |
---|
| 335 | -t ntrac selectionne le nombre de traceur advectes par la dynamique. |
---|
| 336 | Dans les versions courantes du modele terrestre on a par exemple |
---|
| 337 | ntrac=2 pour l'eau vapeur et liquide |
---|
| 338 | |
---|
| 339 | L'effet des options -d et -t est d'ecraser le fichier |
---|
| 340 | $LMDGCM/libf/grid/dimensions.h |
---|
| 341 | qui contient sous forme de 4 PARAMETER FORTRAN les 3 dimensions |
---|
| 342 | de la grille horizontale im, jm, lm plus le nombre de traceurs |
---|
| 343 | advectes passivement par la dynamique ntrac, par un nouveu fichier |
---|
| 344 | $LMDGCM/libf/grid/dimension/dimensions.im.jm.lm.tntrac |
---|
| 345 | Si ce fichier n'existe pas encore, il est cree par le script |
---|
| 346 | $LMDGCM/libf/grid/dimension/makdim |
---|
| 347 | |
---|
| 348 | -p PHYS pour selectionner le jeu de parametrisations physiques avec |
---|
| 349 | lequel on veut compiler le modele. |
---|
| 350 | Le modele sera alors compile en prenant les sources des |
---|
| 351 | parametrisations physiques dans le repertoire: |
---|
| 352 | $LMDGCM/libf/phyPHYS |
---|
| 353 | |
---|
| 354 | -c false|true |
---|
| 355 | pour selectionner le mode force (par defaut) ou couple |
---|
| 356 | |
---|
| 357 | -io ioipsl|noioipsl |
---|
| 358 | pour selectionner le logiciel IO : IOIPSL par defaut |
---|
| 359 | |
---|
| 360 | -psmile false|true |
---|
| 361 | pour selectionner le mode psmile ou non (par defaut) |
---|
| 362 | |
---|
[714] | 363 | -parallel false|true |
---|
| 364 | pour selectionner le mode parallele ou non (false par defaut) |
---|
| 365 | |
---|
[524] | 366 | -v true|false |
---|
| 367 | pour selectionner la vegetation (par defaut) ou non |
---|
| 368 | |
---|
[714] | 369 | -chimie CH4|CH4_AER|NMHC|NMHC_AER|AER|GES|false |
---|
| 370 | pour selectionner ou non la chimie (par defaut sans) |
---|
| 371 | |
---|
[524] | 372 | -g grille selectionne le type de grille qu'on veut utiliser. |
---|
| 373 | L'effet de cette option est d'ecraser le fichier |
---|
| 374 | $LMDGCM/libf/grid/fxyprim.h |
---|
| 375 | avec le fichier |
---|
| 376 | $LMDGCM/libf/grid/fxy_grille.h |
---|
| 377 | grille peut prendre les valeurs: |
---|
| 378 | 1. reg pour la grille reguliere |
---|
| 379 | 2. sin pour avoir des points equidistants en sinus de la latitude |
---|
| 380 | 3. new pour pouvoir zoomer sur une partie du globe |
---|
| 381 | |
---|
| 382 | -O "optimisation fortran" ou les optimisations fortran sont les options de la |
---|
| 383 | commande f77 |
---|
| 384 | |
---|
| 385 | -include path |
---|
| 386 | Dans le cas ou on a dans des sous programmes des fichiers |
---|
| 387 | #include (cpp) qui se trouve sur des repertoires non references |
---|
| 388 | par defaut |
---|
| 389 | |
---|
| 390 | -adjnt Pour compiler la l'adjoint du code dynamique |
---|
| 391 | |
---|
| 392 | -filtre filtre |
---|
| 393 | Pour choisir le filtre en longitude dans les regions polaires. |
---|
| 394 | "filtre" correspond au nom d'un repertoire se trouvant sur |
---|
| 395 | $LMDGCM/libf. Le filtre standard du modele est "filtrez" qui peut |
---|
| 396 | etre utilise aussi bien pour une grille reguliere que pour une |
---|
| 397 | grille zoomee en longitude. |
---|
| 398 | |
---|
| 399 | -link "-Ldir1 -lfile1 -Ldir2 -lfile2 ..." |
---|
| 400 | Pour rajouter un lien avec les librairies FORTRAN |
---|
| 401 | libfile1.a, libfile2.a ... se trouvant respectivement sur les |
---|
| 402 | repertoires dir1, dir2 ... |
---|
| 403 | Si dirn est un repertoire dont le chemin est automatique (comme |
---|
| 404 | par exemple /usr/lib ...) il n'est pas besoin de specifier -Ldirn. |
---|
| 405 | |
---|
| 406 | Auteur: Frederic Hourdin (hourdin@lmd.jussieu.fr) |
---|
| 407 | eod |
---|
| 408 | exit |
---|
| 409 | |
---|
| 410 | ######################################################################## |
---|
| 411 | # Lecture des differentes options |
---|
| 412 | ######################################################################## |
---|
| 413 | |
---|
| 414 | case -d: |
---|
| 415 | set dim=$2 ; shift ; shift ; goto top |
---|
| 416 | |
---|
| 417 | case -O: |
---|
| 418 | set optim="$2" ; shift ; shift ; goto top |
---|
| 419 | |
---|
| 420 | case -p |
---|
| 421 | set physique="$2" ; set phys="PHYS=$physique" ; shift ; shift ; goto top |
---|
| 422 | |
---|
| 423 | case -g |
---|
| 424 | set grille="$2" ; shift ; shift ; goto top |
---|
| 425 | |
---|
| 426 | case -c |
---|
| 427 | set couple="$2" ; shift ; shift ; goto top |
---|
| 428 | |
---|
| 429 | case -io |
---|
| 430 | set io="$2" ; shift ; shift ; goto top |
---|
| 431 | |
---|
| 432 | case -v |
---|
| 433 | set veget="$2" ; shift ; shift ; goto top |
---|
| 434 | |
---|
| 435 | case -psmile |
---|
[714] | 436 | set psmile="$2" |
---|
| 437 | if ( "$psmile" == 'true' ) then |
---|
| 438 | set couple='true' |
---|
| 439 | endif |
---|
| 440 | shift ; shift ; goto top |
---|
| 441 | |
---|
| 442 | case -chimie |
---|
| 443 | set chimie="$2" ; shift ; shift ; goto top |
---|
| 444 | |
---|
| 445 | case -parallel |
---|
| 446 | set parallel="$2" ; shift ; shift ; goto top |
---|
[524] | 447 | |
---|
| 448 | case -t |
---|
| 449 | set ntrac=$2 ; shift ; shift ; goto top |
---|
| 450 | |
---|
| 451 | case -include |
---|
| 452 | set include="$include -I$2" ; shift ; shift ; goto top |
---|
| 453 | |
---|
| 454 | case -adjnt |
---|
| 455 | set opt_dep="$opt_dep adjnt" ; set adjnt="-ladjnt -ldyn3d " |
---|
| 456 | set optim="$optim -Dadj" ; shift ; goto top |
---|
| 457 | |
---|
| 458 | case -filtre |
---|
| 459 | set filtre=$2 ; shift ; shift ; goto top |
---|
| 460 | |
---|
| 461 | case -link |
---|
| 462 | set opt_link="$opt_link $2" ; shift ; shift ; goto top |
---|
| 463 | |
---|
| 464 | case -debug |
---|
[714] | 465 | if $HP then |
---|
| 466 | set optim=" -g " |
---|
| 467 | else if $SUN then |
---|
| 468 | setenv PARALLEL 2 |
---|
| 469 | # Il faut rajouter l'option -dalign a -g pour pouvoir editer les liens |
---|
| 470 | # avec des programmes compiles avec -fast |
---|
| 471 | set optim=" -g -dalign " |
---|
| 472 | set optim90=" -fixed -g " |
---|
| 473 | set optimtru90=" -free -g -C -dalign " |
---|
| 474 | else if $CRAY then |
---|
| 475 | set optim="$optim"" -g " |
---|
| 476 | set optim90="$optim90"" -G1 " |
---|
| 477 | else if $LINUX then |
---|
| 478 | if ( $FC_LINUX == "pgf90" ) then |
---|
| 479 | set optim="$optim"" -g -C -Mbounds " |
---|
| 480 | set optim90="$optim90"" -g -C -Mbounds " |
---|
| 481 | set optimtru90="$optimtru90"" -g -C -Mbounds " |
---|
| 482 | else if ( $FC_LINUX == 'g95' ) then |
---|
| 483 | set optim="$optim"" -g -fbounds-check " |
---|
| 484 | set optim90="$optim90"" -g -fbounds-check " |
---|
| 485 | set optimtru90="$optimtru90"" -g -fbounds-check " |
---|
| 486 | else |
---|
| 487 | echo 'compilateur linux non reconnu' |
---|
| 488 | exit |
---|
| 489 | endif |
---|
[524] | 490 | else |
---|
| 491 | echo pas d option debug predefinie pour cette machine |
---|
| 492 | exit |
---|
| 493 | endif |
---|
| 494 | shift ; goto top |
---|
| 495 | |
---|
| 496 | default |
---|
| 497 | set code="$1" ; shift ; goto top |
---|
| 498 | |
---|
| 499 | endsw |
---|
| 500 | endif |
---|
| 501 | |
---|
| 502 | ######################################################################## |
---|
| 503 | # Definition des clefs CPP |
---|
| 504 | ######################################################################## |
---|
| 505 | |
---|
[714] | 506 | set cppflags='' |
---|
| 507 | |
---|
[524] | 508 | if ( $io == ioipsl ) then |
---|
[714] | 509 | set cppflags="$cppflags -DCPP_IOIPSL" |
---|
[524] | 510 | endif |
---|
| 511 | |
---|
| 512 | if ( "$physique" == 'nophys' ) then |
---|
| 513 | set phys="L_PHY= LIBPHY=" |
---|
| 514 | else |
---|
[714] | 515 | set cppflags="$cppflags -DCPP_PHYS" |
---|
[524] | 516 | endif |
---|
| 517 | |
---|
[714] | 518 | set link_veget=" " |
---|
| 519 | if ( "$veget" == 'true' ) then |
---|
| 520 | set cppflags="$cppflags -DCPP_VEGET" |
---|
| 521 | set link_veget=" -lsechiba -lparameters -lstomate" |
---|
| 522 | if ( $XNEC ) then |
---|
| 523 | set link_veget=" -lsxsechiba -lsxparameters -lsxstomate" |
---|
| 524 | endif |
---|
| 525 | endif |
---|
[524] | 526 | |
---|
[714] | 527 | if ( "$chimie" == 'CH4' ) then |
---|
| 528 | set cppflags="$cppflags -DINCA -DINCA_CH4 " |
---|
| 529 | else if ( "$chimie" == 'CH4_AER' ) then |
---|
| 530 | set cppflags="$cppflags -DINCA -DINCA_CH4 -DINCA_AER" |
---|
| 531 | else if ( "$chimie" == 'NMHC' ) then |
---|
| 532 | set cppflags="$cppflags -DINCA -DINCA_NMHC " |
---|
| 533 | else if ( "$chimie" == 'NMHC_AER' ) then |
---|
| 534 | set cppflags="$cppflags -DINCA -DINCA_NMHC -DINCA_AER" |
---|
| 535 | else if ( "$chimie" == 'AER' ) then |
---|
| 536 | set cppflags="$cppflags -DINCA -DINCA_AER" |
---|
| 537 | else if ("$chimie" == 'GES' ) then |
---|
| 538 | set cppflags="$cppflags -DINCA" |
---|
[669] | 539 | endif |
---|
[714] | 540 | if ( "$chimie" == 'CH4' || "$chimie" == 'CH4_AER' || "$chimie" == 'NMHC' || "$chimie" == 'NMHC_AER' || "$chimie" == 'AER' || "$chimie" == 'GES' ) then |
---|
| 541 | set opt_dep="$opt_dep chimie" |
---|
| 542 | set libchimie="-lchimie" |
---|
| 543 | if ( $XNEC || $X6NEC ) then |
---|
| 544 | set libchimie="-lsxchimie" |
---|
| 545 | endif |
---|
| 546 | endif |
---|
| 547 | |
---|
| 548 | if ( "$couple" == 'true' ) then |
---|
| 549 | set cppflags="$cppflags -DCPP_COUPLE" |
---|
| 550 | endif |
---|
[664] | 551 | |
---|
[714] | 552 | if ( "$psmile" == 'true' ) then |
---|
| 553 | set cppflags="$cppflags -DCPP_PSMILE" |
---|
| 554 | endif |
---|
| 555 | |
---|
| 556 | set FLAG_PARA='' |
---|
| 557 | if ( "$parallel" == 'true' ) then |
---|
| 558 | set cppflags="$cppflags -DCPP_PARALLEL" |
---|
| 559 | set FLAG_PARA='_par' |
---|
| 560 | endif |
---|
| 561 | |
---|
| 562 | set optim="$optim $cppflags" |
---|
| 563 | set optim90="$optim90 $cppflags" |
---|
| 564 | set optimtru90="$optimtru90 $cppflags" |
---|
| 565 | |
---|
| 566 | |
---|
[524] | 567 | ######################################################################## |
---|
| 568 | # cas special sans physique |
---|
| 569 | ######################################################################## |
---|
| 570 | if ( "$physique" == 'nophys' ) then |
---|
| 571 | set phys="L_PHY= LIBPHY=" |
---|
| 572 | endif |
---|
| 573 | |
---|
| 574 | ######################################################################## |
---|
| 575 | # choix du nombre de traceur par defaut si il n'a pas ete choisi, |
---|
| 576 | # suivant la physique |
---|
| 577 | ######################################################################## |
---|
| 578 | |
---|
| 579 | if ( $ntrac == 0 ) then |
---|
| 580 | if ( "$physique" == 'nophys' ) then |
---|
| 581 | set ntrac=1 |
---|
| 582 | else if ( "$physique" == 'lmd' ) then |
---|
| 583 | set ntrac=2 |
---|
| 584 | else if ( "$physique" == 'lmd_test_li' ) then |
---|
| 585 | set ntrac=2 |
---|
| 586 | else if ( "$physique" == 'ec' ) then |
---|
| 587 | set ntrac=1 |
---|
| 588 | else |
---|
| 589 | set ntrac = 1 |
---|
| 590 | endif |
---|
| 591 | endif |
---|
| 592 | |
---|
| 593 | ######################################################################## |
---|
| 594 | #subtilites sur le nom de la librairie |
---|
| 595 | ######################################################################## |
---|
| 596 | |
---|
| 597 | \rm -f tmp ; touch tmp |
---|
| 598 | \rm -f tmp90 ; touch tmp90 |
---|
| 599 | foreach i ( $optim ) |
---|
| 600 | echo $i | sed -e 's/\"//g' -e "s/\'//g" -e 's/-//g' >> tmp |
---|
| 601 | end |
---|
| 602 | set suf= |
---|
| 603 | foreach i ( `sort tmp | uniq ` ) |
---|
| 604 | set suf=$suf$i |
---|
| 605 | end |
---|
[714] | 606 | if ( ! $IBM ) then |
---|
| 607 | set nomlib="$nomlib$suf" |
---|
| 608 | endif |
---|
| 609 | if ( $DEC ) then |
---|
| 610 | set nomlib=DEC |
---|
| 611 | endif |
---|
| 612 | if ( $IBM ) then |
---|
| 613 | set dim=`echo $dim | sed -en 's/[^0-9]/ /g'` |
---|
| 614 | set dim_=`echo $dim | sed -en 's/[^0-9]/_/g'` |
---|
| 615 | else if ( $SUN ) then |
---|
| 616 | set dim=`echo $dim | sed -e 's/[^0-9]/ /g'` |
---|
| 617 | set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'` |
---|
| 618 | else |
---|
[524] | 619 | set dim=`echo $dim | sed -n -e 's/[^0-9]/ /gp'` |
---|
| 620 | set dim_=`echo $dim | sed -n -e 's/[^0-9]/_/gp'` |
---|
[714] | 621 | endif |
---|
| 622 | set nomlib=${nomlib}${physique}_${dim_}_t${ntrac}_$grille |
---|
| 623 | ## M-A-F nomlib trop long sur CRAY pour ar |
---|
| 624 | if ( $CRAY ) then |
---|
| 625 | set nomlib=F90_${dim_}_t${ntrac} |
---|
| 626 | endif |
---|
| 627 | if ( $NEC || $XNEC || $X6NEC) then |
---|
| 628 | set nomlib=F90_${dim_}_t${ntrac} |
---|
| 629 | endif |
---|
[524] | 630 | echo calcul de la dimension |
---|
| 631 | set dimc=`echo $dim | wc -w` |
---|
| 632 | |
---|
| 633 | if ( "$dimc" == "2" ) then |
---|
| 634 | set include="$include "'-I$(LIBF)/dyn2d ' |
---|
| 635 | set dimh=$dim |
---|
| 636 | else |
---|
[714] | 637 | set include="$include "'-I$(LIBF)/dyn3d ' |
---|
[524] | 638 | set dimh=`echo $dim | awk ' { print $1 "." $2 } '` |
---|
| 639 | endif |
---|
| 640 | echo $dimc |
---|
| 641 | |
---|
| 642 | ######################################################################## |
---|
| 643 | # path pour les #include |
---|
| 644 | ######################################################################## |
---|
| 645 | |
---|
[714] | 646 | if ( $XNEC ) then |
---|
[524] | 647 | set include="$include -I$NCDFINC -I$IOIPSLDIR" |
---|
[714] | 648 | else |
---|
| 649 | set include="$include -I$NCDFINC -I$IOIPSLDIR" |
---|
| 650 | endif |
---|
| 651 | echo $include |
---|
[524] | 652 | |
---|
| 653 | ######################################################################## |
---|
| 654 | # Gestion des dimensions du modele. |
---|
| 655 | # on cree ou remplace le fichier des dimensions/nombre de traceur |
---|
| 656 | ######################################################################## |
---|
| 657 | |
---|
| 658 | cd $libf/grid |
---|
| 659 | if ( -f dimensions.h ) then |
---|
| 660 | echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' |
---|
| 661 | echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." |
---|
| 662 | echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," |
---|
| 663 | echo vous pouvez continuer en repondant oui. |
---|
| 664 | echo "Voulez-vous vraiment continuer?" |
---|
| 665 | if ( $< == "oui" ) then |
---|
| 666 | \rm -f $libf/grid/dimensions.h |
---|
| 667 | else |
---|
| 668 | exit |
---|
| 669 | endif |
---|
| 670 | endif |
---|
| 671 | |
---|
| 672 | cd dimension |
---|
[714] | 673 | ./makdim $ntrac $dim |
---|
[524] | 674 | cat $libf/grid/dimensions.h |
---|
| 675 | |
---|
| 676 | cd $LMDGCM |
---|
| 677 | set libo=$libo/$nomlib |
---|
| 678 | if ( ! -d $libo ) then |
---|
| 679 | mkdir $libo |
---|
| 680 | cd $model |
---|
| 681 | endif |
---|
| 682 | |
---|
| 683 | ######################################################################## |
---|
| 684 | # Differentes dynamiques (3d, 2d, 1d) |
---|
| 685 | ######################################################################## |
---|
| 686 | |
---|
| 687 | set dimension=`echo $dim | wc -w` |
---|
| 688 | echo dimension $dimension |
---|
| 689 | if ( $dimension == 1 ) then |
---|
| 690 | echo pas de dynamique |
---|
| 691 | set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " |
---|
| 692 | endif |
---|
| 693 | endif |
---|
| 694 | cd $model |
---|
| 695 | if ( $dimension == 3 ) then |
---|
| 696 | cd libf/grid |
---|
| 697 | \rm fxyprim.h |
---|
| 698 | cp -p fxy_${grille}.h fxyprim.h |
---|
| 699 | endif |
---|
| 700 | |
---|
| 701 | ###################################################################### |
---|
| 702 | # Traitement special pour le nouveau rayonnement de Laurent Li. |
---|
| 703 | ###################################################################### |
---|
| 704 | |
---|
| 705 | if ( -f $libf/phy$physique/raddim.h ) then |
---|
| 706 | if ( -f $libf/phy$physique/raddim.$dimh.h ) then |
---|
| 707 | \rm -f $libf/phy$physique/raddim.h |
---|
| 708 | cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h |
---|
| 709 | echo $libf/phy$physique/raddim.$dimh.h |
---|
| 710 | cat $libf/phy$physique/raddim.$dimh.h |
---|
| 711 | cat $libf/phy$physique/raddim.h |
---|
| 712 | else |
---|
| 713 | echo On peut diminuer la taille de l executable en creant |
---|
| 714 | echo le fichier $libf/phy$physique/raddim.$dimh.h |
---|
| 715 | \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h |
---|
| 716 | endif |
---|
| 717 | endif |
---|
| 718 | |
---|
| 719 | ###################################################################### |
---|
| 720 | # Gestion du filtre qui n'existe qu'en 3d. |
---|
| 721 | ###################################################################### |
---|
| 722 | |
---|
| 723 | if ( `expr $dimc \> 2` == 1 ) then |
---|
| 724 | set filtre="FILTRE=$filtre" |
---|
| 725 | else |
---|
| 726 | set filtre="FILTRE= L_FILTRE= " |
---|
| 727 | endif |
---|
| 728 | echo MACRO FILTRE $filtre |
---|
| 729 | |
---|
| 730 | echo $dimc |
---|
| 731 | |
---|
| 732 | ######################################################################## |
---|
| 733 | # utilisation des vraies routines de couplage si on est en couple |
---|
| 734 | ######################################################################## |
---|
| 735 | if ( $couple == 'true' ) then |
---|
[714] | 736 | banner couple |
---|
[524] | 737 | pwd |
---|
[714] | 738 | if ( "$psmile" == 'true' ) then |
---|
| 739 | if ( -f $libf/phy$physique/oasis.F ) then |
---|
| 740 | \rm $libf/phy$physique/oasis.F |
---|
| 741 | endif |
---|
| 742 | if ( ! -f $libf/phy$physique/oasis.F90 ) then |
---|
| 743 | \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90 |
---|
| 744 | endif |
---|
| 745 | if ( `diff $libf/phy$physique/oasis.F90 $libf/phy$physique/oasis.psmile | wc -w` ) then |
---|
| 746 | \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90 |
---|
| 747 | endif |
---|
| 748 | else |
---|
| 749 | if ( -f $libf/phy$physique/oasis.F90 ) then |
---|
| 750 | \rm $libf/phy$physique/oasis.F90 |
---|
| 751 | endif |
---|
| 752 | if (! -f $libf/phy$physique/oasis.F ) then |
---|
| 753 | \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F |
---|
| 754 | else |
---|
| 755 | if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true | wc -w` ) then |
---|
| 756 | # \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy |
---|
| 757 | \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F |
---|
| 758 | endif |
---|
| 759 | endif |
---|
| 760 | endif |
---|
[524] | 761 | else |
---|
[714] | 762 | if ( -f $libf/phy$physique/oasis.F90 ) then |
---|
| 763 | \rm $libf/phy$physique/oasis.F90 |
---|
[524] | 764 | endif |
---|
[714] | 765 | if (! -f $libf/phy$physique/oasis.F ) then |
---|
| 766 | \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F |
---|
| 767 | else |
---|
| 768 | if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy | wc -w` ) then |
---|
| 769 | \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true |
---|
| 770 | \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F |
---|
| 771 | endif |
---|
| 772 | endif |
---|
[524] | 773 | endif |
---|
| 774 | ######################################################################## |
---|
| 775 | # Avant de lancer le make, on recree le makefile si necessaire |
---|
| 776 | ######################################################################## |
---|
[714] | 777 | ######################################################################## |
---|
[524] | 778 | # c'est a dire dans 3 cas: |
---|
| 779 | # 1. si la liste des fichiers .F et .h a ete modifiee depuis la |
---|
| 780 | # derniere creation du makefile |
---|
| 781 | # 2. si le fichier contenant cette liste "liste_des_sources" |
---|
| 782 | # n'existe pas. |
---|
| 783 | # 3. Si le makefile n'existe pas. |
---|
| 784 | ######################################################################## |
---|
[714] | 785 | ########################################## |
---|
| 786 | # On adapte d'abord certains include à F90 |
---|
| 787 | ########################################## |
---|
| 788 | sed -e 's/^c/\!/' $libf/grid/dimensions.h >! $libf/grid/dimensions90.tmp |
---|
| 789 | if ( ! -f $libf/grid/dimensions90.h || `diff $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h | wc -w` ) then |
---|
| 790 | \mv $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h |
---|
| 791 | endif |
---|
| 792 | awk 'BEGIN {} { sub ("^c","\!") ; if ($0 ~ /^ s/) {if (NR > 1) print p0," &"; sub (" s"," \\&")} else { if (NR > 1) print p0 } p0=$0 } END { print p0}' $libf/dyn3d/paramet.h >! $libf/dyn3d/paramet90.tmp |
---|
| 793 | # sed -n -e 's/^c/\!/' -e '1 h' -e '2,$ H' -e '$ { x ; s/\n s/ \&\n \& /g ; p }' $libf/dyn3d/paramet.h >! $libf/dyn3d/paramet90.tmp |
---|
| 794 | if ( ! -f $libf/dyn3d/paramet90.h || `diff $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h | wc -w` ) then |
---|
| 795 | \mv $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h |
---|
| 796 | endif |
---|
| 797 | awk 'BEGIN {} { sub ("^c","\!") ; if ($0 ~ /^ \./) {if (NR > 1) print p0," &"; sub (" \."," \\&")} else { if (NR > 1) print p0 } p0=$0 } END { print p0}' $libf/dyn3d/control.h >! $libf/dyn3d/control.tmp |
---|
| 798 | #sed -n -e 's/^c/\!/' -e '1 h' -e '2,$ H' -e '$ { x ; s/\n \./ \&\n \& /g ; p }' $libf/dyn3d/control.h >! $libf/dyn3d/control.tmp |
---|
| 799 | if ( ! -f $libf/dyn3d/control.inc || `diff $libf/dyn3d/control.tmp $libf/dyn3d/control.inc | wc -w` ) then |
---|
| 800 | \mv $libf/dyn3d/control.tmp $libf/dyn3d/control.inc |
---|
| 801 | endif |
---|
| 802 | awk 'BEGIN {} { sub ("^c","\!") ; if ($0 ~ /^ S/) {if (NR > 1) print p0," &"; sub (" S"," \\&")} else { if (NR > 1) print p0 } p0=$0 } END { print p0}' $libf/phylmd/YOMCST.h >! $libf/phylmd/YOMCST.tmp |
---|
| 803 | if ( ! -f $libf/phylmd/YOMCST.inc || `diff $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc | wc -w` ) then |
---|
| 804 | \mv $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc |
---|
| 805 | endif |
---|
| 806 | awk 'BEGIN {} { sub ("^c","\!") ; if ($0 ~ /^ S/) {if (NR > 1) print p0," &"; sub (" S"," \\&")} else { if (NR > 1) print p0 } p0=$0 } END { print p0}' $libf/phylmd/clesphys.h >! $libf/phylmd/clesphys.tmp |
---|
| 807 | if ( ! -f $libf/phylmd/clesphys.inc || `diff $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc | wc -w` ) then |
---|
| 808 | \mv $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc |
---|
| 809 | endif |
---|
| 810 | #sed -e 's/^c/\!/' $libf/dyn3dpar/paramet.h >! $libf/dyn3dpar/paramet90.h |
---|
| 811 | ########################################## |
---|
[524] | 812 | cd $model |
---|
| 813 | find libf -name '*.[Fh]' -print >! tmp77 |
---|
| 814 | find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print >! tmp90 |
---|
| 815 | find libf -name '*.[Fh]90' -print >> tmp90 |
---|
| 816 | |
---|
| 817 | if ( `diff tmp77 liste_des_sources_f77 | wc -w` \ |
---|
| 818 | || `diff tmp90 liste_des_sources_f90 | wc -w` \ |
---|
| 819 | || ! -f makefile \ |
---|
| 820 | || ! -f liste_des_sources_f90 \ |
---|
| 821 | || ! -f liste_des_sources_f77 ) then |
---|
| 822 | echo les fichiers suivants ont ete crees ou detruits |
---|
| 823 | echo ou les fichiers suivants sont passes ou ne sont plus en Fortran 90 |
---|
| 824 | diff liste_des_sources_f77 tmp77 |
---|
| 825 | diff liste_des_sources_f90 tmp90 |
---|
| 826 | \cp tmp77 liste_des_sources_f77 |
---|
| 827 | \cp tmp90 liste_des_sources_f90 |
---|
| 828 | echo On recree le makefile |
---|
| 829 | ./create_make_gcm >! tmp |
---|
| 830 | \mv tmp makefile |
---|
| 831 | echo Nouveau makefile cree. |
---|
| 832 | endif |
---|
| 833 | |
---|
| 834 | ######################################################################## |
---|
| 835 | # Execution de la comande make |
---|
| 836 | ######################################################################## |
---|
| 837 | |
---|
| 838 | echo PHYSIQUE $phys |
---|
| 839 | echo dynamique $dyn $dimension |
---|
| 840 | echo OPTIM="$optim" $filtre LIBO=$libo $dyn PHYS=$phys DIM=$dimc PROG=$code |
---|
| 841 | echo PATH pour les fichiers INCLUDE $include |
---|
| 842 | echo OPLINK="$oplink" |
---|
| 843 | |
---|
[714] | 844 | ################# |
---|
| 845 | if $HP then |
---|
| 846 | ################# |
---|
| 847 | set f77='fort77 +OP' |
---|
| 848 | set f90='jensaisrien' |
---|
| 849 | set opt_link="$opt_link -lm" |
---|
| 850 | ################# |
---|
| 851 | else if $VPP then |
---|
| 852 | ################# |
---|
| 853 | set f77=frt |
---|
| 854 | set f90=$f77 |
---|
| 855 | if ($couple == true) then |
---|
| 856 | set opt_link="-Wg,-c $MODIPSLDIR/liboasis2.4_mpi2.a /usr/lang/mpi2/lib64/libmpi.a /usr/lang/mpi2/lib64/libmp.a -L$MODIPSLDIR -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" |
---|
| 857 | set oplink="-Wl,-t,-P,-dy " |
---|
| 858 | else |
---|
| 859 | set opt_link="-Wg,-c -L$MODIPSLDIR -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" |
---|
| 860 | set oplink="-Wl,-t,-dy " |
---|
| 861 | endif |
---|
| 862 | if ($veget == true) then |
---|
| 863 | set opt_link="$opt_link $link_veget -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" |
---|
| 864 | endif |
---|
| 865 | ################# |
---|
| 866 | else if $CRAY then |
---|
| 867 | ################# |
---|
| 868 | set f77=f90 |
---|
| 869 | set f90=f90 |
---|
| 870 | ################# |
---|
| 871 | else if $LINUX then |
---|
| 872 | ################# |
---|
| 873 | # set f77=pgf90 |
---|
| 874 | # set f90=pgf90 |
---|
| 875 | set f77=$FC_LINUX |
---|
| 876 | set f90=$FC_LINUX |
---|
| 877 | if ( $FC_LINUX == 'pgf90' ) then |
---|
| 878 | set opt_link=" -L$MODIPSLDIR $link_veget -L$NCDFLIB -lioipsl -lnetcdf -Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2/" |
---|
| 879 | else if ($FC_LINUX == 'g95') then |
---|
| 880 | set opt_link="-L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf " |
---|
| 881 | else |
---|
| 882 | set opt_link=" " |
---|
| 883 | endif |
---|
| 884 | ################# |
---|
| 885 | else if $SUN then |
---|
| 886 | ################# |
---|
| 887 | set f77=f90 |
---|
| 888 | set f90=f90 |
---|
| 889 | set opt_link="-lf77compat -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf " |
---|
| 890 | ################# |
---|
| 891 | else if $NEC then |
---|
| 892 | ################# |
---|
| 893 | set f77=f90 -ftrace |
---|
| 894 | set f90=f90 -ftrace |
---|
| 895 | set opt_link="-L$MODIPSLDIR" |
---|
| 896 | if ($veget == true) then |
---|
| 897 | set opt_link="$opt_link $link_veget" |
---|
| 898 | endif |
---|
| 899 | if ($couple == true) then |
---|
| 900 | set opt_link="$opt_link -lioipsl -loasis2.4_mpi2 -float0 -ew -P static $NCDFLIB " |
---|
| 901 | else |
---|
| 902 | set opt_link="$opt_link -L$MODIPSLDIR -lioipsl -float0 -ew -P static $NCDFLIB " |
---|
| 903 | endif |
---|
| 904 | set mod_loc_dir="./" |
---|
| 905 | ################# |
---|
| 906 | else if $XNEC then |
---|
| 907 | ################# |
---|
| 908 | set f77="sxmpif90 -ftrace" |
---|
| 909 | set f90="sxmpif90 -ftrace" |
---|
| 910 | if $MODIPSL then |
---|
| 911 | set opt_link="-L$MODIPSLDIR" |
---|
| 912 | if ($veget == true) then |
---|
| 913 | set opt_link="$opt_link $link_veget" |
---|
| 914 | endif |
---|
| 915 | if ($couple == true) then |
---|
| 916 | if ($psmile == true) then |
---|
| 917 | set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " |
---|
| 918 | else |
---|
| 919 | set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB " |
---|
| 920 | endif |
---|
| 921 | else |
---|
| 922 | set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " |
---|
| 923 | endif |
---|
| 924 | else |
---|
| 925 | if ($couple == true) then |
---|
| 926 | set opt_link="-L$MODIPSLDIR" |
---|
| 927 | set opt_link="$opt_link $link_veget -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB " |
---|
| 928 | else |
---|
| 929 | set opt_link=" -C hopt -float0 $optdbl -P static -L$MODIPSLDIR $link_veget -lsxioipsl $NCDFLIB " |
---|
| 930 | endif |
---|
| 931 | endif |
---|
| 932 | set mod_loc_dir="./" |
---|
| 933 | ################## |
---|
| 934 | else if $X6NEC then |
---|
| 935 | ################## |
---|
| 936 | set f77=sxmpif90 |
---|
| 937 | set f90=sxmpif90 |
---|
| 938 | if $MODIPSL then |
---|
| 939 | set opt_link="-L$MODIPSLDIR" |
---|
| 940 | if ($veget == true) then |
---|
| 941 | set opt_link="$opt_link -lsxsechiba -lsxparameters -lsxstomate" |
---|
| 942 | endif |
---|
| 943 | if ($couple == true) then |
---|
| 944 | if ($psmile == true) then |
---|
| 945 | set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB " |
---|
| 946 | else |
---|
| 947 | set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 -size_t64 $optdbl -P static $NCDFLIB " |
---|
| 948 | endif |
---|
| 949 | else |
---|
| 950 | set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB " |
---|
| 951 | endif |
---|
| 952 | else |
---|
| 953 | # set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxsechiba -lsxparameters -lsxstomate -lsxioipsl $NCDFLIB " |
---|
| 954 | set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxioipsl $NCDFLIB " |
---|
[669] | 955 | |
---|
[714] | 956 | endif |
---|
| 957 | set mod_loc_dir="./" |
---|
| 958 | ################# |
---|
| 959 | else |
---|
| 960 | ################# |
---|
| 961 | set f77=f77 |
---|
| 962 | set f90=f90 |
---|
| 963 | endif |
---|
| 964 | |
---|
| 965 | cd $model |
---|
| 966 | |
---|
| 967 | if $VPP then |
---|
| 968 | set make="gmake RANLIB=ls" |
---|
| 969 | else if $CRAY then |
---|
| 970 | set make="make RANLIB=ls" |
---|
| 971 | else if $NEC then |
---|
| 972 | set make="make RANLIB=ls" |
---|
| 973 | else if $LINUX then |
---|
| 974 | set make="make -k RANLIB=ranlib" |
---|
| 975 | else if $XNEC then |
---|
| 976 | set make="gmake RANLIB=ls" |
---|
| 977 | else if $X6NEC then |
---|
| 978 | set make="gmake RANLIB=ls" |
---|
| 979 | else |
---|
| 980 | set make="make RANLIB=ranlib" |
---|
| 981 | endif |
---|
| 982 | |
---|
| 983 | |
---|
| 984 | |
---|
| 985 | |
---|
| 986 | # |
---|
| 987 | # etat0_netcdf a besoin d'info de la physique |
---|
| 988 | # A revoir |
---|
[524] | 989 | set include="$include"' -I$(LIBF)/phy'"$physique" |
---|
[714] | 990 | # |
---|
| 991 | # le programme principal create_limit a besoin de l'info du module |
---|
| 992 | # startvar: on met donc libo dans les include pour Nec |
---|
[524] | 993 | set include="$include"' -I$(LIBO)' |
---|
| 994 | |
---|
| 995 | |
---|
| 996 | ################################################################# |
---|
| 997 | # Execution de la comande make... ENFIN! |
---|
| 998 | ################################################################# |
---|
| 999 | |
---|
[714] | 1000 | if $VPP then |
---|
| 1001 | set optim90=" $optim90 -Am -M$libo" |
---|
| 1002 | set optimtru90="$optim90" |
---|
| 1003 | \cp $IOIPSLDIR/*.mod $libo |
---|
| 1004 | else if $SUN then |
---|
| 1005 | set optim90=" $optim90 -M$libo -M$MODIPSLDIR " |
---|
| 1006 | set optimtru90=" $optimtru90 -M$libo -M$MODIPSLDIR " |
---|
| 1007 | set optim="$optim90" |
---|
| 1008 | \cp $IOIPSLDIR/*.mod $libo |
---|
| 1009 | else if $NEC then |
---|
| 1010 | set optim90=" $optim90 -I$libo " |
---|
| 1011 | else if $XNEC then |
---|
| 1012 | set optim90=" $optim90 -I$libo " |
---|
| 1013 | set optimtru90=" $optimtru90 -I$libo " |
---|
| 1014 | else if $X6NEC then |
---|
| 1015 | set optim90=" $optim90 -I$libo " |
---|
| 1016 | set optimtru90=" $optimtru90 -I$libo " |
---|
| 1017 | else if $LINUX then |
---|
| 1018 | if ( $FC_LINUX == "pgf90" ) then |
---|
| 1019 | set optimtru90=" $optimtru90 -module $libo " |
---|
| 1020 | set optim90=" $optim90 -module $libo " |
---|
| 1021 | else if ( $FC_LINUX == 'g95' ) then |
---|
| 1022 | set optimtru90=" $optimtru90 -fmod=$libo " |
---|
| 1023 | set optim90=" $optim90 -fmod=$libo " |
---|
| 1024 | endif |
---|
| 1025 | set optim="$optim90" |
---|
| 1026 | set mod_loc_dir=$libo |
---|
| 1027 | # \cp /d3/fairhead/sechiba/ioipsl/*.mod $libo |
---|
| 1028 | # \cp $IOIPSLDIR/*.mod $libo |
---|
| 1029 | endif |
---|
[524] | 1030 | |
---|
[714] | 1031 | set link="$f90 $optim90" |
---|
[524] | 1032 | |
---|
[714] | 1033 | set ar=ar |
---|
| 1034 | |
---|
| 1035 | if $XNEC then |
---|
| 1036 | set link="sxld $opt_link" |
---|
| 1037 | set link="$f90 " |
---|
| 1038 | # set ar=sxar |
---|
| 1039 | else if $X6NEC then |
---|
| 1040 | set link="sxld $opt_link" |
---|
| 1041 | set link="$f90 " |
---|
| 1042 | endif |
---|
| 1043 | |
---|
| 1044 | |
---|
[524] | 1045 | cd $localdir |
---|
| 1046 | |
---|
| 1047 | echo $make -f $LMDGCM/makefile \ |
---|
| 1048 | OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ |
---|
| 1049 | OPTIM90="$optim90" \ |
---|
| 1050 | OPTIMTRU90="$optimtru90" \ |
---|
| 1051 | OPTIM="$optim$optimbis" \ |
---|
| 1052 | INCLUDE="$include" \ |
---|
| 1053 | $filtre \ |
---|
| 1054 | LIBO=$libo \ |
---|
| 1055 | $dyn \ |
---|
| 1056 | $phys \ |
---|
| 1057 | DIM=$dimc \ |
---|
| 1058 | L_ADJNT="$adjnt" \ |
---|
[714] | 1059 | L_CHIMIE="$libchimie" \ |
---|
[524] | 1060 | LOCAL_DIR="$localdir" \ |
---|
| 1061 | F77="$f77" \ |
---|
| 1062 | F90="$f90" \ |
---|
| 1063 | OPLINK="$oplink" \ |
---|
| 1064 | LINK="$link" \ |
---|
| 1065 | GCM="$LMDGCM" \ |
---|
| 1066 | MOD_LOC_DIR=$mod_loc_dir \ |
---|
| 1067 | MOD_SUFFIX=$mod_suffix \ |
---|
| 1068 | AR=$ar \ |
---|
| 1069 | PROG=$code |
---|
| 1070 | |
---|
| 1071 | $make -f $LMDGCM/makefile \ |
---|
| 1072 | OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ |
---|
| 1073 | OPTIM90="$optim90" \ |
---|
| 1074 | OPTIMTRU90="$optimtru90" \ |
---|
| 1075 | OPTIM="$optim$optimbis" \ |
---|
| 1076 | INCLUDE="$include" \ |
---|
| 1077 | $filtre \ |
---|
| 1078 | LIBO=$libo \ |
---|
| 1079 | $dyn \ |
---|
| 1080 | $phys \ |
---|
| 1081 | DIM=$dimc \ |
---|
| 1082 | L_ADJNT="$adjnt" \ |
---|
[714] | 1083 | L_CHIMIE="$libchimie" \ |
---|
[524] | 1084 | LOCAL_DIR="$localdir" \ |
---|
| 1085 | F77="$f77" \ |
---|
| 1086 | F90="$f90" \ |
---|
| 1087 | OPLINK="$oplink" \ |
---|
| 1088 | LINK="$link" \ |
---|
| 1089 | GCM="$LMDGCM" \ |
---|
| 1090 | MOD_LOC_DIR=$mod_loc_dir \ |
---|
| 1091 | MOD_SUFFIX=$mod_suffix \ |
---|
| 1092 | AR=$ar \ |
---|
| 1093 | PROG=$code |
---|
| 1094 | |
---|
| 1095 | \rm -f $libf/grid/dimensions.h |
---|