source: trunk/LMDZ.GENERIC/makegcm_ifort @ 889

Last change on this file since 889 was 889, checked in by emillour, 12 years ago

Mars and Generic model:

  • added "-fp-model precise" option when compiling with ifort, which fixes issues with tracer mass conservation in the dynamics (NB: these occur namely when running in single precision; double precision computations seem OK without this option).

EM

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