source: trunk/LMDZ.GENERIC/makegcm_gfortran @ 1315

Last change on this file since 1315 was 1255, checked in by aslmd, 11 years ago

LMDZ.GENERIC: unwanted changes sent in previous commit. corrected.

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