source: trunk/MESOSCALE/LMDZ.MARS.new/create_make_gcm @ 3553

Last change on this file since 3553 was 54, checked in by aslmd, 14 years ago

LMD_LES_MARS: Tests with new physics in unified frame
M 53 mesoscale/LMD_LES_MARS/modif_mars/module_model_constants.F
M 53 mesoscale/LMD_LES_MARS/modif_mars/module_first_rk_step_part1.F
M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F
Modifications made to cope with new soil scheme

M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd/libf/phymars/meso_physiq.F
Commented aeronomars in old physics so that the model can compile with lots of grid points


LMD_MM_MARS: Implement tracers with the new physics. Test with JBM runs with 5 tracers

including radiatively active dust and water ice

TODO: propagate reading "traceur.def" and few initialisations from

testphys1d.F into module_lmd_driver.F

M 53 mars/libf/phymars/dimradmars.h
M 53 mars/libf/phymars/callradite.F
Change it back to both dust and ice radiatively active

M 53 mesoscale/LMD_MM_MARS/makemeso
Allow to "fresh start" with the inclusion of "clean -a" in the script

M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM
M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F
M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F
M 53 mesoscale/LMD_MM_MARS/SRC/WRFV2/main/real_em.F
M 53 mesoscale/LMD_MM_MARS/SIMU/runmeso
Added the option mars==11 with 5 tracers: CO2 H2Ovap H2Oice DUST DUSTN
-- Note that the order matters for H2Ovap and H2Oice

LMD_MM_MARS: Create a folder to run LMD GCM with exact same physics as mesoscale

A 0 mesoscale/LMDZ.MARS/libf/phymars/physiq.F
All files in mesoscale/LMDZ.MARS/libf are links except this one
--> Because specific WRITEDIAGFI commands are set to output what is needed PREP_MARS
--> Something must be done so that qCO2, qdust, qdustN can be propagated too !!!

A 0 mesoscale/LMDZ.MARS/libf_gcm
A 0 mesoscale/LMDZ.MARS/in_lmdz_mars_newphys
Two important links that must not be broken

A 0 mesoscale/LMDZ.MARS/myGCM
This folder is for runs. Only links here -- except temp files which are not synchronized.

M 53 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/compile
A 0 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/myGCM/run.def
A 0 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/myGCM/traceur.def
M 53 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/myGCM/callphys.def
A 0 mesoscale/LMD_MM_MARS/SIMU/in_lmdz_mars_newphys/myGCM/callphys.def.csttau
Those files are needed to run the GCM in order to prepare initial & boundary

conditions for the mesoscale... but basically it is the exact same GCM

--> compile is a convenient script

A 0 mesoscale/LMDZ.MARS/makegcm
A 0 mesoscale/LMDZ.MARS/makegcm_g95
A 0 mesoscale/LMDZ.MARS/create_make_gcm
This is supposed to be merged one day with files in trunk/mars/

A 0 mesoscale/LMDZ.MARS/myGCM/DEFS_JB
Necessary files to restart a GCM run corresponding to new water cycle in JB's thesis

  • Property svn:executable set to *
