source: LMDZ4/trunk/create_make_gcm

Last change on this file was 1403, checked in by Laurent Fairhead, 14 years ago

Merged LMDZ4V5.0-dev branch changes r1292:r1399 to trunk.

Validation:
Validation consisted in compiling the HEAD revision of the trunk,
LMDZ4V5.0-dev branch and the merged sources and running different
configurations on local and SX8 machines comparing results.

Local machine: bench configuration, 32x24x11, gfortran

  • IPSLCM5A configuration (comparison between trunk and merged sources):
    • numerical convergence on dynamical fields over 3 days
    • start files are equivalent (except for RN and PB fields)
    • daily history files equivalent
  • MH07 configuration, new physics package (comparison between LMDZ4V5.0-dev branch and merged sources):
    • numerical convergence on dynamical fields over 3 days
    • start files are equivalent (except for RN and PB fields)
    • daily history files equivalent

SX8 machine (brodie), 96x95x39 on 4 processors:

  • IPSLCM5A configuration:
    • start files are equivalent (except for RN and PB fields)
    • monthly history files equivalent
  • MH07 configuration:
    • start files are equivalent (except for RN and PB fields)
    • monthly history files equivalent

Changes to the makegcm and create_make_gcm scripts to take into account
main programs in F90 files


Fusion de la branche LMDZ4V5.0-dev (r1292:r1399) au tronc principal

Validation:
La validation a consisté à compiler la HEAD de le trunk et de la banche
LMDZ4V5.0-dev et les sources fusionnées et de faire tourner le modéle selon
différentes configurations en local et sur SX8 et de comparer les résultats

En local: 32x24x11, config bench/gfortran

  • pour une config IPSLCM5A (comparaison tronc/fusion):
    • convergence numérique sur les champs dynamiques après 3 jours
    • restart et restartphy égaux (à part sur RN et Pb)
    • fichiers histoire égaux
  • pour une config nlle physique (MH07) (comparaison LMDZ4v5.0-dev/fusion):
    • convergence numérique sur les champs dynamiques après 3 jours
    • restart et restartphy égaux
    • fichiers histoire équivalents

Sur brodie, 96x95x39 sur 4 proc:

  • pour une config IPSLCM5A:
    • restart et restartphy égaux (à part sur RN et PB)
    • pas de différence dans les fichiers histmth.nc
  • pour une config MH07
    • restart et restartphy égaux (à part sur RN et PB)
    • pas de différence dans les fichiers histmth.nc

