source: trunk/LMDZ.GENERIC/makegcm_ifort @ 731

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