source: trunk/LMDZ.GENERIC/makegcm_g95 @ 906

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