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