Changement sur makegcm et create_make-gcm pour pouvoir prendre en compte des
programmes principaux en *F90

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 7.8 KB
Line 
1#!/bin/sh
2#
3# $Header$
4#
5#set -xv
6machine=`hostname`
7os=`uname`
8gcm=`pwd`
9libf=$gcm/libf
10libo=$gcm/libo
11CRAY=0
12if [ "$machine" = "atlas" -o "$machine" = "etoile" -o "$machine" = "axis" ] ; then
13  CRAY=1
14fi
15XNEC=0
16if [ "$machine" = "rhodes" ] ; then
17  XNEC=1
18fi
19X6NEC=0
20if [ "$machine" = "mercure" ] ; then
21  X6NEC=1
22fi
23X8BRODIE=0
24if [ "$machine" = "brodie" ] ; then
25  X8BRODIE=1
26fi
27VPP=0
28if [ "$machine" = "nymphea0" ] ; then
29  VPP=1
30fi
31#
32echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
33echo "# Definitions de Macros pour Make"
34echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
35echo
36echo "# Repertoires :"
37echo
38echo "GCM     = "$gcm
39echo 'LIBF    = $(GCM)/libf'
40if [ "$CRAY" = '0' ] ; then
41#   echo 'LIBO    = $(GCM)/libo/$(MACHINE)'
42   echo 'LIBO    = $(LIBOGCM)/$(MACHINE)'
43else
44   echo 'LIBO    = $(GCM)/libo'
45fi
46#echo 'LOCAL_DIR=$(GCM)'
47#echo $localdir
48echo "LOCAL_DIR=`echo $localdir`"
49echo 'BIBIO    = $(LIBF)/bibio'
50echo "FILTRE   = filtre"
51echo "PHYS  = "
52echo "DYN  = dyn "
53echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a'
54echo 'DIRMAIN=dyn$(DIM)d$(FLAG_PARA)'
55echo 'RM=rm'
56echo
57echo "OPLINK = "
58echo
59echo '# Les differentes librairies pour l"edition des liens:'
60echo
61if ( [ "$XNEC" = '1' ] || [ "$X6NEC" = '1' ] || [ "$X8BRODIE" = '1' ] ) ; then
62  echo 'dyn3d      = $(LIBO)/libsxdyn3d.a $(LIBO)/libsx$(FILTRE).a'
63  echo 'dyn3dpar     = $(LIBO)/libsxdyn3dpar.a $(LIBO)/libsx$(FILTRE).a'
64  echo 'dyn2d      = $(LIBO)/libsxdyn2d.a'
65  echo 'dyn1d      = $(LIBO)/libsxdyn1d.a'
66  echo 'L_DYN      = -lsxdyn$(DIM)d$(FLAG_PARA)'
67  echo 'L_FILTRE   = -lsx$(FILTRE)'
68  echo 'L_PHY = -lsxphy$(PHYS) '
69  echo 'L_BIBIO    = -lsxbibio'
70  echo 'L_ADJNT    ='
71  echo 'L_COSP     = -lsxcosp'
72else
73  echo 'dyn3d            = $(LIBO)/libdyn3d.a $(LIBO)/lib$(FILTRE).a'
74  echo 'dyn3dpar      = $(LIBO)/libdyn3dpar.a $(LIBO)/lib$(FILTRE).a'
75  echo 'dyn2d            = $(LIBO)/libdyn2d.a'
76  echo 'dyn1d            = $(LIBO)/libdyn1d.a'
77  echo 'L_DYN      = -ldyn$(DIM)d$(FLAG_PARA)'
78  echo 'L_FILTRE   = -l$(FILTRE)'
79  echo 'L_PHY = -lphy$(PHYS) '
80  echo 'L_BIBIO    = -lbibio'
81  echo 'L_ADJNT    ='
82  echo 'L_COSP     = -lcosp'
83fi
84
85echo
86echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
87echo "# Option de compilation FORTRAN"
88echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
89echo
90   echo 'COMPILE = $(F77) $(OPTIM) $(INCLUDE) -c'
91   echo 'COMPILE90 = $(F90) $(OPTIM90) $(INCLUDE) -c'
92   echo 'COMPTRU90 = $(F90) $(OPTIMTRU90) $(INCLUDE) -c'
93   echo "LINK    = $LINK"
94   echo "AR      = $AR"
95echo
96echo
97echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
98echo "# Creation des differents executables"
99echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
100echo
101echo "# Executables:"
102echo "# ------------"
103echo
104echo "PROG = code"
105echo
106#echo 'main : chimie $(DYN) bibio phys $(OPTION_DEP) '
107echo 'main : $(DYN) bibio phys $(OPTION_DEP) '
108echo '  cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\'
109echo '  cd $(LOCAL_DIR); \'
110echo '  $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \'
111echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_COSP) $(L_FILTRE) $(L_PHY) $(L_DYN) $(L_BIBIO) $(L_DYN) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
112echo
113echo 'dyn : $(LIBO)/libdyn$(DIM)d$(FLAG_PARA).a $(FILTRE)$(DIM)d'
114echo
115echo 'phys : $(LIBPHY)'
116echo
117#echo 'chimie : $(LIBO)/libchimie.a'
118echo
119echo 'bibio : $(LIBO)/libbibio.a'
120echo
121echo 'adjnt : $(LIBO)/libadjnt.a'
122echo
123echo 'cosp : $(LIBO)/libcosp.a'
124echo
125echo '$(FILTRE)3d : $(LIBO)/lib$(FILTRE).a'
126echo
127echo '$(FILTRE)2d :'
128echo
129echo '$(FILTRE)1d :'
130echo
131echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
132echo "# Contenu des differentes bibliotheques"
133echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
134echo
135echo
136cd $libf >/dev/null 2>&1
137for diri in ` ls `
138do
139   if [ -d $diri ] ; then
140   if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.F90`" != "" ]  ; then 
141      cd $diri >/dev/null 2>&1
142      echo
143      listlib=""
144      for i in `ls *.F`
145      do
146         fili=`basename $i .F`
147         test=` (  head $i | grep '      PROGRAM' ) `
148         if [ "$test" = "" ] ; then 
149            listlib=$listlib" "$fili
150         fi
151      done
152      for i in `ls *.F90`
153      do
154         fili=`basename $i .F90`
155         test=` (  head $i | grep '      PROGRAM' ) `
156         if [ "$test" = "" ] ; then
157            listlib=$listlib" "$fili
158         fi 
159      done
160#
161      echo
162      echo
163      echo "#======================================================================="
164      echo "# Contenu de la bibliotheque correspondant au Directory "$diri
165      echo "#======================================================================="
166      echo
167      for fili in $listlib
168      do
169         echo '$(LIBO)/lib'$diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"
170         echo
171      done
172      echo '.PRECIOUS   : $(LIBO)/lib'$diri'.a'
173      echo
174      echo
175      echo "# Compilation des membres de la bibliotheque lib"$diri".a"
176      echo
177      for fili in $listlib
178      do
179         if [ -f $fili.F90 ] ; then
180           trufile=$fili.F90
181         else
182           trufile=$fili.F
183         fi
184         F90=0 ; egrep -i '^ *use ' $trufile > /dev/null 2>&1 && F90=1
185                 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1
186                 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1
187         str1='$(LIBO)/lib'$diri'.a('$fili'.o) : $(LIBF)/'$diri/$trufile
188         [ "$fili" = "chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F
189         for stri in ` ( sed -n "/\#include/s/\#include//p" $trufile | sed 's/\"//g' ; egrep -i '^ *use ' $trufile | sed -e 's/,/ /' | awk ' { print $2 } ' ) `
190         do
191
192
193# Differents cas de dependance correspondant a des include ou des
194# use module.
195# soit dans le repertoire local soit dans un autre.
196
197            stri=`echo $stri | tr [A-Z] [a-z]`
198            if [ -f $stri ] ; then
199               echo $str1 \\
200               str1='$(LIBF)/'$diri'/'$stri
201            else
202               if [ -f $stri.F ] || [ -f $stri.F90 ] ; then
203                  echo $str1 \\
204                  str1='$(LIBO)/lib'$diri'.a('$stri'.o)'
205               else
206                  for dirinc in dyn3d grid bibio filtrez
207                  do
208                     if [ -f ../$dirinc/$stri ] ; then
209                        echo $str1 \\
210                        str1='$(LIBF)/'`cd .. ; ls */$stri | head -1`
211                     fi
212                     if [ -f ../$dirinc/$stri.F90 ] ; then
213                        echo $str1 \\
214                        str1='$(LIBO)/lib'$dirinc'.a('$stri'.o)'
215                     fi
216                  done
217               fi
218            fi
219         done
220         echo $str1
221         if [ "$F90" -eq '0' ] ; then
222           echo '       cd $(LOCAL_DIR); \'
223           echo '       $(COMPILE) $(LIBF)/'$diri'/'$trufile' ; \'
224         else
225           echo '       cd $(LOCAL_DIR); \'
226           if [ -f $fili.F90 ] ; then
227              echo '    $(COMPTRU90) $(LIBF)/'$diri'/'$trufile' ; \'
228           else
229              echo '    $(COMPILE90) $(LIBF)/'$diri'/'$trufile' ; \'
230           fi
231           MODU=0; egrep -i '^ *module ' $trufile> /dev/null 2>&1 && MODU=1
232            if [ "$MODU" -eq '1' -a "$CRAY" != '1' ] ; then
233              if [ "$os" = 'UNIX_System_V' ] ; then
234                echo '  cp $(MOD_LOC_DIR)/*.$(MOD_SUFFIX) $(LIBO)/ ; \'
235              else
236                echo '  mv $(MOD_LOC_DIR)/'$fili'.$(MOD_SUFFIX) $(LIBO)/'$fili'.$(MOD_SUFFIX) ; \'
237#                echo ' if [ "$(MOD_LOC_DIR)" ne "$(LIBO)" ] ; then mv $(MOD_LOC_DIR)/'*'.$(MOD_SUFFIX) $(LIBO) ; fi ; \'
238              fi
239            fi
240         fi
241         if ( [ "$XNEC" -eq '1' ] || [ "$X6NEC" = '1' ] || [ "$X8BRODIE" = '1' ] ) ; then
242           echo '       sxar r $(LIBO)/libsx'$diri'.a '$fili'.o ; \'
243         fi
244         echo ' $(AR) r $(LIBO)/lib'$diri'.a '$fili'.o ; $(RM) '$fili'.o ; \'
245         echo ' cd $(GCM)'
246         echo
247      done
248#       
249      echo
250   cd $libf
251   fi
252   fi
253done
Note: See TracBrowser for help on using the repository browser.