source: LMDZ6/trunk/makelmdz_fcm @ 3481

Last change on this file since 3481 was 3435, checked in by Laurent Fairhead, 6 years ago

"Historic" :-) commit merging the physics branch used for DYNAMICO with the LMDZ trunk.
The same physics branch can now be used seamlessly with the traditional lon-lat LMDZ
dynamical core and DYNAMICO.
Testing consisted in running a lon-lat LMDZ bucket simulation with the NPv6.1 physics package
with the original trunk sources and the merged sources. Tests were succesful in the sense that
numeric continuity was preserved in the restart files from both simulation. Further tests
included running both versions of the physics codes for one year in a LMDZOR setting in which
the restart files also came out identical.

Caution:

  • as the physics package now manages unstructured grids, grid information needs to be transmitted

to the surface scheme ORCHIDEE. This means that the interface defined in surf_land_orchidee_mod.F90
is only compatible with ORCHIDEE version orchidee2.1 and later versions. If previous versions of
ORCHIDEE need to be used, the CPP key ORCHIDEE_NOUNSTRUCT needs to be set at compilation time.
This is done automatically if makelmdz/makelmdz_fcm are called with the veget orchidee2.0 switch

  • due to a limitation in XIOS, the time at which limit conditions will be read in by DYNAMICO will be

delayed by one physic timestep with respect to the time it is read in by the lon-lat model. This is caused
by the line

IF (MOD(itime-1, lmt_pas) == 0 .OR. (jour_lu /= jour .AND. grid_type /= unstructured)) THEN ! time to read

in limit_read_mod.F90

Work still needed on COSP integration and XML files for DYNAMICO

EM, YM, LF

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