source: trunk/LMDZ.GENERIC/makegcm_ifort @ 859

Last change on this file since 859 was 848, checked in by aslmd, 12 years ago

LMDZ.GENERIC. Corrected makegcm_ifort to cope with ciclad and gnome specifities. Corrected an out-of-bounds in calc_rayleigh when using too few spectral bands. Also some files have been moved to LMDZ.UNIVERSAL hence are now deleted from LMDZ.GENERIC.

  • 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
33endif
34# NetCDF, on LMD farm:
35#setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_ifort/lib
36#setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_ifort/include
37####
38
39setenv localdir "`pwd`"
40set MODIPSL=0
41echo $localdir | grep modipsl >& /dev/null
42if ( ! $status ) then
43  set MODIPSL=1
44  setenv LMDGCM $localdir
45  cd ../..
46  setenv LIBOGCM "`pwd`/lib"
47  cd $localdir
48  if ( `hostname` == rhodes ) then
49    set NCDFINC=`grep sxnec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
50    set NCDFLIB=`grep sxnec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
51  else
52    if ( `hostname` == nymphea0 ) then
53      set NCDFINC=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
54      set NCDFLIB=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
55    else
56      echo 'Probleme de definition des variables NCDFINC et NCDFLIB'
57    endif
58  endif
59else
60  if ( ! $?LMDGCM ) then
61    echo You must initialize the variable LMDGCM in your environnement
62    echo for instance: "setenv LMDGCM /usr/myself/supergcm" in .cshrc
63    exit
64  endif
65  if ( ! $?LIBOGCM ) then
66    set LIBOGCM=$LMDGCM/libo
67  endif
68  if ( ! $?NCDFLIB ) then
69    echo You must initialize the variable NCDFLIB in your environnement
70    echo for instance: "setenv NCDFLIB /usr/myself/netcdf" in .cshrc
71    exit
72  endif
73  if ( ! $?NCDFINC ) then
74    echo You must initialize the variable NCDFINC in your environnement
75    echo for instance: "setenv NCDFINC /usr/myself/netcdf" in .cshrc
76    exit
77  endif
78endif
79set model=$LMDGCM
80set libo=$LIBOGCM
81
82########################################################################
83#  Les differentes platformes reconnues
84########################################################################
85
86set HP=0
87set IBM=0
88set SUN=0
89set VPP=0
90set CRAY=0
91set DEC=0
92set LINUX=0
93set NEC=0
94set XNEC=0
95if ( `uname` == HP-UX ) then
96   set machine=HP
97   set HP=1
98else if (`uname` == UNIX_System_V ) then
99   set machine=VPP
100   set VPP=1
101else if (`uname` == SunOS ) then
102   set machine=SUN
103   set SUN=1
104else if ( `uname` == AIX ) then
105   set machine=IBM
106   set IBM=1
107else if ( `uname` == OSF1 ) then
108   set machine=ALPHA
109   set DEC=1
110else if ( `uname` == Linux ) then
111   set machine=LINUX
112   set LINUX=1
113else if ( `hostname` == atlas || `hostname` == axis  || `hostname` == etoile ) then
114   set machine=CRAY
115   set CRAY=1
116else if ( `uname` == SUPER-UX ) then
117   set machine=NEC
118   set NEC=1
119else if ( `hostname` == rhodes) then
120   set machine=XNEC
121   set XNEC=1
122else
123   echo Vous travaillez sur une machine non prevue par le reglement
124   exit
125endif
126
127# create $libo directory if it doesn't exist
128if ( ! -d $libo )  then
129   mkdir $libo
130endif
131
132if $VPP then
133set netcdf=netcdf_v
134else
135set netcdf=netcdf
136endif
137########################################################################
138#  Quelques initialisations de variables du shell.
139########################################################################
140
141set dyn=
142set opt_link=""
143set adjnt=""
144set opt_dep=""
145
146set optim90=""
147set oplink=""
148
149########################################################################
150#  Optimisations par defaut suivant les machines
151########################################################################
152
153echo "Optimisations par defaut suivant les machines"
154set libf=$model/libf
155#setenv localdir "LOCAL_DIR=`pwd`"
156#setenv localdir "`pwd`"
157cd $model
158if $CRAY then
159   set optim90="-Wp'-P' -DCRAY "'-p$(LIBO) -eiv '
160   set oplink="-Wl'-DSTACK=128 -f indef' -L$NCDFLIB -lnetcdf "
161   set mod_loc_dir=" "
162   set mod_suffix=" "
163else if $SUN then
164   set optim90=" -fast"
165   set optimtru90=" -fast -free"
166   set opt_link="-L$NCDFLIB -lnetcdf"
167   set mod_loc_dir=$localdir
168   set mod_suffix=mod
169else if $HP then
170else if $IBM then
171else if $VPP then
172   set optim90="$optim -X9 -w"
173   if $COUPLE then
174     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"
175     set oplink="-Wl,-t,-P,-dy "
176   else
177     set opt_link="-Wg,-c /usr/local/lib/lib64/libnetcdf_cc.a -L$IOIPSLDIR -lioipsl"
178     set oplink="-Wl,-t,-dy "
179   endif
180   set mod_loc_dir=$IOIPSLDIR
181   set mod_suffix=mod
182else if $DEC then
183else if $LINUX then
184   #NB: on gnome -O3 ==> NaNs ...
185   set optim=" -O2 -ip -mkl=sequential -align all -static "
186   set optim90=" -O2 -ip -mkl=sequential -align all -static "
187   set optimtru90=" -O2 -ip -mkl=sequential -align all -static "
188   if ( `hostname` == ciclad1.ipsl.jussieu.fr ) then
189       echo "YOU ARE ON CICLAD CLUSTER"
190       set opt_link=" -L$NCDFLIB -lnetcdf"  # this is necessary on ciclad
191   endif
192   set mod_loc_dir=$LIBOGCM
193   set mod_suffix=mod
194else if $NEC then
195   set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
196   set optimtru90=' -clear -f4 -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
197###   set opt_link=" -C hopt -float0 -ew -P static -L$IOIPSLDIR -lioipsl  -L/u/rech/psl/rpsl003/IOIPSL -lnetcdf_i8r8_v "
198   set opt_link=" -C hopt -float0 -ew -P static -L/SX/usr/local/lib  -lnetcdf_i8r8 "
199   set mod_loc_dir="."
200   set mod_suffix="mod"
201else if $XNEC then
202   set optim90=' -clear -R5 -C vopt -float0 -ew -P static -Wf,"-pvctl loopcnt=40000 fullmsg noassume "'
203   set optimtru90=' -clear -R5 -f4 -C vopt -float0 -ew -P static -Wf,"-pvctl loopcnt=40000 fullmsg noassume "'
204   if $MODIPSL then
205     if $COUPLE then
206       set opt_link="-L$IOIPSLDIR -lsxioipsl -loasis2.4_mpi2 -float0 -ew -P static -I$NCDFINC $NCDFLIB "
207     else
208       set opt_link="-L$IOIPSLDIR -lsxioipsl -float0 -ew -P static -I$NCDFINC $NCDFLIB "
209     endif
210     set mod_loc_dir="./"
211   else
212####     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"
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
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
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           set optim=" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
388           set optim90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
389           set optimtru90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
390        else
391           echo "pas d option debug predefinie pour cette machine"
392           exit
393        endif
394        shift ; goto top
395
396     default
397        set code="$1" ; shift ; goto top
398
399   endsw
400endif
401
402
403echo "apres les opts dim $dim"
404
405########################################################################
406# cas special sans physique
407########################################################################
408if ( "$physique" == 'nophys' ) then
409   set phys="L_PHY= LIBPHY="
410endif
411
412########################################################################
413#subtilites sur le nom de la librairie
414########################################################################
415
416
417\rm tmp ; touch tmp
418\rm tmp90 ; touch tmp90
419foreach i ( $optim90 )
420   echo $i | sed -e 's/\"//g' -e "s/\'//g" -e 's/-//g' -e 's/://g' -e 's/=//g' -e 's/%//g' >> tmp
421end
422set suf=
423foreach i ( `sort tmp | uniq ` )
424   set suf=$suf$i
425end
426if ( ! $IBM ) then
427   set nomlib="$nomlib$suf"
428endif
429if ( $DEC ) then
430   set nomlib=DEC
431endif
432
433# dimension
434echo "dimension avant sed $dim"
435if ( $IBM ) then
436   set dim=`echo $dim | sed -en 's/[^0-9]/ /g'`
437   set dim_=`echo $dim | sed -en 's/[^0-9]/_/g'`
438else if ( $SUN || $XNEC ) then
439   set dim=`echo $dim | sed -e 's/[^0-9]/ /g'` 
440   set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'`
441else
442     set dim=`echo $dim | sed -e 's/[^0-9]/ /g'`
443     set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'`
444endif
445
446# bands
447echo "bands avant sed $bands"
448if ( $IBM ) then
449   set bands=`echo $bands | sed -en 's/[^0-9]/ /g'`
450   set bands_=`echo $bands | sed -en 's/[^0-9]/_/g'`
451else if ( $SUN || $XNEC ) then
452   set bands=`echo $bands | sed -e 's/[^0-9]/ /g'` 
453   set bands_=`echo $bands | sed -e 's/[^0-9]/_/g'`
454else
455     set bands=`echo $bands | sed -e 's/[^0-9]/ /g'`
456     set bands_=`echo $bands | sed -e 's/[^0-9]/_/g'`
457endif
458
459
460# build final name of libraries directory:
461if ( "$dyntype" == "olddyn" ) then
462  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}_olddyn
463else
464  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}
465endif
466
467# Append number of bands to nomlib (new for universal model)
468set nomlib=${nomlib}_${bands_}
469
470# Append 'physique' type, if it is not mars, to nomlib
471if ( "$physique" != "mars" ) then
472  set nomlib=${nomlib}_${physique}
473endif
474
475## M-A-F nomlib trop long sur CRAY pour ar
476if ( $CRAY ) then
477    set nomlib=F90_${dim_}_t${ntrac}
478endif
479if ( $NEC || $XNEC ) then
480    set nomlib=F90_${dim_}_t${ntrac}
481endif
482
483echo "calcul de la dimension"
484set dimc=`echo $dim | wc -w`
485
486if ( "$dimc" == "2" ) then
487  set include="$include "'-I$(LIBF)/dyn2d '
488  set dimh=$dim
489else
490  if ( "$dyntype" == "olddyn" ) then
491    set include="$include "'-I$(LIBF)/olddyn3d '
492  else
493    set include="$include "'-I$(LIBF)/dyn3d '
494  endif
495  set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
496endif
497echo "dimc is $dimc"
498
499########################################################################
500# path pour les #include
501########################################################################
502
503set include="$include -I$NCDFINC "
504echo $include
505
506########################################################################
507# Gestion des dimensions du modele.
508# on cree ou remplace le fichier des dimensions/nombre de traceur
509########################################################################
510
511cd $libf/grid
512if ( -f dimensions.h ) then
513  echo "WARNING: you are already compiling the model somewhere else"
514  echo "Wait until the first compilation is finished before starting."
515  echo "If you are sure that you are not compiling elsewhere, you can"
516  echo "type [yes] to continue."
517  echo "Do you want to continue?"
518  if ( $< == "yes" ) then
519    #remove old dimensions.h , bands.h and scatterers.h files
520    \rm -f $libf/grid/dimensions.h
521    \rm -f $libf/grid/bands.h
522    \rm -f $libf/phy${physique}/scatterers.h
523  else
524    exit
525  endif
526endif
527
528# Build the appropriate 'dimensions.h' file
529cd dimension
530makdim $ntrac $dim
531# echo contents of dimensions.h to standard output
532cat $libf/grid/dimensions.h
533
534# Build the appropriate 'bands.h' file
535makbands $bands
536# echo contents of bands.h to standard output
537cat $libf/grid/bands.h
538
539# Build the appropriate 'scatterers.h' file
540cd $libf/phy$physique/scatterers
541./make_scatterers $scatterers
542# echo contents of scatterers.h to standard output
543cat $libf/phy$physique/scatterers.h
544
545cd $LMDGCM
546# set path to objects directory
547set libo=$libo/$nomlib
548# create objects directory, if it doesn't exist
549if ( ! -d $libo )  then
550   mkdir $libo
551   cd $model
552endif
553
554########################################################################
555# Differentes dynamiques (3d, 2d, 1d)
556########################################################################
557
558set dimension=`echo $dim | wc -w`
559echo dimension $dimension dim $dim
560if ( $dimension == 1 ) then
561  echo pas de dynamique
562  set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
563endif
564endif
565
566cd $model
567if ( $dimension == 3 ) then
568  cd libf/grid
569  \rm fxyprim.h
570  cp -p fxy_${grille}.h fxyprim.h
571endif
572
573######################################################################
574# Gestion du filtre qui n'existe qu'en 3d.
575######################################################################
576
577# set filtre to 'oldfiltrez' if using -olddyn option
578if ( "$dyntype" == "olddyn" ) then
579  set filtre="oldfiltrez"
580endif
581
582if ( `expr $dimc \> 2` == 1 ) then
583   set filtre="FILTRE=$filtre"
584else
585   set filtre="FILTRE= L_FILTRE= "
586endif
587echo "MACRO FILTRE $filtre"
588
589echo "dimc $dimc"
590
591########################################################################
592#  Avant de lancer le make, on recree le makefile si necessaire
593########################################################################
594# c'est a dire dans 3 cas:
595# 1. si la liste des fichiers .F et .h a ete modifiee depuis la
596#    derniere creation du makefile
597# 2. si le fichier contenant cette liste "liste_des_sources"
598#    n'existe pas.
599# 3. Si le makefile n'existe pas.
600########################################################################
601
602cd $model
603find libf -name '*.[Fh]' -print | sort >! tmp77
604#find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print >! tmp90
605find libf -name '*.[Fh]90' -print | sort >> tmp90
606
607if (    `diff tmp77 liste_des_sources_f77 | wc -w` \
608     || `diff tmp90 liste_des_sources_f90 | wc -w` \
609     || ! -f makefile \
610     || ! -f liste_des_sources_f90 \
611     || ! -f liste_des_sources_f77 ) then
612        echo "les fichiers suivants ont ete crees ou detruits"
613        echo "ou les fichiers suivants sont passes ou ne sont plus en Fortran 90"
614        diff liste_des_sources_f77 tmp77
615        diff liste_des_sources_f90 tmp90
616        \cp tmp77 liste_des_sources_f77
617        \cp tmp90 liste_des_sources_f90
618        echo "Remaking the makefile!"
619        if ("$dyntype" == "olddyn") then
620          ./create_make_gcm olddyn3d grid bibio phy$physique >! tmp
621        else
622          ./create_make_gcm dyn3d grid bibio phy$physique >! tmp
623        endif
624        \mv tmp makefile
625        echo "New makefile created."
626endif
627
628########################################################################
629#  Execution de la comande make
630########################################################################
631
632
633echo PHYSIQUE $phys
634echo dynamique $dyn $dimension
635echo OPTIM90="$optim90" $filtre LIBO=$libo $dyn PHYS=$phys DIM=$dimc PROG=$code
636echo PATH pour les fichiers INCLUDE $include
637echo OPLINK="$oplink"
638
639if $HP then
640   set f77='fort77 +OP'
641   set f90='jensaisrien'
642   set opt_link="$opt_link -lm"
643else  if $VPP then
644   set f77=frt
645   set f90=$f77
646else if $CRAY then
647   set f77=f90
648   set f90=f90
649else if $LINUX then
650   set f77=ifort
651   set f90=ifort
652   set opt_link=" -L$LIBOGCM -L$NCDFLIB -lnetcdf "
653#   set f77=pgf90
654#   set f90=pgf90
655else if $SUN then
656   set f77=f90
657   set f90=f90
658else if $NEC then
659   set f77=f90
660   set f90=f90
661else if $XNEC then
662   set f77=sxmpif90
663   set f90=sxmpif90
664else
665   set f77=f77
666   set f90=f90
667endif
668
669cd $model
670
671if $VPP then
672  set make="gmake RANLIB=ls"
673else if $CRAY then
674  set make="make RANLIB=ls"
675else if $NEC then
676  set make="make RANLIB=ls"
677else if $LINUX then
678  set make="make -k RANLIB=ranlib"
679else if $XNEC then
680  set make="/usr/local/bin/gmake RANLIB=ls"
681  set make="/usr/freeware/bin/gmake RANLIB=ls"
682else
683  set make="make RANLIB=ranlib"
684endif
685
686#
687# etat0_netcdf a besoin d'info de la physique
688# A revoir
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 set optim="$optim -module $libo"
709 set optim90="$optim90 -module $libo"
710 set optimtru90="$optimtru90 -module $libo"
711# Ehouarn: remove set mod_loc_dir def below; mod_loc_dir=$localdir (set above)
712# set mod_loc_dir=$libo
713endif
714
715set link="$f90 $optim90"
716
717set ar=ar
718
719if $XNEC then
720  set link="sxld $opt_link"
721  set link="$f90 "
722#  set ar=sxar
723endif
724
725cd $localdir
726
727set source_code=${code}.F
728if (-f $LMDGCM/libf/phystd/${code}.F90) then
729  set source_code=${code}.F90
730endif
731
732echo $make -f $LMDGCM/makefile \
733OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
734OPTIM="$optim" \
735OPTIM90="$optim90" \
736OPTIMTRU90="$optimtru90" \
737INCLUDE="$include" \
738$filtre \
739LIBO=$libo \
740$dyn \
741$phys \
742DIM=$dimc \
743DYNTYPE="$dyntype" \
744L_ADJNT="$adjnt" \
745LOCAL_DIR="$localdir"  \
746F77="$f77" \
747F90="$f90" \
748OPLINK="$oplink" \
749LINK="$link" \
750GCM="$LMDGCM" \
751MOD_LOC_DIR=$mod_loc_dir \
752MOD_SUFFIX=$mod_suffix \
753AR=$ar \
754SOURCE=$source_code \
755PROG=$code
756
757$make -f $LMDGCM/makefile \
758OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
759OPTIM="$optim" \
760OPTIM90="$optim90" \
761OPTIMTRU90="$optimtru90" \
762INCLUDE="$include" \
763$filtre \
764LIBO=$libo \
765$dyn \
766$phys \
767DIM=$dimc \
768DYNTYPE="$dyntype" \
769L_ADJNT="$adjnt" \
770LOCAL_DIR="$localdir"  \
771F77="$f77" \
772F90="$f90" \
773OPLINK="$oplink" \
774LINK="$link" \
775GCM="$LMDGCM" \
776MOD_LOC_DIR=$mod_loc_dir \
777MOD_SUFFIX=$mod_suffix \
778AR=$ar \
779SOURCE=$source_code \
780PROG=$code
781
782\rm -f $libf/grid/dimensions.h
783\rm -f $libf/grid/bands.h
784\rm -f $libf/phy$physique/scatterers.h
Note: See TracBrowser for help on using the repository browser.