source: trunk/LMDZ.GENERIC/makegcm_gfortran @ 937

Last change on this file since 937 was 671, checked in by emillour, 13 years ago

Generic GCM:

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

EM

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