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