source: LMDZ5/trunk/makelmdz_fcm @ 2694

Last change on this file since 2694 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
Line 
1#!/bin/bash
2# $Id: makelmdz_fcm 2690 2016-10-30 15:35:25Z oboucher $
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
36job=1
37full=''
38libphy=false
39
40LMDGCM=`/bin/pwd`
41LIBOGCM=$LMDGCM/libo
42LIBFGCM=$LMDGCM/libf
43DYN_COMMON_PATH=$LIBFGCM/dyn3d_common
44# path for optional packages, but default set to ".void_dir"
45FILTRE_PATH=$LMDGCM/.void_dir
46DYN_PHYS_PATH=$LMDGCM/.void_dir
47DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir
48PHY_COMMON_PATH=$LMDGCM/.void_dir
49RRTM_PATH=$LMDGCM/.void_dir
50DUST_PATH=$LMDGCM/.void_dir
51STRATAER_PATH=$LMDGCM/.void_dir
52SISVAT_PATH=$LMDGCM/.void_dir
53COSP_PATH=$LMDGCM/.void_dir
54fcm_path=$LMDGCM/tools/fcm/bin
55
56########################################################################
57#  Quelques initialisations de variables du shell.
58########################################################################
59
60CPP_KEY="" 
61INCLUDE=""
62LIB=""
63adjnt=""
64COMPIL_FFLAGS="%PROD_FFLAGS"
65PARA_FFLAGS=""
66PARA_LD=""
67EXT_SRC=""
68
69########################################################################
70# lecture des options de mymake
71########################################################################
72
73while (($# > 0))
74  do
75  case $1 in
76      "-h") cat <<fin
77Usage :
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
83[-c false/MPI1/OMCT]       : coupling with ocean model : MPI1/OMCT/false (default: false)
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)
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)
93[-dust true/false]    : compile with/without the dust package by Boucher and co (default: false)
94[-strataer true/false]    : compile with/without the strat aer package by Boucher and co (default: false)
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)
97[-io ioipsl/mix/xios]                   : Input/Output library (default: ioipsl)
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
104[-j n]                     : active parallel compiling on ntask
105[-full]                    : full recompiling
106[-libphy]                  : only compile physics package (no dynamics or main program)
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
111fin
112          exit;;
113
114      "-d")
115          dim=$2 ; shift ; shift ;;
116     
117      "-p")
118          physique="$2" ;  shift ; shift ;;
119
120      "-g")
121          grille="$2" ; shift ; shift ;;
122
123      "-c")
124          couple="$2" ; shift ; shift ;;
125
126      "-prod")
127          compil_mod="prod" ; shift ;;
128
129      "-dev")
130          compil_mod="dev" ; shift ;;
131
132      "-debug")
133          compil_mod="debug" ; shift ;;
134
135      "-io")
136          io="$2" ; shift ; shift ;;
137
138      "-v")
139          veget="$2" ; shift ; shift ;;
140
141      "-sisvat")
142          sisvat="$2" ; shift ; shift ;;
143
144      "-rrtm")
145          rrtm="$2" ; shift ; shift ;;
146
147      "-dust")
148          dust="$2" ; shift ; shift ;;
149
150      "-strataer")
151          strataer="$2" ; shift ; shift ;;
152
153      "-chimie")
154          chimie="$2" ; shift ; shift ;;
155
156      "-parallel")
157          parallel="$2" ; shift ; shift ;;
158     
159      "-include")
160          INCLUDE="$INCLUDE -I$2" ; shift ; shift ;;
161
162      "-cpp")
163          CPP_KEY="$CPP_KEY $2" ; shift ; shift ;;
164
165      "-adjnt")
166          echo "not operational ... work to be done here ";exit
167          opt_dep="$opt_dep adjnt" ; adjnt="-ladjnt -ldyn3d "
168          optim="$optim -Dadj" ; shift ;;
169
170      "-cosp")
171          cosp="$2" ; shift ; shift ;;
172     
173      "-mem")
174          paramem="mem" ; shift ;;
175
176      "-filtre")
177          filtre=$2 ; shift ; shift ;;
178
179      "-link")
180          LIB="$LIB $2" ; shift ; shift ;;
181
182      "-fcm_path")
183          fcm_path=$2 ; shift ; shift ;;
184
185      "-ext_src")
186          EXT_SRC=$2 ; shift ; shift ;;
187
188      "-j")
189          job=$2 ; shift ; shift ;;
190
191      "-full")
192          full="-full" ; shift ;;
193
194      "-libphy")
195          libphy="true" ; shift ;;
196
197      "-arch")
198          arch=$2 ; shift ; shift ;;
199
200      *)
201          code="$1" ; shift ;;
202  esac
203done
204
205###############################################################
206# path to fcm
207###############################################################
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
214
215# add fcm_path to PATH
216export PATH=${fcm_path}:${PATH}
217
218echo "Path to fcm:"
219echo ${fcm_path}
220
221###############################################################
222# lecture des chemins propres \`a l'architecture de la machine #
223###############################################################
224rm -f .void_file
225echo > .void_file
226rm -rf .void_dir
227mkdir .void_dir
228rm -f arch.path
229ln -s arch/arch-${arch}.path ./arch.path
230source arch.path
231
232########################################################################
233# Definition des clefs CPP, des chemins des includes et modules
234#  et des libraries
235########################################################################
236
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
247
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
257if [[ "$physique" != "nophys" ]]
258then
259   #We'll use some physics
260   CPP_KEY="$CPP_KEY CPP_PHYS"
261   if [[ "${phys_root}" == "lmd" ]]
262   then
263   #For lmd physics, default planet type is Earth
264   CPP_KEY="$CPP_KEY CPP_EARTH"
265   fi
266   # set physics common utilities path
267   PHY_COMMON_PATH="${LIBFGCM}/phy_common"
268   # set the dyn/phys interface path
269   DYN_PHYS_PATH="${LIBFGCM}/dynphy_lonlat"
270   DYN_PHYS_SUB_PATH="${LIBFGCM}/dynphy_lonlat/phy${phys_root}"
271fi
272
273if [[ "$filtre" == "filtrez" ]]
274then
275   FILTRE_PATH=${LIBFGCM}/$filtre
276fi
277
278if [[ "$chimie" == "INCA" ]]
279then
280   CPP_KEY="$CPP_KEY INCA"
281   INCLUDE="$INCLUDE -I${INCA_INCDIR}"
282   LIB="$LIB -L${INCA_LIBDIR} -lchimie"
283fi
284
285if [[ "$couple" != "false" ]]
286then
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
299fi
300
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
317
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
324
325if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" ]
326then
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
330   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
331   CPP_KEY="$CPP_KEY CPP_VEGET"
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
337      orch_libs="sechiba parameters stomate parallel orglob orchidee"
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
348   echo "Option -v $veget does not exist"
349   echo "Use ./makelmdz_fcm -h for more information"
350   exit 
351fi
352
353if [[ "$sisvat" == "true" ]]
354then
355   CPP_KEY="$CPP_KEY CPP_SISVAT"
356   SISVAT_PATH="$LIBFGCM/%PHYS/sisvat"
357fi
358
359if [[ "$rrtm" == "true" ]]
360then
361   CPP_KEY="$CPP_KEY CPP_RRTM"
362   RRTM_PATH="$LIBFGCM/%PHYS/rrtm"
363fi
364
365if [[ "$dust" == "true" ]]
366then
367   CPP_KEY="$CPP_KEY CPP_Dust"
368   DUST_PATH="$LIBFGCM/%PHYS/Dust"
369fi
370
371if [[ "$strataer" == "true" ]]
372then
373   CPP_KEY="$CPP_KEY CPP_StratAer"
374   STRATAER_PATH="$LIBFGCM/%PHYS/StratAer"
375fi
376
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"
382elif [[ $io == mix ]]
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"
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"
394fi
395
396if [[ "$cosp" == "true" ]]
397then
398   CPP_KEY="$CPP_KEY CPP_COSP"
399   COSP_PATH="$LIBFGCM/phylmd/cosp"
400#   LIB="${LIB} -l${LIBPREFIX}cosp"
401fi
402
403INCLUDE="$INCLUDE ${NETCDF_INCDIR}"
404LIB="$LIB ${NETCDF_LIBDIR}"
405
406########################################################################
407# calcul du nombre de dimensions
408########################################################################
409
410
411dim_full=$dim
412dim=`echo $dim | sed -e 's/[^0-9]/ /g'` 
413set $dim
414dimc=$#
415echo calcul de la dimension
416echo dim $dim
417echo dimc $dimc
418
419
420########################################################################
421# Gestion des dimensions du modele.
422# on cree ou remplace le fichier des dimensions
423########################################################################
424
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?"
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?"
439  read reponse
440  if [[ $reponse == "oui" || $reponse == "yes" ]]
441  then
442    \rm -f $LIBFGCM/grid/dimensions.h
443  else
444    exit
445  fi
446fi
447
448
449cd $LIBFGCM/grid/dimension
450./makdim $dim
451cat $LIBFGCM/grid/dimensions.h
452cd $LMDGCM
453
454
455########################################################################
456# Differentes dynamiques (3d, 2d, 1d)
457########################################################################
458
459dimension=`echo $dim | wc -w`
460echo dimension $dimension
461
462if (( $dimension == 3 ))
463then
464  cd $LIBFGCM/grid
465  \rm fxyprim.h
466  cp -p fxy_${grille}.h fxyprim.h
467#else
468#  echo "Probleme dans les dimensions de la dynamique !!"
469#  echo "Non reactive pour l'instant !!!"
470fi
471
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
484  DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir
485fi
486
487######################################################################
488#   Traitement special pour le nouveau rayonnement de Laurent Li.
489#   ---> YM desactive pour le traitemement en parallele
490######################################################################
491
492#if [[ -f $libf/phy$physique/raddim.h ]]
493#then
494# if [[ -f $libf/phy$physique/raddim.$dimh.h ]]
495#then
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
504# fi
505#fi
506
507######################################################################
508# Gestion du filtre qui n'existe qu'en 3d.
509######################################################################
510
511if (( `expr $dimc \> 2` == 1 ))
512then
513   filtre="FILTRE=$filtre"
514else
515   filtre="FILTRE= L_FILTRE= "
516fi
517echo MACRO FILTRE $filtre
518
519echo $dimc
520
521
522
523######################################################################
524# Creation du suffixe de la configuration
525######################################################################
526
527
528SUFF_NAME=_${dim_full}
529SUFF_NAME=${SUFF_NAME}_phy${physique}
530
531if [[ "$parallel" != "none" ]]
532then
533  SUFF_NAME=${SUFF_NAME}_para
534  DYN=dyn${dimc}d${paramem}
535  if [[ "$paramem" == "mem" ]]
536  then
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
542  fi
543else
544  SUFF_NAME=${SUFF_NAME}_seq
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
552fi
553
554if [[ $veget != "false" ]]
555then
556  SUFF_NAME=${SUFF_NAME}_orch
557fi
558
559if [[ $couple != "false" ]]
560then
561  SUFF_NAME=${SUFF_NAME}_couple
562fi
563
564if [[ $chimie == "INCA" ]]
565then
566  SUFF_NAME=${SUFF_NAME}_inca
567fi
568
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
584cd $LMDGCM
585config_fcm="config.fcm"
586rm -f $config_fcm
587touch $config_fcm
588rm -f bin/${code}${SUFF_NAME}.e
589rm -f arch.fcm
590rm -f arch.opt
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
599echo "%DYN_COMMON    $DYN_COMMON_PATH" >> $config_fcm
600echo "%PHY_COMMON    $PHY_COMMON_PATH" >> $config_fcm
601echo "%FILTRE        $FILTRE_PATH"   >> $config_fcm
602echo "%PHYS          phy${physique}" >> $config_fcm
603echo "%DYN_PHYS      $DYN_PHYS_PATH" >> $config_fcm
604echo "%DYN_PHYS_SUB  $DYN_PHYS_SUB_PATH" >> $config_fcm
605echo "%RRTM          $RRTM_PATH"     >> $config_fcm
606echo "%DUST          $DUST_PATH"     >> $config_fcm
607echo "%STRATAER      $STRATAER_PATH" >> $config_fcm
608echo "%SISVAT        $SISVAT_PATH"   >> $config_fcm
609echo "%COSP          $COSP_PATH"     >> $config_fcm
610echo "%CPP_KEY       $CPP_KEY"       >> $config_fcm
611echo "%EXEC          $code"          >> $config_fcm
612echo "%SUFF_NAME     $SUFF_NAME"     >> $config_fcm
613echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> $config_fcm
614echo "%PARA_FFLAGS   $PARA_FFLAGS"   >> $config_fcm
615echo "%PARA_LD       $PARA_LD"       >> $config_fcm
616echo "%EXT_SRC       $EXT_SRC"       >> $config_fcm
617
618
619
620ln -s arch/arch-${arch}.fcm arch.fcm
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
628rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock
629./build_gcm ${fcm_path} -j $job $full
630
631rm -rf tmp_src
632rm -rf config
633ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config config
634ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/ppsrc tmp_src
635
636
637if [[ -r $LIBFGCM/grid/dimensions.h ]]
638then
639  # Cleanup: remove dimension.h file
640  \rm -f $LIBFGCM/grid/dimensions.h
641fi
Note: See TracBrowser for help on using the repository browser.