source: trunk/mesoscale/LMD_MM_MARS/SIMU/runmeso @ 54

Last change on this file since 54 was 54, checked in by aslmd, 15 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: 19.1 KB
Line 
1#! /bin/bash
2
3#########################################################
4# runmeso :                                             #
5# utility to combine compilation + preprocessing + run  #
6#########################################################
7###############################
8# Author: A. Spiga            #
9# New version : December 2008 #
10# Modified    : 2009-2010     #
11# New physics : 2011          #
12###############################
13
14# TODO: - GCM compile
15#       - NETCDF
16#       - (modif registry)
17#       - quick restart
18
19
20###########################################
21###########################################
22###########################################
23
24
25changeregis=0 ## 1 if changed registry
26#changeregis=1 ## 1 if changed registry
27i_want_to_compile=1
28
29if [[ "${LMDMOD}" = "" ]]
30then
31    echo "Please initialize the variable LMDMOD in your environnement (or modify scripts)"
32    exit
33fi
34####################################
35# A FEW DEFINITIONS YOU CAN MODIFY #
36####################################
37main_folder=$LMDMOD
38meso_folder=${main_folder}'/LMD_MM_MARS'
39gcm_folder=${main_folder}'/LMDZ.MARS/myGCM'
40calendar=${main_folder}'/LMD_MM_MARS/SIMU/calendar'
41simu_folder=$PWD
42
43
44################
45# WELCOME USER #
46################
47echo '**********************************************'
48echo '**** LMD Martian Mesoscale Model launcher ****'
49echo '**********************************************'
50#echo '** Hello '$(whoami)' on '$(hostname)' !'
51#echo '** ['$(uname -a)']'
52echo '** User                  >>> '$(whoami)
53echo '** Hostname              >>> '$(hostname)
54echo '** Hardware              >>> '$(uname -m)
55echo '** Processor             >>> '$(uname -p)
56echo '**********************************************'
57
58       ######## NEWPHYS ???
59       if [[ ! ( -f "run.def" ) ]]
60       then
61         newphys=0
62       else
63         echo '** New LMD physics       >>> YES [run.def is here]'
64         echo '**********************************************'
65         newphys=1
66       fi
67
68##########################
69# GET INFO FROM NAMELIST #
70##########################
71#echo '***********************'
72#echo '**** Your settings ****'
73#echo '***********************'
74echo '** Simulation directory  >>> '${simu_folder}
75if [[ ! ( -f "namelist.input" ) ]]
76then
77   echo 'no namelist.input file !'
78   exit
79fi
80#
81# READ INFO NEEDED FOR INIT
82#
83year=$(more ${simu_folder}/namelist.input | grep start_year | awk '{print $3}' | sed s+','+''+g)
84month=$(more ${simu_folder}/namelist.input | grep start_month | awk '{print $3}' | sed s+','+''+g)
85day=$(more ${simu_folder}/namelist.input | grep start_day | awk '{print $3}' | sed s+','+''+g)
86hour=$(more ${simu_folder}/namelist.input | grep start_hour | awk '{print $3}' | sed s+','+''+g)
87wrf_date=${year}'-'${month}'-'${day}'_00:00:00'
88daygcm=$(more ${calendar} | grep ${wrf_date} | awk '{print $2}')
89lsubs=$(more ${calendar} | grep ${wrf_date} | awk '{print $3}')
90eyear=$(more ${simu_folder}/namelist.input | grep end_year | awk '{print $3}' | sed s+','+''+g)
91emonth=$(more ${simu_folder}/namelist.input | grep end_month | awk '{print $3}' | sed s+','+''+g)
92eday=$(more ${simu_folder}/namelist.input | grep end_day | awk '{print $3}' | sed s+','+''+g)
93ehour=$(more ${simu_folder}/namelist.input | grep end_hour | awk '{print $3}' | sed s+','+''+g)
94ewrf_date=${eyear}'-'${emonth}'-'${eday}'_00:00:00'
95edaygcm=$(more ${calendar} | grep ${ewrf_date} | awk '{print $2}')
96elsubs=$(more ${calendar} | grep ${ewrf_date} | awk '{print $3}')
97echo '** Start date            >>> '${year}'-'${month}'-'${day}" [sol="${daygcm}", Ls="${lsubs}"]"
98echo '** End date              >>> '${eyear}'-'${emonth}'-'${eday}" [sol="${edaygcm}", Ls="${elsubs}"]"
99#
100# READ INFO NEEDED FOR DOMAIN
101#
102interval_seconds="$(more ${simu_folder}/namelist.input | grep -e '[^!]*interval_seconds *=')"
103if [[ "${interval_seconds}" = "" ]]
104then
105     interval_seconds="interval_seconds = 3700 !! (p2) Frequency of large-scale fields update (s)"
106fi
107#
108max_dom="$(more ${simu_folder}/namelist.input | grep -e '[^!]*max_dom *=')"
109if [[ "${max_dom}" = "" ]]
110then
111     max_dom="max_dom = 1 !! (r)(n)(p2) Total number of domains"
112fi
113#
114parent_id="$(more ${simu_folder}/namelist.input | grep -e '[^!]*parent_id *=')"
115if [[ "${parent_id}" = "" ]]
116then
117     parent_id="parent_id = 0, !! (n)(p2) Associated parent domain"
118fi
119#
120i_parent_start="$(more ${simu_folder}/namelist.input | grep -e '[^!]*i_parent_start *=')"
121if [[ "${i_parent_start}" = "" ]]
122then
123     i_parent_start="i_parent_start = 0, !! (n)(p2) x-position of the bottom-left nest corner"
124fi
125#
126j_parent_start="$(more ${simu_folder}/namelist.input | grep -e '[^!]*j_parent_start *=')"
127if [[ "${j_parent_start}" = "" ]]
128then
129     j_parent_start="j_parent_start = 0, !! (n)(p2) y-position of the bottom-left nest corner"
130fi
131#
132parent_grid_ratio="$(more ${simu_folder}/namelist.input | grep -e '[^!]*parent_grid_ratio *=')"
133if [[ "${parent_grid_ratio}" = "" ]]
134then
135     parent_grid_ratio="parent_grid_ratio = 1, !! (n)(p2) Ratio of horizontal resolution parent/nest"
136fi
137#
138e_we="$(more ${simu_folder}/namelist.input | grep -e '[^!]*e_we *=')"
139e_sn="$(more ${simu_folder}/namelist.input | grep -e '[^!]*e_sn *=')"
140#
141dx="$(more ${simu_folder}/namelist.input | grep -e '[^!]*dx *=' | awk '{print $3}' | sed s+','+''+g)"
142dy="$(more ${simu_folder}/namelist.input | grep -e '[^!]*dy *=' | awk '{print $3}' | sed s+','+''+g)"
143
144
145#
146# READ INFO NEEDED FOR COMPILATION
147#
148nx=$(more ${simu_folder}/namelist.input | grep -e '[^!]*e_we *=' | awk '{print $3}' | sed s+','+''+g)
149ny=$(more ${simu_folder}/namelist.input | grep -e '[^!]*e_sn *=' | awk '{print $3}' | sed s+','+''+g)
150nz=$(more ${simu_folder}/namelist.input | grep -e '[^!]*e_vert *=' | awk '{print $3}' | sed s+','+''+g)
151nest=$(more ${simu_folder}/namelist.input | grep -e '[^!]*max_dom *=' | awk '{print $3}' | sed s+','+''+g)
152  if [[ "${nest}" = "" ]]
153  then
154     nest='1'
155  fi
156  numcallphys=$(ls callphys*def | wc -l)
157  if [[ ${numcallphys} -lt ${nest} ]]
158  then
159        echo '**********'
160        echo You should have ${nest} callphys.def' file(s)' !!
161        exit
162  fi
163tracers=$(more ${simu_folder}/namelist.input | grep mars | awk '{print $3}' | sed s+','+''+g)
164  case ${tracers} in
165      0) tracers='1' ;;
166      1) tracers='2' ;;
167     11) tracers='5' ;;
168      *) tracers='1' ;;
169  esac
170echo '** Domain(s)             >>> '${nest}
171echo '** Tracer(s)             >>> '${tracers}
172echo '** Grid points           >>> '${nx}" x "${ny}" x "${nz}
173echo '** Horizontal resolution >>> '${dx}
174#echo "OK ? ('no' to exit, any key if OK)" ; read wellok
175#  if [[ "${wellok}" = "no" ]]
176#  then
177#     exit
178#  fi
179
180###########
181# ACTIONS #
182###########
183#echo '***********************'
184#echo '****     Steps     ****'
185#echo '***********************'
186echo '**********************************************'
187echo "** This script will compile the model then :"
188echo "**      <1> Prepare GCM inputs          <-1> to skip compilation"
189echo "**      <2> Perform WPS interpolations  <-2> to skip compilation"
190echo "**      <3> Execute real.exe            <-3> to skip compilation"
191echo "**      <4> Execute wrf.exe             <-4> to skip compilation"
192echo "**      <5> Exit"
193echo "**      <9> Oops ! Exit now please."
194echo '**********************************************'
195#echo "Start at which step ? (1-4)" ; read step
196echo "Where shall we start ? 1, 2, 3, 4, 5 or 9" ; read step
197if [[ ${step} -lt 0 ]]
198then
199        step=$(expr 0 - ${step})
200        i_want_to_compile=0
201        echo ".... ok, I skip the compiling & linking step. you'll just be asked the compiler you previously defined."
202fi
203case ${step} in
204        9) exit ;;
205        5) gcmstep=0 ; wpsstep=0 ; realstep=0 ; wrfstep=0 ;;
206        1) gcmstep=1 ; wpsstep=1 ; realstep=1 ; wrfstep=1 ;;
207        2) gcmstep=0 ; wpsstep=1 ; realstep=1 ; wrfstep=1 ;;
208        3) gcmstep=0 ; wpsstep=0 ; realstep=1 ; wrfstep=1 ;;
209        4) gcmstep=0 ; wpsstep=0 ; realstep=0 ; wrfstep=1 ;;
210        *) echo "** I guess you do not know what to do. Let's start from the beginning." 
211           gcmstep=1 ; wpsstep=1 ; realstep=1 ; wrfstep=1 ;;
212esac
213
214
215###################################
216# LINK THE EXECUTABLES OR COMPILE #
217###################################
218 echo '**********************************************'
219 echo "** Compiling option "
220 echo "**      <1> pgf90"
221 echo "**      <2> g95"
222 echo "**      <3> mpi+pgf90"
223 echo "**      .... more in makemeso ...."
224 echo '**********************************************'
225 echo "Your choice ? (1-3)" ; read compilo
226   if [[ "${compilo}" == "" || ${compilo} -lt 1 || ${compilo} -gt 3 ]]
227   then
228       echo "** well, let's try g95"
229       compilo=2
230   fi
231   if [[ ${compilo} -eq 3 ]]
232   then
233       echo How many processors ? 1, 2, 4, 6, 8, 16 ; read numproc
234   else
235       numproc=1
236   fi
237#if [[ ${i_want_to_compile} -ge 1 ]]
238#then
239 cd ${meso_folder}
240 echo ${compilo} > tmp
241   if [[ ${compilo} -eq 3 ]]
242   then
243        echo ${numproc} >> tmp
244   fi
245 echo ${nest} >> tmp
246
247 if [[ ${newphys} -eq 0 ]]
248 then
249 ./makemeso -d < tmp > /dev/null
250 else
251 ./makemeso -d -p < tmp > /dev/null
252 fi
253
254 \rm tmp 2> /dev/null
255 work_folder=${meso_folder}'/'$(more what_folder)
256 echo 'work_folder : '${work_folder}
257 \rm what_folder 2> /dev/null
258
259 ##################### NB: define the domain if was not done yet
260   if [[ -f "${simu_folder}/namelist.wps" ]]
261   then
262     happy='y'
263   else
264     happy=''
265   fi
266           if [[ ${step} -le 2 ]]
267           then
268           while [[ "${happy}" != "y" ]]
269           do
270             #vi ${simu_folder}/namelist.input
271                if [[ ! ( -d "${work_folder}/WPS" ) ]]
272                then
273                    echo 'no WPS. you need to install it for your architecture'
274                    exit
275                fi
276             \rm ${simu_folder}/namelist.wps 2> /dev/null
277             echo '**********************************************'
278             echo "    !!!   NO namelist.wps FILE FOUND   !!!"   
279             echo '**********************************************'
280             echo 'Please define the domain (not for nests for the moment) : '
281             echo " - 1/4 Projection: polar lambert mercator ? previous is "${proj} ; read proj
282             echo " - 2/4 Data source (multiple if nests): 'gcm' '32ppd' '64ppd' '64ppd_noHRti' '32ppd_HRalb' ? previous is "${data_source} ; read data_source
283             echo " - 3/4 North Latitude of domain centre ? previous is "${lat} ; read lat
284             echo " - 4/4 East  Longitude of domain centre ? previous is "${lon} ; read lon
285             #####
286             sed s+"__INTERVAL_SECONDS__"+"${interval_seconds}"+g ${meso_folder}/SIMU/namelist.wps | sed s+"__MAX_DOM__"+"${max_dom}"+g | sed s+"__PARENT_ID__"+"${parent_id}"+g |  sed s+"__PARENT_GRID_RATIO__"+"${parent_grid_ratio}"+g |  sed s+"__I_PARENT_START__"+"${i_parent_start}"+g | sed s+"__J_PARENT_START__"+"${j_parent_start}"+g | sed s+"__E_WE__"+"${e_we}"+g | sed s+"__E_SN__"+"${e_sn}"+g | sed s+"__DX__"+"${dx}"+g | sed s+"__DY__"+"${dy}"+g | sed s+"__PROJ__"+"${proj}"+g | sed s+"__DATA_SOURCE__"+"${data_source}"+g | sed s+"__LAT__"+"${lat}"+g | sed s+"__LON__"+"${lon}"+g | sed s+'0000-00-00_00:00:00'+${year}'-'${month}'-'${day}'_'${hour}':00:00'+g | sed s+'1111-11-11_11:11:11'+${eyear}'-'${emonth}'-'${eday}'_'${ehour}':00:00'+g > ${simu_folder}/namelist.wps
287             ####
288             ln -sf ${simu_folder}/namelist.wps ${work_folder}/WPS/namelist.wps
289             #vi       ${work_folder}/WPS/namelist.wps
290             echo '**********************************************'
291             echo OK, thank you. Please wait... ncview will pop up soon !
292             cd ${work_folder}/WPS/
293             \rm geo_em.d0*.nc 2> /dev/null
294             ./geogrid.exe > /dev/null 2> /dev/null
295             ncview geo_em.d01.nc > /dev/null 2> /dev/null &
296                if [[ -f "geo_em.d02.nc" ]]
297                then
298                     ncview geo_em.d02.nc > /dev/null 2> /dev/null &
299                fi
300                if [[ -f "geo_em.d03.nc" ]]
301                then
302                     ncview geo_em.d03.nc > /dev/null 2> /dev/null &
303                fi
304             cd       ${simu_folder}/
305             echo     '**********************************************' 
306             echo     'Are you happy with the results ? type y if yes, any key if no' ; read happy
307            done
308            fi
309 #####################
310 if [[ ${i_want_to_compile} -ge 1 ]]
311 then
312 cd ${simu_folder}
313     ## corresponding executables
314    wrfexe=${work_folder}/wrf_x${nx}_y${ny}_z${nz}_d${nest}_t${tracers}_p${numproc}.exe
315    realexe=${work_folder}/real_x${nx}_y${ny}_z${nz}_d${nest}_t${tracers}_p${numproc}.exe
316 if [[ -f ${wrfexe} ]]
317 then
318     echo '**********************************************'
319     echo "    !!!   wrf.exe exists in ${work_folder}"
320     echo '**********************************************'
321     echo "Recompile ? ('yes' to accept, any key to refuse)" ; read reply
322 else
323     reply='yes'
324 fi
325 echo '********************************************** OK thanks. Now please wait...'
326 echo '                                       '
327 if [[ "${reply}" == "yes" ]]
328 then
329 #####################
330 echo "** "Begin compilation process...
331 \rm ${wrfexe} 2> /dev/null
332 \rm ${realexe} 2> /dev/null
333   #
334   # CREATE makemeso_input
335   #
336   \rm ${simu_folder}/makemeso_input 2> /dev/null
337   touch ${simu_folder}/makemeso_input
338   echo ${compilo} >> ${simu_folder}/makemeso_input
339   if [[ "${compilo}" = "3" ]]
340     then
341         echo ${numproc} >> ${simu_folder}/makemeso_input
342   fi
343   echo ${nx} >> ${simu_folder}/makemeso_input
344   echo ${ny} >> ${simu_folder}/makemeso_input
345   echo ${nz} >> ${simu_folder}/makemeso_input
346   echo ${nest} >> ${simu_folder}/makemeso_input
347   echo ${tracers} >> ${simu_folder}/makemeso_input
348   #echo 'y' >> ${simu_folder}/makemeso_input
349   #
350   # COMPILE THE MODEL
351   #
352   cd ${meso_folder}
353                      if [[ "${changeregis}" = "1" ]]
354                      then
355                          cd ${work_folder}/WRFV2/Registry
356                          \rm Registry 2> /dev/null
357                          ./Registry.bash
358                          cd ../../..
359                      fi
360
361     ##******
362     if [[ ${newphys} -eq 0 ]]
363     then
364       ./makemeso -r < ${simu_folder}/makemeso_input
365     else
366       ./makemeso -r -p < ${simu_folder}/makemeso_input
367     fi
368     ##******
369
370
371   if [[ -f ${wrfexe} ]]
372   then
373       echo "** "seems OK ... linking executables
374       ln -sf ${wrfexe} ${simu_folder}/wrf.exe
375       ln -sf ${realexe} ${simu_folder}/real.exe
376       chmod a+x ${realexe} ${wrfexe} ## sait-on jamais
377       cd $simu_folder
378   else
379       echo no ${wrfexe}
380       echo problem with the compilation
381       exit
382   fi
383 else
384     #echo simply linking existing executables...
385     ln -sf ${wrfexe} ${simu_folder}/wrf.exe
386     ln -sf ${realexe} ${simu_folder}/real.exe
387     chmod a+x ${realexe} ${wrfexe} ## sait-on jamais
388 fi
389fi
390
391######################################
392# 1. RUN GCM FOR INIT/BDY CONDITIONS #
393######################################
394if [ ${gcmstep} -eq 1 ]
395then
396 echo '************************************'
397 echo '**** Step 1: Prepare GCM inputs ****'
398 echo '************************************'
399        #
400        # run GCM
401        #
402        cd ${gcm_folder}
403         #echo '(during the run, you might like to check domain settings in '${work_folder}'/WPS)'
404        echo ${daygcm} | ./launch_gcm
405        #
406        # prepare files for WPS
407        #
408        cd ${work_folder}
409        if [[ -f ${work_folder}/PREP_MARS/create_readmeteo.exe && -f ${work_folder}/PREP_MARS/readmeteo.exe ]]
410        then
411              cd ${work_folder}/PREP_MARS/ 
412                ./compile_and_exec
413              #echo 1 | ./create_readmeteo.exe
414              #./readmeteo.exe < readmeteo.def
415        else
416              echo please compile the PREP_MARS utilities in ${work_folder}
417              exit
418        fi
419fi     
420
421###################################
422# 2. RUN WRF PREPROCESSING SYSTEM #
423###################################
424if [ ${wpsstep} -eq 1 ]
425then
426 echo '*****************************************'
427 echo '**** Step 2: Perform WPS interpolations *'
428 echo '*****************************************'
429        if [[ -f ${work_folder}/WPS/geogrid.exe && -f ${work_folder}/WPS/metgrid.exe ]]
430        then
431              \rm -rf ${simu_folder}/met_em 2> /dev/null
432              mkdir ${simu_folder}/met_em
433              cd ${work_folder}/WPS/
434              \rm -rf ${work_folder}/WPS/WRFFEED/current 2> /dev/null
435              mkdir ${work_folder}/WPS/WRFFEED/current
436              ln -sf ${simu_folder}/namelist.wps ${work_folder}/WPS/namelist.wps
437              #mv namelist.wps namelist.wps.tmp
438              #sed s+'0000-00-00_00:00:00'+${year}'-'${month}'-'${day}'_'${hour}':00:00'+g namelist.wps.tmp | sed s+'1111-11-11_11:11:11'+${eyear}'-'${emonth}'-'${eday}'_'${ehour}':00:00'+g > namelist.wps
439              ./geogrid.exe
440              ./metgrid.exe
441              #mv namelist.wps ${simu_folder}
442              #mv namelist.wps.tmp namelist.wps 
443              namedata=$(date +simu_%d%h%Y_%H%M)
444              mv ${work_folder}/WPS/WRFFEED/current ${work_folder}'/WPS/WRFFEED/'${namedata}
445              echo met_em files in $namedata
446              cd ${simu_folder}/met_em
447              ln -sf ${work_folder}/WPS/WRFFEED/${namedata}/* .
448              cd ${simu_folder}
449        else
450              echo please compile the WPS utilities in ${work_folder}
451              exit
452        fi
453fi     
454
455###################
456# 3. RUN REAL.EXE #
457###################
458if [ ${realstep} -eq 1 ]
459then
460 echo '*******************************'
461 echo '**** Step 3: Execute real.exe *'
462 echo '*******************************'
463        cd ${simu_folder}
464        if [[ ! -d met_em ]]
465        then
466                ls
467                echo "PB: no met_em files:"
468                echo "mkdir met_em folder then link met_em** files !"
469                exit
470        fi
471        cd ${simu_folder}/met_em
472        ln -sf ${simu_folder}/namelist.input .
473        ln -sf ${simu_folder}/real.exe .
474        rm -rf ${simu_folder}/met_em/wrfbdy* 2> /dev/null
475        rm -rf ${simu_folder}/met_em/wrfinput* 2> /dev/null
476        if [[ ${compilo} -eq 3 ]]
477        then
478                rm -rf ${simu_folder}/met_em/rsl.* 2> /dev/null
479                echo "check in "${simu_folder}"/met_em/rsl.out.0000"
480                ./real.exe
481                tail -n 4 ${simu_folder}"/met_em/rsl.out.0000"
482        else
483                rm -rf ${simu_folder}/met_em/log* 2> /dev/null
484                echo "check in "${simu_folder}"/met_em/log_real"
485                real.exe > log_real
486                tail -n 4 ${simu_folder}"/met_em/log_real"
487        fi
488        if [[ -f ${simu_folder}/met_em/wrfinput_d01 && -f ${simu_folder}/met_em/wrfbdy_d01 ]]
489        then
490                echo ok... link ini and bdy conditions
491                cd ${simu_folder}
492                ln -sf ${simu_folder}/met_em/wrf*_d0* .
493        else
494                echo mmm... there was a problem, see log files in met_em
495                exit
496        fi
497fi
498
499##################
500# 4. RUN WRF.EXE #
501##################
502if [ ${wrfstep} -eq 1 ]
503then
504 xeyes &
505 echo '******************************'
506 echo '**** Step 4: Execute wrf.exe *'
507 echo '******************************'
508        cd ${simu_folder}
509        rm -rf ${simu_folder}/wrfout*
510        if [[ ${compilo} -eq 3 ]]
511        then
512                rm -rf ${simu_folder}/rsl.* 2> /dev/null
513#                ${WHERE_MPI}/mpirun -host smith -np ${numproc} wrf.exe < /dev/null &
514                ${WHERE_MPI}/mpirun -np ${numproc} wrf.exe < /dev/null &
515        else
516                rm -rf ${simu_folder}/log* 2> /dev/null
517                nohup wrf.exe > log_wrf &
518        fi
519echo OK ! Simulation should be running now !
520echo Check with the command: "ps -e -o '%u %p %C %x %c' | grep wrf.exe"
521echo '******************************'
522echo '**** End.'
523
524fi
525exit
526
527
528
Note: See TracBrowser for help on using the repository browser.