source: LMDZ5/branches/IPSLCM5A2.1_ISO/makelmdz_fcm @ 3334

Last change on this file since 3334 was 3334, checked in by acozic, 6 years ago

Add option iso for the compilation - (branches/IPSLCM5A2.1-ISO)

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