source: LMDZ5/branches/testing/makelmdz_fcm @ 2687

Last change on this file since 2687 was 2641, checked in by Laurent Fairhead, 8 years ago

Merged trunk changes r2593:2640 into testing branch

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