source: trunk/LMDZ.GENERIC/makegcm_ifort @ 1403

Last change on this file since 1403 was 1403, checked in by emillour, 10 years ago

All models: Reorganizing the physics/dynamics interface.

  • makelmdz and makelmdz_fcm scripts adapted to handle the new directory settings
  • misc: (replaces what was the "bibio" directory)
  • Should only contain extremely generic (and non physics or dynamics-specific) routines
  • Therefore moved initdynav.F90, initfluxsto.F, inithist.F, writedynav.F90, write_field.F90, writehist.F to "dyn3d_common"
  • dynlonlat_phylonlat: (new interface directory)
  • This directory contains routines relevent to physics/dynamics grid interactions, e.g. routines gr_dyn_fi or gr_fi_dyn and calfis
  • Moreover the dynlonlat_phylonlat contains directories "phy*" corresponding to each physics package "phy*" to be used. These subdirectories should only contain specific interfaces (e.g. iniphysiq) or main programs (e.g. newstart)
  • phy*/dyn1d: this subdirectory contains the 1D model using physics from phy*

EM

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