source: trunk/LMDZ.GENERIC/makegcm_ifort @ 1181

Last change on this file since 1181 was 988, checked in by emillour, 11 years ago

Generic GCM:

  • Moved "newstart" (and related "lect_start_archive.F") to phystd directory
  • Adapted makegcm_* scripts to enable compiling main prog from physics
  • Added in newstart the possibility to not read in any surface.nc file (when loading a start_archive) with keyword "none" (instead of surface file name)
  • Some general cleanup:
    • in bibio: removed unused lmdstd.h readstd.F writestd.F mywrite.F

readcoord.F scatter.F gather.F ini36.F from36.F to36.F
lnblnk.F (F90 len_trim() should be used instead)

  • in dyn3d: removed unused inigrads.F wrgrads.F gradsdef.h

xvik.F (specific to current Mars)

EM

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