source: LMDZ5/trunk/makelmdz_fcm @ 2265

Last change on this file since 2265 was 2250, checked in by Ehouarn Millour, 9 years ago

Improving the makelmdz* utilities:
Directory phy* in dynlonlat_phylonlat is assumed to be the same "root" as provided by the name of the physics package (e.g. "phylmd" for "phylmd_bis" or "phylmdmine" or "phylmd.2", etc.) to ease things for those who work with multiple copies of a physics directory.
FH

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