source: LMDZ5/trunk/makelmdz_fcm @ 2726

Last change on this file since 2726 was 2690, checked in by oboucher, 8 years ago

Adding a module for stratospheric aerosols with a bin scheme.
The module gets activated with -strataer true compiling option.
May not quite work yet, more testing needed, but should not affect
the rest of LMDz as everything is under a CPP_StratAer key.

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