File size: 8.2 KB
Line 
1#!/bin/sh
2#set -xv
3#
4# Ehouarn: added the following feature:
5#          create_make_gcm must be called with list of directories
6#          which contain header (or modules) which should be scanned
7#          by create_make_gcm when checking dependencies.
8#          Example:
9#          create_make_gcm dyn3d grid
10#          means that header/modules will be looked for in directories
11#          ., dyn3d and grid
12#
13machine=`hostname`
14os=`uname`
15gcm=`pwd`
16libf=$gcm/libf
17libo=$gcm/libo
18CRAY=0
19if [ "$machine" = "atlas" -o "$machine" = "etoile" -o "$machine" = "axis" ] ; then
20  CRAY=1
21fi
22XNEC=0
23if [ "$machine" = "rhodes" ] ; then
24  XNEC=1
25fi
26VPP=0
27if [ "$machine" = "nymphea0" ] ; then
28  VPP=1
29fi
30#
31echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
32echo "# Definitions de Macros pour Make"
33echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
34echo 
35echo "# create_make_gcm arguments: $*"
36echo
37echo "# Repertoires :"
38echo
39echo "GCM     = "$gcm
40if [ "$CRAY" = '0' ] ; then
41   echo "MACHINE = sun4"
42fi
43echo 'LIBF    = $(GCM)/libf'
44if [ "$CRAY" = '0' ] ; then
45#   echo 'LIBO    = $(GCM)/libo/$(MACHINE)'
46   echo 'LIBO    = $(LIBOGCM)/$(MACHINE)'
47else
48   echo 'LIBO    = $(GCM)/libo'
49fi
50#echo 'LOCAL_DIR=$(GCM)'
51#echo $localdir
52echo "LOCAL_DIR=`echo $localdir`"
53echo 'BIBIO    = $(LIBF)/bibio'
54echo 'AERONOMARS    = $(LIBF)/aeronomars'
55echo "FILTRE   = filtre"
56echo "PHYS  = "
57echo 'DYN  = $(DYNTYPE)'
58echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a'
59echo 'DIRMAIN= $(DYN)$(DIM)d'
60echo 'RM=rm'
61echo
62echo "OPLINK = "
63echo
64echo '# Les differentes librairies pour l"edition des liens:'
65echo
66if [ "$XNEC" = '1' ] ; then
67  echo 'dyn3d      = $(LIBO)/libsxdyn3d.a $(LIBO)/libsx$(FILTRE).a'
68  echo 'dyn2d      = $(LIBO)/libsxdyn2d.a'
69  echo 'dyn1d      = $(LIBO)/libsxdyn1d.a'
70  echo 'L_DYN      = -lsxdyn$(DIM)d'
71  echo 'L_FILTRE   = -lsx$(FILTRE)'
72  echo 'L_PHY = -lsxphy$(PHYS) '
73  echo 'L_BIBIO    = -lsxbibio'
74  echo 'L_AERONOMARS    = -lsxaeronomars'
75  echo 'L_ADJNT    ='
76else
77  echo 'dyn3d      = $(LIBO)/libdyn3d.a $(LIBO)/lib$(FILTRE).a'
78  echo 'dyn2d      = $(LIBO)/libdyn2d.a'
79  echo 'dyn1d      = $(LIBO)/libdyn1d.a'
80  echo 'L_DYN      = -l$(DYN)$(DIM)d'
81  echo 'L_FILTRE   = -l$(FILTRE)'
82  echo 'L_PHY = -lphy$(PHYS) '
83  echo 'L_BIBIO    = -lbibio'
84  echo 'L_AERONOMARS    = -laeronomars'
85  echo 'L_ADJNT    ='
86fi
87echo
88echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
89echo "# Option de compilation FORTRAN"
90echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
91echo
92   echo 'COMPILE = $(F77) $(OPTIM) $(INCLUDE) -c'
93   echo 'COMPILE90 = $(F90) $(OPTIM90) $(INCLUDE) -c'
94   echo 'COMPTRU90 = $(F90) $(OPTIMTRU90) $(INCLUDE) -c'
95   echo "LINK    = $LINK"
96   echo "AR      = $AR"
97echo
98echo
99echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
100echo "# Creation des differents executables"
101echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
102echo
103echo "# Executables:"
104echo "# ------------"
105echo
106echo "PROG = code"
107echo
108echo 'main : $(DYN) bibio phys aeronomars $(OPTION_DEP) '
109echo '  cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\'
110echo '  cd $(LOCAL_DIR); \'
111echo '  $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(PROG).F -o $(PROG).o ; \'
112if [ "$CRAY" = '0' ] ; then
113echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_BIBIO) $(L_DYN) $(L_AERONOMARS) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
114else
115echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_BIBIO) $(L_DYN) $(L_AERONOMARS) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
116fi
117echo
118echo 'dyn : $(LIBO)/libdyn$(DIM)d.a $(FILTRE)$(DIM)d'
119echo
120echo 'olddyn : $(LIBO)/libolddyn$(DIM)d.a $(FILTRE)$(DIM)d'
121echo
122echo 'phys : $(LIBPHY)'
123echo
124echo 'bibio : $(LIBO)/libbibio.a'
125echo
126echo 'aeronomars : $(LIBO)/libaeronomars.a'
127echo
128echo 'adjnt : $(LIBO)/libadjnt.a'
129echo
130echo '$(FILTRE)3d : $(LIBO)/lib$(FILTRE).a'
131echo
132echo '$(FILTRE)2d :'
133echo
134echo '$(FILTRE)1d :'
135echo
136echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
137echo "# Contenu des differentes bibliotheques"
138echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
139echo
140echo
141cd $libf >/dev/null 2>&1
142for diri in ` ls `
143do
144   if [ -d $diri ] ; then
145   if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.F90`" != "" ]  ; then 
146      cd $diri >/dev/null 2>&1
147      echo
148      listlib=""
149      for i in `ls *.F`
150      do
151         fili=`basename $i .F`
152         test=` (  head $i | grep '      PROGRAM' ) `
153         if [ "$test" = "" ] ; then 
154            listlib=$listlib" "$fili
155         fi
156      done
157      for i in `ls *.F90`
158      do
159         fili=`basename $i .F90`
160         test=` (  head $i | grep '      PROGRAM' ) `
161         if [ "$test" = "" ] ; then
162            listlib=$listlib" "$fili
163         fi 
164      done
165#
166      echo
167      echo
168      echo "#======================================================================="
169      echo "# Contenu de la bibliotheque correspondant au Directory "$diri
170      echo "#======================================================================="
171      echo
172      for fili in $listlib
173      do
174         echo '$(LIBO)/lib'$diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"
175         echo
176      done
177      echo '.PRECIOUS   : $(LIBO)/lib'$diri'.a'
178      echo
179      echo
180      echo "# Compilation des membres de la bibliotheque lib"$diri".a"
181      echo
182      for fili in $listlib
183      do
184         if [ -f $fili.F90 ] ; then
185           trufile=$fili.F90
186         else
187           trufile=$fili.F
188         fi
189         F90=0 ; egrep -i '^ *use ' $trufile > /dev/null 2>&1 && F90=1
190                 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1
191                 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1
192         str1='$(LIBO)/lib'$diri'.a('$fili'.o) : $(LIBF)/'$diri/$trufile
193         [ "$fili" = "chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F
194         for stri in ` ( sed -n "/\#include/s/\#include//p" $trufile | sed 's/\"//g' ; egrep -i '^ *use ' $trufile | sed -e 's/,/ /' | awk ' { print $2 } ' ) `
195         do
196            stri=`echo $stri | tr [A-Z] [a-z]`
197            if [ -f $stri ] ; then
198               echo $str1 \\
199               str1='$(LIBF)/'$diri'/'$stri
200            else
201               if [ -f $stri.F ] || [ -f $stri.F90 ] ; then
202                  echo $str1 \\
203                  str1='$(LIBO)/lib'$diri'.a('$stri'.o)'
204               else
205#                  for dirinc in dyn3d grid bibio aeronomars phymars
206                  for dirinc in $*
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.