source: LMDZ6/branches/Ocean_skin/makelmdz_fcm @ 3463

Last change on this file since 3463 was 3434, checked in by lguez, 5 years ago

Forgot to include makelmdz_fcm in previous commit.

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