source: trunk/LMDZ.MARS/makegcm_ifort @ 164

Last change on this file since 164 was 164, checked in by emillour, 14 years ago

Mars GCM:

Updates and corrections (to enable compiling/running in debug mode with

ifort)

  • removed option "-free-form" from makegcm_ifort and set mod_loc_dir="." so that module files (produced in local directory by ifort) are moved to LIBO
  • updated initracer.F, physdem1.F, physiq.F, inichim_newstart.F to avoid referencing out-of-bound array indexes (even if unused)
  • cosmetic updates on inwrite.F, datareadnc.F
  • updated newstart.F to initialize and use 'datadir' when looking for files
  • corrected bug on interpolation of sub-surface temperatures in lect_start_archive.F

EM

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