source: LMDZ5/branches/IPSLCM5A2.1_ISO/makelmdz_fcm @ 3334

Last change on this file since 3334 was 3334, checked in by acozic, 6 years ago

Add option iso for the compilation - (branches/IPSLCM5A2.1-ISO)

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