source: trunk/LMDZ.COMMON/makelmdz_fcm @ 1540

Last change on this file since 1540 was 1540, checked in by emillour, 9 years ago

All GCMS: Further adaptations to keep up with changes in LMDZ5 concerning
physics/dynamics separation:

  • changed directory "dynlonlat_phylonlat" to "dynphy_lonlat" and adapted makelmdz and makelmdz_fcm scripts accordingly.
  • added option "-libphy" to makelmdz_fcm to just build a physics library, without any main program (not operational yet; further cleanup in the physics required).
  • moved "iniprint.h" from dyn3d_common to misc (NB: it is used in both physics and dynamics; this should be cleaned up further...)

EM

File size: 19.6 KB
RevLine 
[1]1#!/bin/bash
[847]2# $Id: makelmdz_fcm 1615 2012-02-10 15:42:26Z emillour $
[1]3# This is a script in Bash.
4
5# FH : on ne crée plus le fichier arch.mk qui est supposé exister par
6# FH : ailleurs.
7# FH : ulterieurement, ce fichier sera pré-existant pour une série
8# FH : de configurations en versions optimisées et debug qui seront
9# FH : liés (ln -s) avec arch.mk en fonction de l'architecture.
10# FH : Pour le moment, cette version est en test et on peut créer les
11# FH : arch.mk en lançant une première fois makegcm.
12#
13##set -x
14########################################################################
15# options par defaut pour la commande make
16########################################################################
17
18dim="96x72x19"
19physique=lmd
20filtre=filtrez
21grille=reg
22couple=false
23veget=false
[1300]24sisvat=false
[1302]25rrtm=false
[1]26chimie=false
[895]27chemistry=false
[1]28parallel=none
[979]29paramem="par"
[1]30compil_mod=prod
31io=ioipsl
32LIBPREFIX=""
33cosp=false
[957]34bands=""
35scatterers=""
[1019]36job=1
37full=''
[1540]38libphy=false
[1]39
40LMDGCM=`/bin/pwd`
41LIBOGCM=$LMDGCM/libo
42LIBFGCM=$LMDGCM/libf
[1403]43DYN_COMMON_PATH=$LIBFGCM/dyn3d_common
[895]44# path for optional packages, but default set to ".void_dir"
[1403]45FILTRE_PATH=$LMDGCM/.void_dir
46DYN_PHYS_PATH=$LMDGCM/.void_dir
47DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir
[1521]48PHY_COMMON_PATH=$LMDGCM/.void_dir
[1302]49RRTM_PATH=$LMDGCM/.void_dir
50SISVAT_PATH=$LMDGCM/.void_dir
[1]51COSP_PATH=$LMDGCM/.void_dir
[895]52CHEM_PATH=$LMDGCM/.void_dir
[1107]53AERONO_PATH=$LMDGCM/.void_dir
[895]54# Path to fcm utility:
[1019]55##fcm_path=$LMDGCM/tools/fcm/bin
56fcm_path=$(dirname $(which fcm))
[1]57
58########################################################################
59#  Quelques initialisations de variables du shell.
60########################################################################
61
62CPP_KEY="" 
63INCLUDE=""
64LIB=""
65adjnt=""
66COMPIL_FFLAGS="%PROD_FFLAGS"
67PARA_FFLAGS=""
68PARA_LD=""
69EXT_SRC=""
70
71########################################################################
72# lecture des options de mymake
73########################################################################
74
75while (($# > 0))
76  do
77  case $1 in
78      "-h") cat <<fin
79Usage :
[957]80makegcm [options] -arch arch exec
81[-h]                       : brief help
82[-d [[IMx]JMx]LM]          : IM, JM, LM are the dimensions in x, y, z (default: $dim)
83[-s nscat]                 : (Generic) Number of radiatively active scatterers
84[-b IRxVIS]                : (Generic) Number of infrared (IR) and visible (VIS) bands for radiative transfer
85[-p PHYS]                  : set of physical parametrizations (in libf/phyPHYS), (default: lmd)
86[-prod / -dev / -debug]    : compilation mode production (default) / developement / debug .
[1302]87[-c false/MPI1/OMCT]       : coupling with ocean model : MPI1/OMCT/false (default: false)
[1019]88[-v false/orchidee2.0/orchidee1.9/true] : version of the vegetation model to include (default: false)
89          false       : no vegetation model
90          orchidee2.0 : compile using ORCHIDEE 2.0 (or more recent version)
91          orchidee1.9 : compile using ORCHIDEE up to the version including OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6
92          true        : (obsolete; for backward compatibility) use ORCHIDEE tag 1.9-1.9.6
[957]93[-chimie INCA/false]       : (Earth) with INCA chemistry model or without (default: false)
94[-cosp cosp/false]         : (Earth) add the cosp model (default: false)
[1403]95[-sisvat true/false]  : (Earth) compile with/without sisvat package (default: false)
96[-rrtm true/false]    : (Earth) compile with/without rrtm package (default: false)
[957]97[-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp
98[-g GRI]                   : grid configuration in dyn3d/GRI_xy.h  (default: reg, inclues a zoom)
[1391]99[-io ioipsl/mix/xios]                   : Input/Output library (default: ioipsl)
[957]100[-include INCLUDES]        : extra include path to add
101[-cpp CPP_KEY]             : additional preprocessing definitions
102[-adjnt]                   : adjoint model, not operational ...
[979]103[-mem]                     : reduced memory dynamics (if in parallel mode)
[957]104[-filtre NOMFILTRE]        : use filtre from libf/NOMFILTRE (default: filtrez)
105[-link LINKS]              : additional links with other libraries
[1019]106[-j n]                     : active parallel compiling on ntask
[1107]107[-full]                    : full (re-)compilation (from scratch)
[957]108[-fcm_path path]           : path to the fcm tool (default: tools/fcm/bin)
109[-ext_src path]            : path to an additional set of routines to compile with the model
110 -arch arch                : target architecture
111 exec                      : executable to build
[1]112fin
113          exit;;
114
115      "-d")
116          dim=$2 ; shift ; shift ;;
117     
118      "-p")
119          physique="$2" ;  shift ; shift ;;
120
[957]121      "-s")
122          scatterers=$2 ; shift ; shift ;;
123
124      "-b")
125          bands=$2 ; shift ; shift ;;
126
[1]127      "-g")
128          grille="$2" ; shift ; shift ;;
129
130      "-c")
131          couple="$2" ; shift ; shift ;;
132
133      "-prod")
134          compil_mod="prod" ; shift ;;
135
136      "-dev")
137          compil_mod="dev" ; shift ;;
138
139      "-debug")
140          compil_mod="debug" ; shift ;;
141
142      "-io")
143          io="$2" ; shift ; shift ;;
144
145      "-v")
146          veget="$2" ; shift ; shift ;;
147
[1300]148      "-sisvat")
149          sisvat="$2" ; shift ; shift ;;
150
[1302]151      "-rrtm")
152          rrtm="$2" ; shift ; shift ;;
153
[1]154      "-chimie")
155          chimie="$2" ; shift ; shift ;;
156
157      "-parallel")
158          parallel="$2" ; shift ; shift ;;
159     
160      "-include")
161          INCLUDE="$INCLUDE -I$2" ; shift ; shift ;;
162
163      "-cpp")
164          CPP_KEY="$CPP_KEY $2" ; shift ; shift ;;
165
166      "-adjnt")
[957]167          echo "not operational ... work to be done here ";exit
[1]168          opt_dep="$opt_dep adjnt" ; adjnt="-ladjnt -ldyn3d "
169          optim="$optim -Dadj" ; shift ;;
170
171      "-cosp")
172          cosp="$2" ; shift ; shift ;;
173
[979]174      "-mem")
175          paramem="mem" ; shift ;;
[1]176
177      "-filtre")
178          filtre=$2 ; shift ; shift ;;
179
180      "-link")
181          LIB="$LIB $2" ; shift ; shift ;;
182
183      "-fcm_path")
184          fcm_path=$2 ; shift ; shift ;;
185
186      "-ext_src")
187          EXT_SRC=$2 ; shift ; shift ;;
188
[1019]189      "-j")
190          job=$2 ; shift ; shift ;;
191
192      "-full")
193          full="-full" ; shift ;;
194
[1540]195      "-libphy")
196          libphy="true" ; shift ;;
197
[1]198      "-arch")
199          arch=$2 ; shift ; shift ;;
200
201      *)
202          code="$1" ; shift ;;
203  esac
204done
205
206###############################################################
[979]207# path to fcm
[1]208###############################################################
[979]209# handle case when provided path to fcm was given as a relative
210# path (from makelmdz_fcm script directory) and not an absolute path
211if [[ ${fcm_path:0:1} != "/" ]] ; then
212  # prepend with makelmdz_fcm location
213  fcm_path=$(cd $(dirname $0) ; pwd)"/"${fcm_path}
214fi
215
216# add fcm_path to PATH
[847]217export PATH=${fcm_path}:${PATH}
[1]218
[979]219echo "Path to fcm:"
220echo ${fcm_path}
[1]221
222###############################################################
223# lecture des chemins propres à l'architecture de la machine #
224###############################################################
225rm -f .void_file
226echo > .void_file
227rm -rf .void_dir
228mkdir .void_dir
229rm -f arch.path
230ln -s arch/arch-${arch}.path ./arch.path
231source arch.path
232
233########################################################################
234# Definition des clefs CPP, des chemins des includes et modules
235#  et des libraries
236########################################################################
237
238if [[ "$compil_mod" == "prod" ]]
239then
240  COMPIL_FFLAGS="%PROD_FFLAGS"
241elif [[ "$compil_mod" == "dev" ]]
242then
243  COMPIL_FFLAGS="%DEV_FFLAGS"
244elif [[ "$compil_mod" == "debug" ]]
245then
246  COMPIL_FFLAGS="%DEBUG_FFLAGS"
247fi
248
[1403]249phys_root=$physique
250if [[ "${physique:0:3}" == "lmd" ]] ; then phys_root=lmd ; fi
251if [[ "${physique:0:3}" == "mar" ]] ; then phys_root=mar ; fi
252if [[ "${physique:0:4}" == "mars" ]] ; then phys_root=mars ; fi
253if [[ "${physique:0:3}" == "std" ]] ; then phys_root=std ; fi
254if [[ "${physique:0:5}" == "venus" ]] ; then phys_root=venus ; fi
255if [[ "${physique:0:5}" == "titan" ]] ; then phys_root=titan ; fi
256if [[ "${physique:0:3}" == "dev" ]] ; then phys_root=dev ; fi
257
[1]258if [[ "$physique" != "nophys" ]]
259then
[847]260   #We'll use some physics
[37]261   CPP_KEY="$CPP_KEY CPP_PHYS"
[1403]262   if [[ "${phys_root}" == "lmd" ]]
[847]263   then
264   #For lmd physics, default planet type is Earth
[1]265   CPP_KEY="$CPP_KEY CPP_EARTH"
[847]266   fi
[1521]267   # set physics common utilities path
268   PHY_COMMON_PATH="${LIBFGCM}/phy_common"
[1403]269   # set the dyn/phys interface path
[1540]270   DYN_PHYS_PATH="${LIBFGCM}/dynphy_lonlat"
271   DYN_PHYS_SUB_PATH="${LIBFGCM}/dynphy_lonlat/phy${phys_root}"
[1]272fi
273
[1403]274if [[ "$filtre" == "filtrez" ]]
275then
276   FILTRE_PATH=${LIBFGCM}/$filtre
277fi
278
[1]279if [[ "$chimie" == "INCA" ]]
280then
281   CPP_KEY="$CPP_KEY INCA"
282   INCLUDE="$INCLUDE -I${INCA_INCDIR}"
283   LIB="$LIB -L${INCA_LIBDIR} -lchimie"
284fi
285
286if [[ "$couple" != "false" ]]
287then
[1302]288    if [[ "$couple" == "MPI1" ]]
289    then
290        CPP_KEY="$CPP_KEY CPP_COUPLE"
291        export OASIS_INCDIR=$LMDGCM/../../prism/X64/build/lib/psmile.MPI1
292        export OASIS_LIBDIR=$LMDGCM/../../prism/X64/lib
293        INCLUDE="$INCLUDE -I${OASIS_INCDIR}"
294        LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.MPI1 -lmpp_io"
295    else
296        CPP_KEY="$CPP_KEY CPP_COUPLE CPP_OMCT"
297        INCLUDE="$INCLUDE -I${OASIS_INCDIR}"
298        LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.MPI1 -lscrip -lmct -lmpeu"
299    fi
[1]300fi
301
[1530]302if [[ "$parallel" != "none" && \
303     ( "$code" == "newstart" || "$code" == "start2archive" ) ]]
304then
305    echo "newstart or start2archive utilities should be run in serial!"
306    echo " Compile without -parallel [mpi|omp|mpi_omp] option!"
307    exit
308fi
309
[1]310if [[ "$parallel" == "mpi" ]]
311then
312   CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI"
313   PARA_FFLAGS="%MPI_FFLAGS"
314   PARA_LD="%MPI_LD"
315elif [[ "$parallel" == "omp" ]]
316then
317   CPP_KEY="$CPP_KEY CPP_PARA CPP_OMP"
318   PARA_FFLAGS="%OMP_FFLAGS"
319   PARA_LD="%OMP_LD"
320elif [[ "$parallel" == "mpi_omp" ]]
321then
322   CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI CPP_OMP"
323   PARA_FFLAGS="%MPI_FFLAGS %OMP_FFLAGS"
324   PARA_LD="%MPI_LD %OMP_LD"
325fi
326
327if [[ ( "$parallel" == "omp" || "$parallel" == "mpi_omp" ) \
328   && "$compil_mod" == "debug" ]]
329then
330    echo "Usually, parallelization with OpenMP requires some optimization."
331    echo "We suggest switching to \"-dev\"."
332fi
333
[1019]334if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" ]
[1]335then
[1019]336#NB: option 'true': for backward compatibility. To be used with ORCHIDEE tag 1.9-1.9.6
337#    For this case, cpp flag ORCHIDEE_NOOPENMP must be added to the makelmdz_fcm arguments
338#    option orchidee1.9 : Compile with ORCHIDEE version up to the inclusion of OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6
339   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
[1]340   CPP_KEY="$CPP_KEY CPP_VEGET"
[1019]341# temporary, for Orchidee versions 1.9.* (before openmp activation)
342   if [[ "$veget" == "orchidee1.9" ]] ; then
343      CPP_KEY="$CPP_KEY ORCHIDEE_NOOPENMP"
344   fi
345   if [[ "$veget" == "orchidee2.0" ]] ; then
[1300]346      orch_libs="sechiba parameters stomate parallel orglob orchidee"
[1019]347   else
348      orch_libs="sechiba parameters stomate parallel orglob"
349   fi
350   LIB="${LIB} -L${ORCH_LIBDIR}"
351   for lib in ${orch_libs} ; do
352      if [ -f ${ORCH_LIBDIR}/lib${LIBPREFIX}$lib.a ] ; then
353         LIB="${LIB} -l${LIBPREFIX}$lib "
354      fi
355   done
356elif [[ "$veget" != "false" ]] ; then
357   echo "Option -v $veget does not exist"
358   echo "Use ./makelmdz_fcm -h for more information"
359   exit 
[1]360fi
361
[1300]362if [[ "$sisvat" == "true" ]]
363then
364   CPP_KEY="$CPP_KEY CPP_SISVAT"
[1302]365   SISVAT_PATH="$LIBFGCM/%PHYS/sisvat"
[1300]366fi
367
[1302]368if [[ "$rrtm" == "true" ]]
369then
370   CPP_KEY="$CPP_KEY CPP_RRTM"
371   RRTM_PATH="$LIBFGCM/%PHYS/rrtm"
372fi
373
[1]374if [[ $io == ioipsl ]]
375then
376   CPP_KEY="$CPP_KEY CPP_IOIPSL"
377   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR}"
378   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl"
[1391]379elif [[ $io == mix ]]
[1300]380then
381   # For now, xios implies also using ioipsl
382   CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS"
383   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
384   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios"
[1391]385elif [[ $io == xios ]]
386then
387   # For now, xios implies also using ioipsl
388   CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS CPP_IOIPSL_NO_OUTPUT"
389   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
390   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios"
[1]391fi
[895]392
[1]393if [[ "$cosp" == "true" ]]
394then
395   CPP_KEY="$CPP_KEY CPP_COSP"
396   COSP_PATH="$LIBFGCM/cosp"
397#   LIB="${LIB} -l${LIBPREFIX}cosp"
398fi
399
[1403]400# for Titan (but could be used by others as well), there is also "chimtitan"
401if [[ -d ${LIBFGCM}/chim${physique} ]]
[895]402then
403   CHEM_PATH="${LIBFGCM}/chim${physique}"
404   INCLUDE="$INCLUDE -I${LIBFGCM}/chim${physique}"
405fi
406
[1107]407# for Mars (but could be used by others as well), there is also "aeronomars"
408if [[ -d ${LIBFGCM}/aerono${physique} ]]
409then
410   AERONO_PATH="${LIBFGCM}/aerono${physique}"
411   INCLUDE="$INCLUDE -I${LIBFGCM}/aerono${physique}"
412fi
413
[270]414INCLUDE="$INCLUDE ${NETCDF_INCDIR}"
415LIB="$LIB ${NETCDF_LIBDIR}"
416
[1]417########################################################################
418# calcul du nombre de dimensions
419########################################################################
420
421
422dim_full=$dim
423dim=`echo $dim | sed -e 's/[^0-9]/ /g'` 
424set $dim
425dimc=$#
426echo calcul de la dimension
427echo dim $dim
428echo dimc $dimc
429
430
431########################################################################
432# Gestion des dimensions du modele.
433# on cree ou remplace le fichier des dimensions
434########################################################################
435
[979]436cd $LIBFGCM/grid
437if [[ -f dimensions.h ]]
438then
439  echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs'
440  echo "Attendez que la premiere compilation soit terminee pour relancer la suivante."
441  echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs,"
442  echo  vous pouvez continuer en repondant oui.
443  echo "Voulez-vous vraiment continuer?"
444  echo ""
445  echo "WARNING: you are probably already compiling the model somewhere else."
446  echo "Wait until the first compilation is finished before launching this one."
447  echo "If you are sure that you are not compiling elsewhere, just answer "
448  echo "yes (or 'oui') to the question below to proceed."
449  echo "Do you wish to continue?"
450  read reponse
451  if [[ $reponse == "oui" || $reponse == "yes" ]]
452  then
453    \rm -f $LIBFGCM/grid/dimensions.h
454  else
455    exit
456  fi
457fi
458
459
[1]460cd $LIBFGCM/grid/dimension
461./makdim $dim
[1441]462if (($? != 0))
463then
464    exit 1
465fi
466
[1]467cat $LIBFGCM/grid/dimensions.h
468cd $LMDGCM
469
[957]470if [[ "$bands" != "" ]]
[847]471then
[957]472  # Generic model, recreate bands.h (IR & VIS bands for radiative transfer)
473  bands=$(echo $bands | sed -e 's/[^0-9]/ /g')
474  cd $LIBFGCM/phy$physique/bands
475  ./makbands $bands
476  cat $LIBFGCM/phy$physique/bands.h
477  cd $LMDGCM
[847]478fi
[1]479
[957]480if [[ "$scatterers" != "" ]]
481then
482  # Generic model, recreate scatterers.h
483  cd $LIBFGCM/phy$physique/scatterers
484  ./make_scatterers $scatterers
485  cat $LIBFGCM/phy$physique/scatterers.h
486  cd $LMDGCM
487fi
488
489
[1]490########################################################################
491# Differentes dynamiques (3d, 2d, 1d)
492########################################################################
493
494dimension=`echo $dim | wc -w`
495echo dimension $dimension
496
497if (( $dimension == 3 ))
498then
499  cd $LIBFGCM/grid
500  \rm fxyprim.h
501  cp -p fxy_${grille}.h fxyprim.h
[895]502#else
503#  echo "Probleme dans les dimensions de la dynamique !!"
504#  echo "Non reactive pour l'instant !!!"
[1]505fi
506
[895]507if (( $dimension == 1 ))
508then
[1530]509## Sanity check: 1D models should be used in serial
510  if [[ $parallel != "none" ]]
511  then
512    echo "Error: a 1D model should not be compiled with "
513    echo "       -parallel [mpi|omp|mpi_omp] option!"
514    exit
515  fi
[1403]516  CPP_KEY="$CPP_KEY CPP_1D"
[895]517##in 1D, add dyn3d to include path (because main prog is in physics)
[1403]518  INCLUDE="$INCLUDE -Ilibf/dyn3d -Ilibf/dyn3d_common"
519## no filtre in 1d:
520  FILTRE_PATH=$LMDGCM/.void_dir
521## no need to compile all routines in dyn3d_common either:
522  DYN_COMMON_PATH=$LMDGCM/.void_dir
523## no need to compile all routines in dynlmdz_phy... ;
524## (because key ones are included in 1D main program)
525  DYN_PHYS_PATH=$LMDGCM/.void_dir
526  DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir
[895]527fi
528
[1]529######################################################################
530#   Traitement special pour le nouveau rayonnement de Laurent Li.
531#   ---> YM desactive pour le traitemement en parallele
532######################################################################
533
534#if [[ -f $libf/phy$physique/raddim.h ]]
535#then
536# if [[ -f $libf/phy$physique/raddim.$dimh.h ]]
537#then
538#  \rm -f $libf/phy$physique/raddim.h
539#  cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h
540#  echo $libf/phy$physique/raddim.$dimh.h
541#  cat $libf/phy$physique/raddim.h
542# else
543#  echo On peut diminuer la taille de l executable en creant
544#  echo le fichier $libf/phy$physique/raddim.$dimh.h
545#  \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h
546# fi
547#fi
548
549######################################################################
550# Gestion du filtre qui n'existe qu'en 3d.
551######################################################################
552
553if (( `expr $dimc \> 2` == 1 ))
554then
555   filtre="FILTRE=$filtre"
556else
557   filtre="FILTRE= L_FILTRE= "
558fi
559echo MACRO FILTRE $filtre
560
561echo $dimc
562
563
564
565######################################################################
566# Creation du suffixe de la configuration
567######################################################################
568
569
570SUFF_NAME=_${dim_full}
571SUFF_NAME=${SUFF_NAME}_phy${physique}
572
573if [[ "$parallel" != "none" ]]
574then
575  SUFF_NAME=${SUFF_NAME}_para
[979]576  DYN=dyn${dimc}d${paramem}
577  if [[ "$paramem" == "mem" ]]
578  then
579   SUFF_NAME=${SUFF_NAME}_${paramem}
580  fi
[1]581else
582  SUFF_NAME=${SUFF_NAME}_seq
[1403]583  if (( $dimension == 1 ))
584  then
585    # dynamics-related routines in"dyn1d" subdirectory of phy${physique}
586    DYN=phy${physique}/dyn1d
587  else
588    DYN=dyn${dimc}d
[895]589  fi
[1]590fi
591
[1019]592if [[ $veget != "false" ]]
[1]593then
594  SUFF_NAME=${SUFF_NAME}_orch
595fi
596
597if [[ $couple != "false" ]]
598then
599  SUFF_NAME=${SUFF_NAME}_couple
600fi
601
602if [[ $chimie == "INCA" ]]
603then
604  SUFF_NAME=${SUFF_NAME}_inca
605fi
606
[1540]607if [[ $libphy == "true" ]]
608then
609  # special case where we compile only the physics
610  DYN=$LMDGCM/.void_dir
611  DYN_COMMON_PATH=$LMDGCM/.void_dir
612  FILTRE_PATH=$LMDGCM/.void_dir
613  DYN_PHYS_PATH=$LMDGCM/.void_dir
614  DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir
615  #and there is no main program to generate
616  code=""
617  SUFF_NAME=""
618else
619  SUFF_NAME=${SUFF_NAME}.e
620fi
621
[1]622cd $LMDGCM
623config_fcm="config.fcm"
624rm -f $config_fcm
625touch $config_fcm
626rm -f bin/${code}${SUFF_NAME}.e
627rm -f arch.fcm
628rm -f arch.opt
629
630echo "%ARCH          $arch"          >> $config_fcm
631echo "%INCDIR        $INCLUDE"       >> $config_fcm 
632echo "%LIB           $LIB"           >> $config_fcm
633echo "%ROOT_PATH     $PWD"           >> $config_fcm
634echo "%LIBF          $LIBFGCM"       >> $config_fcm
635echo "%LIBO          $LIBOGCM"       >> $config_fcm
636echo "%DYN           $DYN"           >> $config_fcm
[1403]637echo "%DYN_COMMON    $DYN_COMMON_PATH" >> $config_fcm
[1521]638echo "%PHY_COMMON    $PHY_COMMON_PATH" >> $config_fcm
[1403]639echo "%FILTRE        $FILTRE_PATH"   >> $config_fcm
[1]640echo "%PHYS          phy${physique}" >> $config_fcm
[1403]641echo "%DYN_PHYS      $DYN_PHYS_PATH" >> $config_fcm
642echo "%DYN_PHYS_SUB  $DYN_PHYS_SUB_PATH" >> $config_fcm
[1302]643echo "%RRTM          $RRTM_PATH"     >> $config_fcm
644echo "%SISVAT        $SISVAT_PATH"   >> $config_fcm
[1]645echo "%COSP          $COSP_PATH"     >> $config_fcm
[895]646echo "%CHEM          $CHEM_PATH"     >> $config_fcm
[1107]647echo "%AERONO        $AERONO_PATH"   >> $config_fcm
[1]648echo "%CPP_KEY       $CPP_KEY"       >> $config_fcm
649echo "%EXEC          $code"          >> $config_fcm
650echo "%SUFF_NAME     $SUFF_NAME"     >> $config_fcm
651echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> $config_fcm
652echo "%PARA_FFLAGS   $PARA_FFLAGS"   >> $config_fcm
653echo "%PARA_LD       $PARA_LD"       >> $config_fcm
654echo "%EXT_SRC       $EXT_SRC"       >> $config_fcm
655
656
657
658ln -s arch/arch-${arch}.fcm arch.fcm
659if test -f arch/arch-${arch}.opt &&  [ $compil_mod = "prod" ]
660  then
661  ln -s arch/arch-${arch}.opt arch.opt
662else
663  ln -s .void_file arch.opt
664fi
665
666
667rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock
[1019]668./build_gcm ${fcm_path} -j $job $full
[1]669
670rm -rf tmp_src
671rm -rf config
672ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config config
[1540]673ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/ppsrc tmp_src
[979]674
[1300]675
[979]676if [[ -r $LIBFGCM/grid/dimensions.h ]]
677then
678  # Cleanup: remove dimension.h file
679  \rm -f $LIBFGCM/grid/dimensions.h
680fi
Note: See TracBrowser for help on using the repository browser.