source: trunk/LMDZ.GENERIC/makegcm_pgf90 @ 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.0 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}/bands.h
523    \rm -f $libf/phy${physique}/scatterers.h
524  else
525    exit
526  endif
527endif
528
529# Build the appropriate 'dimensions.h' file
530cd dimension
531./makdim $ntrac $dim
532# echo contents of dimensions.h to standard output
533cat $libf/grid/dimensions.h
534
535# Build the appropriate 'bands.h' file
536cd $libf/phy$physique/bands
537./makbands $bands
538# echo contents of bands.h to standard output
539cat $libf/phy$physique/bands.h
540
541# Build the appropriate 'scatterers.h' file
542cd $libf/phy$physique/scatterers
543./make_scatterers $scatterers
544# echo contents of scatterers.h to standard output
545cat $libf/phy$physique/scatterers.h
546
547cd $LMDGCM
548# set path to objects directory
549set libo=$libo/$nomlib
550# create objects directory, if it doesn't exist
551if ( ! -d $libo )  then
552   mkdir $libo
553   cd $model
554endif
555
556########################################################################
557# Differentes dynamiques (3d, 2d, 1d)
558########################################################################
559
560set dimension=`echo $dim | wc -w`
561echo dimension $dimension dim $dim
562if ( $dimension == 1 ) then
563  echo pas de dynamique
564  set dyn="L_DYN= DYN= L_FILTRE= "
565endif
566endif
567
568cd $model
569if ( $dimension == 3 ) then
570  cd libf/grid
571  \rm fxyprim.h
572  cp -p fxy_${grille}.h fxyprim.h
573endif
574
575######################################################################
576# Gestion du filtre qui n'existe qu'en 3d.
577######################################################################
578
579# set filtre to 'oldfiltrez' if using -olddyn option
580if ( "$dyntype" == "olddyn" ) then
581  set filtre="oldfiltrez"
582endif
583
584if ( `expr $dimc \> 2` == 1 ) then
585   set filtre="FILTRE=$filtre"
586else
587   set filtre="FILTRE= L_FILTRE= "
588endif
589echo "MACRO FILTRE $filtre"
590
591echo "dimc $dimc"
592
593########################################################################
594#  Avant de lancer le make, on recree le makefile si necessaire
595########################################################################
596# c'est a dire dans 3 cas:
597# 1. si la liste des fichiers .F et .h a ete modifiee depuis la
598#    derniere creation du makefile
599# 2. si le fichier contenant cette liste "liste_des_sources"
600#    n'existe pas.
601# 3. Si le makefile n'existe pas.
602########################################################################
603
604cd $model
605find libf -name '*.[Fh]' -print | sort >! tmp77
606#find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print >! tmp90
607find libf -name '*.[Fh]90' -print | sort >> tmp90
608
609if (    `diff tmp77 liste_des_sources_f77 | wc -w` \
610     || `diff tmp90 liste_des_sources_f90 | wc -w` \
611     || ! -f makefile \
612     || ! -f liste_des_sources_f90 \
613     || ! -f liste_des_sources_f77 ) then
614        echo "les fichiers suivants ont ete crees ou detruits"
615        echo "ou les fichiers suivants sont passes ou ne sont plus en Fortran 90"
616        diff liste_des_sources_f77 tmp77
617        diff liste_des_sources_f90 tmp90
618        \cp tmp77 liste_des_sources_f77
619        \cp tmp90 liste_des_sources_f90
620        echo "Remaking the makefile!"
621        if ("$dyntype" == "olddyn") then
622          ./create_make_gcm olddyn3d grid bibio phy$physique >! tmp
623        else
624          ./create_make_gcm dyn3d grid bibio phy$physique >! tmp
625        endif
626        \mv tmp makefile
627        echo "New makefile created."
628endif
629
630########################################################################
631#  Execution de la comande make
632########################################################################
633
634
635echo PHYSIQUE $phys
636echo dynamique $dyn $dimension
637echo OPTIM90="$optim90" $filtre LIBO=$libo $dyn PHYS=$phys DIM=$dimc PROG=$code
638echo PATH pour les fichiers INCLUDE $include
639echo OPLINK="$oplink"
640
641if $HP then
642   set f77='fort77 +OP'
643   set f90='jensaisrien'
644   set opt_link="$opt_link -lm"
645else  if $VPP then
646   set f77=frt
647   set f90=$f77
648else if $CRAY then
649   set f77=f90
650   set f90=f90
651else if $LINUX then
652#   set f77=ifort
653#   set f90=ifort
654#   set opt_link=" -L$LIBOGCM -L$NCDFLIB -lnetcdf "
655   set f77=pgf90
656   set f90=pgf90
657else if $SUN then
658   set f77=f90
659   set f90=f90
660else if $NEC then
661   set f77=f90
662   set f90=f90
663else if $XNEC then
664   set f77=sxmpif90
665   set f90=sxmpif90
666else
667   set f77=f77
668   set f90=f90
669endif
670
671cd $model
672
673if $VPP then
674  set make="gmake RANLIB=ls"
675else if $CRAY then
676  set make="make RANLIB=ls"
677else if $NEC then
678  set make="make RANLIB=ls"
679else if $LINUX then
680  set make="make -k RANLIB=ranlib"
681else if $XNEC then
682  set make="/usr/local/bin/gmake RANLIB=ls"
683  set make="/usr/freeware/bin/gmake RANLIB=ls"
684else
685  set make="make RANLIB=ranlib"
686endif
687
688#
689# etat0_netcdf a besoin d'info de la physique
690# A revoir
691set include="$include"" -I$libf/phy$physique"
692
693
694#################################################################
695# Execution de la comande make... ENFIN!
696#################################################################
697
698if $VPP then
699  set optim90=" $optim90 -Am -M$libo"
700  set optimtru90="$optim90"
701else if $SUN then
702 set optim90=" $optim90 -M$libo"
703 set optimtru90=" $optimtru90 "
704else if $NEC then
705 set optim90=" $optim90 -I$libo "
706else if $XNEC then
707 set optim90=" $optim90 -I$libo "
708 set optimtru90=" $optimtru90 -I$libo "
709else if $LINUX then
710# set optim="$optim -I${libo}"
711# set optim90="$optim90 -I${libo}"
712# set optimtru90="$optimtru90 -ffree-form -I${libo}"
713 set optim="$optim -module $libo"
714 set optim90="$optim90 -module $libo"
715 set optimtru90="$optimtru90 -module $libo"
716# Ehouarn: remove set mod_loc_dir def below; mod_loc_dir=$localdir (set above)
717# set mod_loc_dir=$libo
718endif
719
720set link="$f90 $optim90"
721
722set ar=ar
723
724if $XNEC then
725  set link="sxld $opt_link"
726  set link="$f90 "
727#  set ar=sxar
728endif
729
730
731cd $localdir
732
733set source_code=${code}.F
734# handle cases when the main program is in the physics directory
735if (-f $LMDGCM/libf/phy${physique}/${code}.F) then
736  set dyn="$dyn DIRMAIN=phy$physique "
737endif
738if (-f $LMDGCM/libf/phy${physique}/${code}.F90) then
739  set source_code=${code}.F90
740  set dyn="$dyn DIRMAIN=phy$physique "
741endif
742
743echo $make -f $LMDGCM/makefile \
744OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
745OPTIM="$optim" \
746OPTIM90="$optim90" \
747OPTIMTRU90="$optimtru90" \
748INCLUDE="$include" \
749$filtre \
750LIBO=$libo \
751$dyn \
752$phys \
753DIM=$dimc \
754DYNTYPE="$dyntype" \
755L_ADJNT="$adjnt" \
756LOCAL_DIR="$localdir"  \
757F77="$f77" \
758F90="$f90" \
759OPLINK="$oplink" \
760LINK="$link" \
761GCM="$LMDGCM" \
762MOD_LOC_DIR=$mod_loc_dir \
763MOD_SUFFIX=$mod_suffix \
764AR=$ar \
765SOURCE=$source_code \
766PROG=$code
767
768
769$make -f $LMDGCM/makefile \
770OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \
771OPTIM="$optim" \
772OPTIM90="$optim90" \
773OPTIMTRU90="$optimtru90" \
774INCLUDE="$include" \
775$filtre \
776LIBO=$libo \
777$dyn \
778$phys \
779DIM=$dimc \
780DYNTYPE="$dyntype" \
781L_ADJNT="$adjnt" \
782LOCAL_DIR="$localdir"  \
783F77="$f77" \
784F90="$f90" \
785OPLINK="$oplink" \
786LINK="$link" \
787GCM="$LMDGCM" \
788MOD_LOC_DIR=$mod_loc_dir \
789MOD_SUFFIX=$mod_suffix \
790AR=$ar \
791SOURCE=$source_code \
792PROG=$code
793
794\rm -f $libf/grid/dimensions.h
795\rm -f $libf/grid/bands.h
796\rm -f $libf/phy$physique/bands.h
797\rm -f $libf/phy$physique/scatterers.h
Note: See TracBrowser for help on using the repository browser.