source: trunk/LMDZ.GENERIC/makegcm_pgf90 @ 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.7 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 64 bit machines
29setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib
30setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/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
117   echo Vous travaillez sur une machine non prevue par le reglement
118   exit
119endif
120
121# create $libo directory if it doesn't exist
122if ( ! -d $libo )  then
123   mkdir $libo
124endif
125
126if $VPP then
127set netcdf=netcdf_v
128else
129set netcdf=netcdf
130endif
131########################################################################
132#  Quelques initialisations de variables du shell.
133########################################################################
134
135set dyn=
136set opt_link=""
137set adjnt=""
138set opt_dep=""
139
140set optim90=""
141set oplink=""
142
143########################################################################
144#  Optimisations par defaut suivant les machines
145########################################################################
146
147echo "Optimisations par defaut suivant les machines"
148set libf=$model/libf
149#setenv localdir "LOCAL_DIR=`pwd`"
150#setenv localdir "`pwd`"
151cd $model
152if $CRAY then
153   set optim90="-Wp'-P' -DCRAY "'-p$(LIBO) -eiv '
154   set oplink="-Wl'-DSTACK=128 -f indef' -L$NCDFLIB -lnetcdf "
155   set mod_loc_dir=" "
156   set mod_suffix=" "
157else if $SUN then
158   set optim90=" -fast"
159   set optimtru90=" -fast -free"
160   set opt_link="-L$NCDFLIB -lnetcdf"
161   set mod_loc_dir=$localdir
162   set mod_suffix=mod
163else if $HP then
164else if $IBM then
165else if $VPP then
166   set optim90="$optim -X9 -w"
167   if $COUPLE then
168     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"
169     set oplink="-Wl,-t,-P,-dy "
170   else
171     set opt_link="-Wg,-c /usr/local/lib/lib64/libnetcdf_cc.a -L$IOIPSLDIR -lioipsl"
172     set oplink="-Wl,-t,-dy "
173   endif
174   set mod_loc_dir=$IOIPSLDIR
175   set mod_suffix=mod
176else if $DEC then
177else if $LINUX then
178   set optim=" -O2 -Munroll -Mcache_align "
179   set optim90=" -O2 -Munroll -Mcache_align "
180   set optimtru90=" -O2 -Munroll -Mcache_align "
181   set opt_link=" -L$NCDFLIB -lnetcdf"
182   set mod_loc_dir=$localdir
183   set mod_suffix=mod
184# Ehouarn 'ifort' compiler
185#   #NB: on gnome -O3 ==> NaNs ...
186#   set optim=" -O2 -ip -mkl=sequential -align common "
187#   set optim90=" -O2 -ip -mkl=sequential -align common "
188#   set optimtru90=" -O2 -ip -mkl=sequential -align common "
189#   set mod_loc_dir=$LIBOGCM
190#   set mod_suffix=mod
191else if $NEC then
192   set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
193   set optimtru90=' -clear -f4 -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
194###   set opt_link=" -C hopt -float0 -ew -P static -L$IOIPSLDIR -lioipsl  -L/u/rech/psl/rpsl003/IOIPSL -lnetcdf_i8r8_v "
195   set opt_link=" -C hopt -float0 -ew -P static -L/SX/usr/local/lib  -lnetcdf_i8r8 "
196   set mod_loc_dir="."
197   set mod_suffix="mod"
198else if $XNEC then
199   set optim90=' -clear -R5 -C vopt -float0 -ew -P static -Wf,"-pvctl loopcnt=40000 fullmsg noassume "'
200   set optimtru90=' -clear -R5 -f4 -C vopt -float0 -ew -P static -Wf,"-pvctl loopcnt=40000 fullmsg noassume "'
201   if $MODIPSL then
202     if $COUPLE then
203       set opt_link="-L$IOIPSLDIR -lsxioipsl -loasis2.4_mpi2 -float0 -ew -P static -I$NCDFINC $NCDFLIB "
204     else
205       set opt_link="-L$IOIPSLDIR -lsxioipsl -float0 -ew -P static -I$NCDFINC $NCDFLIB "
206     endif
207     set mod_loc_dir="./"
208   else
209####     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"
210     set opt_link=" -C hopt -float0 -ew -P static -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"
211     set mod_loc_dir="."
212   endif
213   set mod_suffix="mod"
214
215endif
216
217set nomlib=$machine
218
219# Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64)
220if (`uname` == Linux && `uname -m` == "x86_64") then
221  set nomlib=${machine}64
222endif
223
224########################################################################
225# lecture des options de mymake
226########################################################################
227
228top:
229if ($#argv > 0) then
230    switch ($1:q)
231
232    case -h:
233
234########################################################################
235# Manuel en ligne
236########################################################################
237more <<eod
238
239
240makegcm [Options] prog
241
242
243The makegcm script:
244-------------------
245
2461. compiles a series of subroutines located in the $LMDGCM/libf
247 sub-directories.
248 The objects are then stored in the libraries in $LIBOGCM.
249
2502. then, makegcm compiles program prog.f located by default in
251$LMDGCM/libf/dyn3d and makes the link with the libraries.
252
253Environment Variables '$LMDGCM' and '$LIBOGCM'
254 must be set as environment variables or directly
255 in the makegcm file.
256
257The makegcm command is used to control the different versions of the model
258 in parallel, compiled using the compilation options
259 and the various dimensions, without having to recompile the whole model.
260
261The FORTRAN libraries are stored in directory $LIBOGCM.
262
263
264OPTIONS:
265--------
266
267The following options can either be defined by default by editing the
268makegcm "script", or in interactive mode:
269
270-d imxjmxlm  where im, jm, and lm are the number of longitudes,
271             latitudes and vertical layers respectively.
272
273-t ntrac   Selects the number of tracers present in the model
274
275             Options -d and -t overwrite file
276             $LMDGCM/libf/grid/dimensions.h
277             which contains the 3 dimensions of the
278             horizontal grid
279             im, jm, lm plus the number of tracers passively advected
280             by the dynamics ntrac,
281             in 4 PARAMETER FORTRAN format
282             with a new file:
283             $LMDGCM/libf/grid/dimension/dimensions.im.jm.lm.tntrac
284             If the file does not exist already
285             it is created by the script
286             $LMDGCM/libf/grid/dimension/makdim
287
288-s nscat   Number of radiatively active scatterers
289
290-p PHYS    Selects the set of physical parameterizations
291           you want to compile the model with.
292           The model is then compiled using the physical
293           parameterization sources in directory:
294            $LMDGCM/libf/phyPHYS
295
296-g grille  Selects the grid type.
297           This option overwrites file
298           $LMDGCM/libf/grid/fxyprim.h
299           with file
300           $LMDGCM/libf/grid/fxy_grille.h
301           the grid can take the following values:
302           1. reg - the regular grid
303           2. sin - to obtain equidistant points in terms of sin(latitude)
304           3. new - to zoom into a part of the globe
305
306-O "compilation options" set of fortran compilation options to use
307
308-include path
309           Used if the subroutines contain #include files (ccp) that
310           are located in directories that are not referenced by default.
311
312-adjnt     Compiles the adjoint model to the dynamical code.
313
314-olddyn    To compile GCM with "old dynamics"
315
316-filtre  filter
317           To select the longitudinal filter in the polar regions.
318           "filter" corresponds to the name of a directory located in
319           $LMDGCM/libf. The standard filter for the model is "filtrez"
320           which can be used for a regular grid and for a 
321           grid with longitudinal zoom.
322
323-link "-Ldir1 -lfile1 -Ldir2 -lfile2 ..."
324           Adds a link to FORTRAN libraries
325           libfile1.a, libfile2.a ...
326           located in directories dir1, dir2 ...respectively
327           If dirn is a directory with an automatic path
328           (/usr/lib ... for example)
329           there is no need to specify  -Ldirn.
330
331eod
332exit
333
334########################################################################
335# Lecture des differentes options
336########################################################################
337
338    case -d
339        set dim=$2 ; shift ; shift ; goto top
340                       
341    case -O:
342        set optim90="$2" ; set optim="$2" ; set optimtru90="$2" ; shift ; shift ; goto top
343
344     case -p
345        set physique="$2" ; set phys="PHYS=$physique" ; shift ; shift ; goto top
346
347     case -s
348        set scatterers="$2" ; shift ; goto top
349
350     case -g
351        set grille="$2" ; shift ; shift ; goto top
352
353    case -b
354        set bands=$2 ; shift ; shift ; goto top
355           
356     case -t
357        set ntrac=$2 ; shift ; shift ; goto top
358
359     case -include
360        set include="$include -I$2" ; shift ; shift ; goto top
361
362     case -adjnt
363        set opt_dep="$opt_dep adjnt" ; set adjnt="-ladjnt -ldyn3d "
364
365     case -olddyn
366        set dyntype="olddyn" ; shift; goto top
367
368     case -filtre
369        set filtre=$2 ; shift ; shift ; goto top
370
371     case -link
372        set opt_link="$opt_link $2" ; shift ; shift ; goto top
373
374     case -debug
375        if $HP then
376           set optim90=" -g "
377        else if $SUN then
378           setenv PARALLEL 4
379           set optim90=" -g -C "
380           set optimtru90=" -g -C "
381        else if $CRAY then
382           set optim90="$optim90"" -G1 "
383        else if $LINUX then
384           set optim="-g -Mbounds -Kieee -Ktrap=fp -traceback"
385           set optim90="-g -Mbounds -Kieee -Ktrap=fp -traceback"
386           set optimtru90="-g -Mbounds -Kieee -Ktrap=fp -traceback"
387#          set optim=" -g -no-ftz -traceback -ftrapuv -fp-stack-check "
388#           set optim90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check "
389#           set optimtru90=" -g -no-ftz -traceback -ftrapuv -fp-stack-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 -I${libo}"
709# set optim90="$optim90 -I${libo}"
710# set optimtru90="$optimtru90 -ffree-form -I${libo}"
711 set optim="$optim -module $libo"
712 set optim90="$optim90 -module $libo"
713 set optimtru90="$optimtru90 -module $libo"
714# Ehouarn: remove set mod_loc_dir def below; mod_loc_dir=$localdir (set above)
715# set mod_loc_dir=$libo
716endif
717
718set link="$f90 $optim90"
719
720set ar=ar
721
722if $XNEC then
723  set link="sxld $opt_link"
724  set link="$f90 "
725#  set ar=sxar
726endif
727
728
729cd $localdir
730
731set source_code=${code}.F
732if (-f $LMDGCM/libf/phystd/${code}.F90) then
733  set source_code=${code}.F90
734endif
735
736echo $make -f $LMDGCM/makefile \
737OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
738OPTIM="$optim" \
739OPTIM90="$optim90" \
740OPTIMTRU90="$optimtru90" \
741INCLUDE="$include" \
742$filtre \
743LIBO=$libo \
744$dyn \
745$phys \
746DIM=$dimc \
747DYNTYPE="$dyntype" \
748L_ADJNT="$adjnt" \
749LOCAL_DIR="$localdir"  \
750F77="$f77" \
751F90="$f90" \
752OPLINK="$oplink" \
753LINK="$link" \
754GCM="$LMDGCM" \
755MOD_LOC_DIR=$mod_loc_dir \
756MOD_SUFFIX=$mod_suffix \
757AR=$ar \
758SOURCE=$source_code \
759PROG=$code
760
761
762$make -f $LMDGCM/makefile \
763OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
764OPTIM="$optim" \
765OPTIM90="$optim90" \
766OPTIMTRU90="$optimtru90" \
767INCLUDE="$include" \
768$filtre \
769LIBO=$libo \
770$dyn \
771$phys \
772DIM=$dimc \
773DYNTYPE="$dyntype" \
774L_ADJNT="$adjnt" \
775LOCAL_DIR="$localdir"  \
776F77="$f77" \
777F90="$f90" \
778OPLINK="$oplink" \
779LINK="$link" \
780GCM="$LMDGCM" \
781MOD_LOC_DIR=$mod_loc_dir \
782MOD_SUFFIX=$mod_suffix \
783AR=$ar \
784SOURCE=$source_code \
785PROG=$code
786
787\rm -f $libf/grid/dimensions.h
788\rm -f $libf/grid/bands.h
789\rm -f $libf/phy$physique/scatterers.h
Note: See TracBrowser for help on using the repository browser.