source: trunk/LMDZ.GENERIC/makegcm_g95 @ 1374

Last change on this file since 1374 was 1216, checked in by emillour, 11 years ago

Generic model:
Major cleanup, in order to ease the use of LMDZ.GENERIC with (parallel) dynamics
in LMDZ.COMMON: (NB: this will break LMDZ.UNIVERSAL, which should be thrashed
in the near future)

  • Updated makegcm_* scripts (and makdim) and added the "-full" (to enforce full recomputation of the model) option
  • In dyn3d: converted control.h to module control_mod.F90 and converted iniadvtrac.F to module infotrac.F90
  • Added module mod_const_mpi.F90 in dyn3d (not used in serial mode)
  • Rearanged input/outputs routines everywhere to handle serial/MPI cases. physdem.F => phyredem.F90 , phyetat0.F => phyetat0.F90 ; all read/write routines for startfi files are gathered in module iostart.F90
  • added parallelism related routines init_phys_lmdz.F90, comgeomphy.F90, dimphy.F90, iniphysiq.F90, mod_grid_phy_lmdz.F90, mod_phys_lmdz_mpi_data.F90, mod_phys_lmdz_mpi_transfert.F90, mod_phys_lmdz_omp_data.F90, mod_phys_lmdz_omp_transfert.F90, mod_phys_lmdz_para.F90, mod_phys_lmdz_transfert_para.F90 in phymars and mod_const_mpi.F90 in dyn3d (for compliance with parallelism)
  • added created generic routines 'planetwide_maxval' and 'planetwide_minval', in module "planetwide_mod", that enable obtaining the max and min of a field over the whole planet. This should be further imroved with computation of means (possibly area weighed), etc.

EM

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