source: trunk/LMDZ.MARS/makegcm_ifort @ 148

Last change on this file since 148 was 148, checked in by emillour, 14 years ago

Mars GCM:

Significant update on how the number of scatterers is managed:

Instead of having to manualy change 'nearkind' in dimradmars.h, the
number of scatterers must now be set when compiling, using makegcm
"makegcm -s 1" for one scatterer (dust) or "makegcm -s 2" (e.g. dust
and water ice), default behaviour (ie not specifying -s #) is -s 1
Modified phymars/dimradmars.h , added directory phymars/scatterers
with script make_scatterers , and adapted makegcm* scripts.

also removed some superfluous files (tmp, tmp77, ...).

EM

  • Property svn:executable set to *
File size: 22.8 KB
Line 
1#!/bin/csh -f
2# $Header: /users/lmdz/cvsroot/LMDZ.3.3/makegcm,v 1.21 2001/07/04 08:41:44 lmdz Exp $
3#set verbose echo
4########################################################################
5# options par defaut pour la commande make
6########################################################################
7set dim="64x48x32"
8set physique=mars
9set phys="PHYS=$physique"
10set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I. -I$(LIBF)/aeronomars'
11set ntrac = 1
12set filtre=filtrez
13set grille=reg
14set dyntype="dyn"
15set scatterers="1"
16########################################################################
17# path a changer contenant les sources et les objets du modele
18########################################################################
19
20#### If you want you can set environment variables here (instead of
21####  relying on the C-shell environment variables)
22# default LMDGCM to where makegcm script is located:
23#setenv LMDGCM "`dirname $0`"
24# You may set LIBOGCM to something else; otherwise we default to:
25#setenv LIBOGCM $LMDGCM/libo
26## NetCDF Libraries: what follows is OK on GNOME
27#  setenv NCDFLIB /usr/local/lib
28#  setenv NCDFINC /usr/local/include
29####
30
31setenv localdir "`pwd`"
32set MODIPSL=0
33echo $localdir | grep modipsl >& /dev/null
34if ( ! $status ) then
35  set MODIPSL=1
36  setenv LMDGCM $localdir
37  cd ../..
38  setenv LIBOGCM "`pwd`/lib"
39  cd $localdir
40  if ( `hostname` == rhodes ) then
41    set NCDFINC=`grep sxnec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
42    set NCDFLIB=`grep sxnec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
43  else
44    if ( `hostname` == nymphea0 ) then
45      set NCDFINC=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
46      set NCDFLIB=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
47    else
48      echo 'Probleme de definition des variables NCDFINC et NCDFLIB'
49    endif
50  endif
51else
52  if ( ! $?LMDGCM ) then
53    echo You must initialize the variable LMDGCM in your environnement
54    echo for instance: "setenv LMDGCM /usr/myself/supergcm" in .cshrc
55    exit
56  endif
57  if ( ! $?LIBOGCM ) then
58    set LIBOGCM=$LMDGCM/libo
59  endif
60  if ( ! $?NCDFLIB ) then
61    echo You must initialize the variable NCDFLIB in your environnement
62    echo for instance: "setenv NCDFLIB /usr/myself/netcdf" in .cshrc
63    exit
64  endif
65  if ( ! $?NCDFINC ) then
66    echo You must initialize the variable NCDFINC in your environnement
67    echo for instance: "setenv NCDFINC /usr/myself/netcdf" in .cshrc
68    exit
69  endif
70endif
71set model=$LMDGCM
72set libo=$LIBOGCM
73
74########################################################################
75#  Les differentes platformes reconnues
76########################################################################
77
78set HP=0
79set IBM=0
80set SUN=0
81set VPP=0
82set CRAY=0
83set DEC=0
84set LINUX=0
85set NEC=0
86set XNEC=0
87if ( `uname` == HP-UX ) then
88   set machine=HP
89   set HP=1
90else if (`uname` == UNIX_System_V ) then
91   set machine=VPP
92   set VPP=1
93else if (`uname` == SunOS ) then
94   set machine=SUN
95   set SUN=1
96else if ( `uname` == AIX ) then
97   set machine=IBM
98   set IBM=1
99else if ( `uname` == OSF1 ) then
100   set machine=ALPHA
101   set DEC=1
102else if ( `uname` == Linux ) then
103   set machine=LINUX
104   set LINUX=1
105else if ( `hostname` == atlas || `hostname` == axis  || `hostname` == etoile ) then
106   set machine=CRAY
107   set CRAY=1
108else if ( `uname` == SUPER-UX ) then
109   set machine=NEC
110   set NEC=1
111else if ( `hostname` == rhodes) then
112   set machine=XNEC
113   set XNEC=1
114else
115   echo Vous travaillez sur une machine non prevue par le reglement
116   exit
117endif
118
119# create $libo directory if it doesn't exist
120if ( ! -d $libo )  then
121   mkdir $libo
122endif
123
124if $VPP then
125set netcdf=netcdf_v
126else
127set netcdf=netcdf
128endif
129########################################################################
130#  Quelques initialisations de variables du shell.
131########################################################################
132
133set dyn=
134set opt_link=""
135set adjnt=""
136set opt_dep=""
137
138set optim90=""
139set oplink=""
140
141########################################################################
142#  Optimisations par defaut suivant les machines
143########################################################################
144
145echo "Optimisations par defaut suivant les machines"
146set libf=$model/libf
147#setenv localdir "LOCAL_DIR=`pwd`"
148#setenv localdir "`pwd`"
149cd $model
150if $CRAY then
151   set optim90="-Wp'-P' -DCRAY "'-p$(LIBO) -eiv '
152   set oplink="-Wl'-DSTACK=128 -f indef' -L$NCDFLIB -lnetcdf "
153   set mod_loc_dir=" "
154   set mod_suffix=" "
155else if $SUN then
156   set optim90=" -fast"
157   set optimtru90=" -fast -free"
158   set opt_link="-L$NCDFLIB -lnetcdf"
159   set mod_loc_dir=$localdir
160   set mod_suffix=mod
161else if $HP then
162else if $IBM then
163else if $VPP then
164   set optim90="$optim -X9 -w"
165   if $COUPLE then
166     set opt_link="-Wg,-c $IOIPSLDIR/liboasis2.4_mpi2.a /usr/lang/mpi2/lib64/libmpi.a /usr/lang/mpi2/lib64/libmp.a /usr/local/lib/lib64/libnetcdf_cc.a -L$IOIPSLDIR -lioipsl"
167     set oplink="-Wl,-t,-P,-dy "
168   else
169     set opt_link="-Wg,-c /usr/local/lib/lib64/libnetcdf_cc.a -L$IOIPSLDIR -lioipsl"
170     set oplink="-Wl,-t,-dy "
171   endif
172   set mod_loc_dir=$IOIPSLDIR
173   set mod_suffix=mod
174else if $DEC then
175else if $LINUX then
176# Ehouarn 'ifort' compiler
177   #NB: on gnome -O3 ==> NaNs ...
178   set optim=" -O2 -ip -mkl=sequential -align common "
179   set optim90=" -O2 -ip -mkl=sequential -align common "
180   set optimtru90=" -O2 -ip -mkl=sequential -align common "
181#   set opt_link=" -Mfree -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Bstatic "
182   set mod_loc_dir=$LIBOGCM
183   set mod_suffix=mod
184else if $NEC then
185   set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
186   set optimtru90=' -clear -f4 -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
187###   set opt_link=" -C hopt -float0 -ew -P static -L$IOIPSLDIR -lioipsl  -L/u/rech/psl/rpsl003/IOIPSL -lnetcdf_i8r8_v "
188   set opt_link=" -C hopt -float0 -ew -P static -L/SX/usr/local/lib  -lnetcdf_i8r8 "
189   set mod_loc_dir="."
190   set mod_suffix="mod"
191else if $XNEC then
192   set optim90=' -clear -R5 -C vopt -float0 -ew -P static -Wf,"-pvctl loopcnt=40000 fullmsg noassume "'
193   set optimtru90=' -clear -R5 -f4 -C vopt -float0 -ew -P static -Wf,"-pvctl loopcnt=40000 fullmsg noassume "'
194   if $MODIPSL then
195     if $COUPLE then
196       set opt_link="-L$IOIPSLDIR -lsxioipsl -loasis2.4_mpi2 -float0 -ew -P static -I$NCDFINC $NCDFLIB "
197     else
198       set opt_link="-L$IOIPSLDIR -lsxioipsl -float0 -ew -P static -I$NCDFINC $NCDFLIB "
199     endif
200     set mod_loc_dir="./"
201   else
202####     set opt_link=" -C hopt -float0 -ew -P static -L$IOIPSLDIR -lsxioipsl -L /u/rech/psl/rpsl003/IOIPSL -lnetcdf_i8r8_v -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"
203     set opt_link=" -C hopt -float0 -ew -P static -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"
204     set mod_loc_dir="."
205   endif
206   set mod_suffix="mod"
207
208endif
209
210# Ehouarn: add 'g9fortran' string to pathname
211set nomlib=${machine}
212
213# Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64)
214if (`uname` == Linux && `uname -m` == "x86_64") then
215  set nomlib=${machine}64
216endif
217
218########################################################################
219# lecture des options de mymake
220########################################################################
221
222top:
223if ($#argv > 0) then
224    switch ($1:q)
225
226    case -h:
227
228########################################################################
229# Manuel en ligne
230########################################################################
231more <<eod
232
233
234makegcm [Options] prog
235
236
237The makegcm script:
238-------------------
239
2401. compiles a series of subroutines located in the $LMDGCM/libf
241 sub-directories.
242 The objects are then stored in the libraries in $LIBOGCM.
243
2442. then, makegcm compiles program prog.f located by default in
245$LMDGCM/libf/dyn3d and makes the link with the libraries.
246
247Environment Variables '$LMDGCM' and '$LIBOGCM'
248 must be set as environment variables or directly
249 in the makegcm file.
250
251The makegcm command is used to control the different versions of the model
252 in parallel, compiled using the compilation options
253 and the various dimensions, without having to recompile the whole model.
254
255The FORTRAN libraries are stored in directory $LIBOGCM.
256
257
258OPTIONS:
259--------
260
261The following options can either be defined by default by editing the
262makegcm "script", or in interactive mode:
263
264-d imxjmxlm  where im, jm, and lm are the number of longitudes,
265             latitudes and vertical layers respectively.
266
267-t ntrac   Selects the number of tracers present in the model
268
269             Options -d and -t overwrite file
270             $LMDGCM/libf/grid/dimensions.h
271             which contains the 3 dimensions of the
272             horizontal grid
273             im, jm, lm plus the number of tracers passively advected
274             by the dynamics ntrac,
275             in 4 PARAMETER FORTRAN format
276             with a new file:
277             $LMDGCM/libf/grid/dimension/dimensions.im.jm.lm.tntrac
278             If the file does not exist already
279             it is created by the script
280             $LMDGCM/libf/grid/dimension/makdim
281
282-s nscat   Number of radiatively active scatterers
283
284-p PHYS    Selects the set of physical parameterizations
285           you want to compile the model with.
286           The model is then compiled using the physical
287           parameterization sources in directory:
288            $LMDGCM/libf/phyPHYS
289
290-g grille  Selects the grid type.
291           This option overwrites file
292           $LMDGCM/libf/grid/fxyprim.h
293           with file
294           $LMDGCM/libf/grid/fxy_grille.h
295           the grid can take the following values:
296           1. reg - the regular grid
297           2. sin - to obtain equidistant points in terms of sin(latitude)
298           3. new - to zoom into a part of the globe
299
300-O "compilation options" set of fortran compilation options to use
301
302-include path
303           Used if the subroutines contain #include files (ccp) that
304           are located in directories that are not referenced by default.
305
306-adjnt     Compiles the adjoint model to the dynamical code.
307
308-olddyn    To compile GCM with "old dynamics"
309
310-filtre  filter
311           To select the longitudinal filter in the polar regions.
312           "filter" corresponds to the name of a directory located in
313           $LMDGCM/libf. The standard filter for the model is "filtrez"
314           which can be used for a regular grid and for a 
315           grid with longitudinal zoom.
316
317-link "-Ldir1 -lfile1 -Ldir2 -lfile2 ..."
318           Adds a link to FORTRAN libraries
319           libfile1.a, libfile2.a ...
320           located in directories dir1, dir2 ...respectively
321           If dirn is a directory with an automatic path
322           (/usr/lib ... for example)
323           there is no need to specify  -Ldirn.
324
325eod
326exit
327
328########################################################################
329# Lecture des differentes options
330########################################################################
331
332    case -d:
333        set dim=$2 ; shift ; shift ; goto top
334                       
335    case -O:
336        set optim="$2" ; set optim90="$2" ; set optimtru90="$2" ; shift ; shift ; goto top
337
338     case -p
339        set physique="$2" ; set phys="PHYS=$physique" ; shift ; shift ; goto top
340
341     case -s
342        set scatterers="$2" ; shift ; goto top
343
344     case -g
345        set grille="$2" ; shift ; shift ; goto top
346
347     case -t
348        set ntrac=$2 ; shift ; shift ; goto top
349
350     case -include
351        set include="$include -I$2" ; shift ; shift ; goto top
352
353     case -adjnt
354        set opt_dep="$opt_dep adjnt" ; set adjnt="-ladjnt -ldyn3d "
355
356     case -olddyn
357        set dyntype="olddyn" ; shift; goto top
358
359     case -filtre
360        set filtre=$2 ; shift ; shift ; goto top
361
362     case -link
363        set opt_link="$opt_link $2" ; shift ; shift ; goto top
364
365     case -debug
366        if $HP then
367           set optim90=" -g "
368        else if $SUN then
369           setenv PARALLEL 4
370           set optim90=" -g -C "
371           set optimtru90=" -g -C "
372        else if $CRAY then
373           set optim90="$optim90"" -G1 "
374        else if $LINUX then
375           ## for ifort
376             set optim=" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
377             set optim90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
378             set optimtru90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
379        else
380           echo "pas d option debug predefinie pour cette machine"
381           exit
382        endif
383        shift ; goto top
384
385     default
386        set code="$1" ; shift ; goto top
387
388   endsw
389endif
390
391echo "apres les opts dim $dim"
392
393########################################################################
394# cas special sans physique
395########################################################################
396if ( "$physique" == 'nophys' ) then
397   set phys="L_PHY= LIBPHY="
398endif
399
400########################################################################
401# choix du nombre de traceur par defaut si il n'a pas ete choisi,
402# suivant la physique
403########################################################################
404
405if ( $ntrac == 0  ) then
406    if ( "$physique" == 'nophys' ) then
407        set ntrac=1
408    else if ( "$physique" == 'lmd' ) then
409        set ntrac=2
410    else if ( "$physique" == 'lmd_test_li' ) then
411        set ntrac=2
412    else if ( "$physique" == 'ec' ) then
413        set ntrac=1
414    else
415        set ntrac = 1
416    endif
417endif
418
419########################################################################
420#subtilites sur le nom de la librairie
421########################################################################
422
423\rm tmp ; touch tmp
424\rm tmp90 ; touch tmp90
425foreach i ( $optim90 )
426   echo $i | sed -e 's/\"//g' -e "s/\'//g" -e 's/-//g' -e 's/://g' -e 's/=//g' -e 's/%//g' >> tmp
427end
428set suf=
429foreach i ( `sort tmp | uniq ` )
430   set suf=$suf$i
431end
432if ( ! $IBM ) then
433   set nomlib="$nomlib$suf"
434endif
435if ( $DEC ) then
436   set nomlib=DEC
437endif
438
439# dimension
440
441echo "dimension avant sed $dim"
442if ( $IBM ) then
443   set dim=`echo $dim | sed -en 's/[^0-9]/ /g'`
444   set dim_=`echo $dim | sed -en 's/[^0-9]/_/g'`
445else if ( $SUN || $XNEC ) then
446   set dim=`echo $dim | sed -e 's/[^0-9]/ /g'` 
447   set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'`
448else
449#   set dim=`echo $dim | sed -n -e 's/[^0-9]/ /gp'`
450#   set dim_=`echo $dim | sed -n -e 's/[^0-9]/_/gp'`
451     set dim=`echo $dim | sed -e 's/[^0-9]/ /g'`
452     set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'`
453endif
454
455# build final name of libraries directory:
456if ( "$dyntype" == "olddyn" ) then
457  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}_olddyn
458else
459  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}
460endif
461
462# Append 'physique' type, if it is not mars, to nomlib
463if ( "$physique" != "mars" ) then
464  set nomlib=${nomlib}_${physique}
465endif
466
467## M-A-F nomlib trop long sur CRAY pour ar
468if ( $CRAY ) then
469    set nomlib=F90_${dim_}_t${ntrac}
470endif
471if ( $NEC || $XNEC ) then
472    set nomlib=F90_${dim_}_t${ntrac}
473endif
474
475echo "calcul de la dimension"
476set dimc=`echo $dim | wc -w`
477
478if ( "$dimc" == "2" ) then
479  set include="$include "'-I$(LIBF)/dyn2d '
480  set dimh=$dim
481else
482  if ( "$dyntype" == "olddyn" ) then
483    set include="$include "'-I$(LIBF)/olddyn3d '
484  else
485    set include="$include "'-I$(LIBF)/dyn3d '
486  endif
487  set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
488endif
489echo "dimc is $dimc"
490
491########################################################################
492# path pour les #include
493########################################################################
494
495set include="$include -I$NCDFINC "
496echo $include
497
498########################################################################
499# Gestion des dimensions du modele.
500# on cree ou remplace le fichier des dimensions/nombre de traceur
501########################################################################
502
503cd $libf/grid
504if ( -f dimensions.h ) then
505  echo "WARNING: you are probably already compiling the model (perhaps"
506  echo " elsewhere). Wait until the first compilation ends before "
507  echo " compiling a different configuration."
508  echo "If you are sure that you are not already compiling, then you"
509  echo " may continue this compilation by answering yes."
510  echo "Do you want to continue?"
511  if ( $< == "yes" ) then
512    #remove old dimensions.h file
513    \rm -f $libf/grid/dimensions.h
514    #remove old scatterers.h file
515    \rm -f $libf/phymars/scatterers.h
516  else
517    exit
518  endif
519endif
520
521# Build the appropriate 'dimensions.h' file
522cd dimension
523./makdim $ntrac $dim
524# echo contents of dimensions.h to standard output
525cat $libf/grid/dimensions.h
526
527cd $libf/phymars/scatterers
528# Build the appropriate 'scatterers.h' file
529./make_scatterers $scatterers
530# echo contents of scatterers.h to standard output
531cat $libf/phymars/scatterers.h
532
533cd $LMDGCM
534# set path to objects directory
535set libo=$libo/$nomlib
536# create objects directory, if it doesn't exist
537if ( ! -d $libo )  then
538   mkdir $libo
539   cd $model
540endif
541
542########################################################################
543# Differentes dynamiques (3d, 2d, 1d)
544########################################################################
545
546set dimension=`echo $dim | wc -w`
547echo dimension $dimension dim $dim
548if ( $dimension == 1 ) then
549  echo pas de dynamique
550  set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
551endif
552endif
553
554cd $model
555if ( $dimension == 3 ) then
556  cd libf/grid
557  \rm fxyprim.h
558  cp -p fxy_${grille}.h fxyprim.h
559endif
560
561######################################################################
562#   Traitement special pour le nouveau rayonnement de Laurent Li.
563######################################################################
564
565if ( -f $libf/phy$physique/raddim.h ) then
566  if ( -f $libf/phy$physique/raddim.$dimh.h ) then
567    \rm $libf/phy$physique/raddim.h
568    cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h
569    echo $libf/phy$physique/raddim.$dimh.h
570    cat $libf/phy$physique/raddim.$dimh.h
571    cat $libf/phy$physique/raddim.h
572  else
573    echo On peut diminuer la taille de l executable en creant
574    echo le fichier $libf/phy$physique/raddim.$dimh.h
575    \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h
576  endif
577endif
578
579######################################################################
580# Gestion du filtre qui n'existe qu'en 3d.
581######################################################################
582
583# set filtre to 'oldfiltrez' if using -olddyn option
584if ( "$dyntype" == "olddyn" ) then
585  set filtre="oldfiltrez"
586endif
587
588if ( `expr $dimc \> 2` == 1 ) then
589   set filtre="FILTRE=$filtre"
590else
591   set filtre="FILTRE= L_FILTRE= "
592endif
593echo "MACRO FILTRE $filtre"
594
595echo "dimc $dimc"
596
597########################################################################
598#  Avant de lancer le make, on recree le makefile si necessaire
599########################################################################
600# c'est a dire dans 3 cas:
601# 1. si la liste des fichiers .F et .h a ete modifiee depuis la
602#    derniere creation du makefile
603# 2. si le fichier contenant cette liste "liste_des_sources"
604#    n'existe pas.
605# 3. Si le makefile n'existe pas.
606########################################################################
607
608cd $model
609find libf -name '*.[Fh]' -print >! tmp77
610#find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print >! tmp90
611find libf -name '*.[Fh]90' -print >> tmp90
612
613if (    `diff tmp77 liste_des_sources_f77 | wc -w` \
614     || `diff tmp90 liste_des_sources_f90 | wc -w` \
615     || ! -f makefile \
616     || ! -f liste_des_sources_f90 \
617     || ! -f liste_des_sources_f77 ) then
618        echo "les fichiers suivants ont ete crees ou detruits"
619        echo "ou les fichiers suivants sont passes ou ne sont plus en Fortran 90"
620        diff liste_des_sources_f77 tmp77
621        diff liste_des_sources_f90 tmp90
622        \cp tmp77 liste_des_sources_f77
623        \cp tmp90 liste_des_sources_f90
624        echo "On recree le makefile"
625        if ("$dyntype" == "olddyn") then
626          ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp
627        else
628          ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp
629        endif
630        \mv tmp makefile
631        echo "Nouveau makefile cree."
632endif
633
634########################################################################
635#  Execution de la comande make
636########################################################################
637
638echo PHYSIQUE $phys
639echo dynamique $dyn $dimension
640echo OPTIM90="$optim90" $filtre LIBO=$libo $dyn PHYS=$phys DIM=$dimc PROG=$code
641echo PATH pour les fichiers INCLUDE $include
642echo OPLINK="$oplink"
643
644if $HP then
645   set f77='fort77 +OP'
646   set f90='jensaisrien'
647   set opt_link="$opt_link -lm"
648else  if $VPP then
649   set f77=frt
650   set f90=$f77
651else if $CRAY then
652   set f77=f90
653   set f90=f90
654else if $LINUX then
655   set f77=ifort
656   set f90=ifort
657   set opt_link=" -L$LIBOGCM -L$NCDFLIB -lnetcdf "
658else if $SUN then
659   set f77=f90
660   set f90=f90
661else if $NEC then
662   set f77=f90
663   set f90=f90
664else if $XNEC then
665   set f77=sxmpif90
666   set f90=sxmpif90
667else
668   set f77=f77
669   set f90=f90
670endif
671
672cd $model
673
674if $VPP then
675  set make="gmake RANLIB=ls"
676else if $CRAY then
677  set make="make RANLIB=ls"
678else if $NEC then
679  set make="make RANLIB=ls"
680else if $LINUX then
681  set make="make -k RANLIB=ranlib"
682else if $XNEC then
683  set make="/usr/local/bin/gmake RANLIB=ls"
684  set make="/usr/freeware/bin/gmake RANLIB=ls"
685else
686  set make="make RANLIB=ranlib"
687endif
688
689set include="$include"" -I$libf/phy$physique"
690
691
692#################################################################
693# Execution de la comande make... ENFIN!
694#################################################################
695
696if $VPP then
697  set optim90=" $optim90 -Am -M$libo"
698  set optimtru90="$optim90"
699else if $SUN then
700 set optim90=" $optim90 -M$libo"
701 set optimtru90=" $optimtru90 "
702else if $NEC then
703 set optim90=" $optim90 -I$libo "
704else if $XNEC then
705 set optim90=" $optim90 -I$libo "
706 set optimtru90=" $optimtru90 -I$libo "
707else if $LINUX then
708# Ehouarn : adapt to gfortran
709 set optim="$optim -I${libo}"
710 set optim90="$optim90 -I${libo}"
711 set optimtru90="$optimtru90 -ffree-form -I${libo}"
712# Ehouarn: remove set mod_loc_dir def below; mod_loc_dir=$localdir (set above)
713# set mod_loc_dir=$libo
714endif
715
716set link="$f90 $optim90"
717
718set ar=ar
719
720if $XNEC then
721  set link="sxld $opt_link"
722  set link="$f90 "
723#  set ar=sxar
724endif
725
726
727cd $localdir
728
729echo $make -f $LMDGCM/makefile \
730OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
731OPTIM="$optim" \
732OPTIM90="$optim90" \
733OPTIMTRU90="$optimtru90" \
734INCLUDE="$include" \
735$filtre \
736LIBO=$libo \
737$dyn \
738$phys \
739DIM=$dimc \
740DYNTYPE="$dyntype" \
741L_ADJNT="$adjnt" \
742LOCAL_DIR="$localdir"  \
743F77="$f77" \
744F90="$f90" \
745OPLINK="$oplink" \
746LINK="$link" \
747GCM="$LMDGCM" \
748MOD_LOC_DIR=$mod_loc_dir \
749MOD_SUFFIX=$mod_suffix \
750AR=$ar \
751PROG=$code
752
753
754$make -f $LMDGCM/makefile \
755OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
756OPTIM="$optim" \
757OPTIM90="$optim90" \
758OPTIMTRU90="$optimtru90" \
759INCLUDE="$include" \
760$filtre \
761LIBO=$libo \
762$dyn \
763$phys \
764DIM=$dimc \
765DYNTYPE="$dyntype" \
766L_ADJNT="$adjnt" \
767LOCAL_DIR="$localdir"  \
768F77="$f77" \
769F90="$f90" \
770OPLINK="$oplink" \
771LINK="$link" \
772GCM="$LMDGCM" \
773MOD_LOC_DIR=$mod_loc_dir \
774MOD_SUFFIX=$mod_suffix \
775AR=$ar \
776PROG=$code
777
778# cleanup, remove dimensions.h and scatterers.h
779\rm -f $libf/grid/dimensions.h
780\rm -f $libf/phymars/scatterers.h
Note: See TracBrowser for help on using the repository browser.