indexing typo in phys/module_fr_sfire_atm.F/interpolate_wind2fire_height/interpolate_h
[wrf-fire.git] / standalone / fire.py
blob7062415fe63bdead1de9eab7ac5d7f2e3aa6a3c7
1 #!/usr/bin/env python
3 from optparse import OptionParser
4 import subprocess as sp
6 nmls=('namelist.input','namelist.fire')
8 usage='usage: %prog [options]'
9 o=OptionParser(usage)
11 o.add_option('--nx',action='store',type='int',dest='nx')
12 o.add_option('--ny',action='store',type='int',dest='ny')
13 o.add_option('--dx',action='store',type='float',dest='dx')
14 o.add_option('--dy',action='store',type='float',dest='dy')
16 o.add_option('--windx',action='store',type='float',dest='windx')
17 o.add_option('--windy',action='store',type='float',dest='windy')
18 o.add_option('--slopex',action='store',type='float',dest='slopex')
19 o.add_option('--slopey',action='store',type='float',dest='slopey')
21 o.add_option('--runtime',action='store',type='int',dest='runseconds')
22 o.add_option('--history',action='store',type='int',dest='historys')
23 o.add_option('--timestep',action='store',type='float',dest='timestep')
25 for s in ('ignros','ignx1','igny1','ignx2','igny2','ignr','ignt1','ignt2'):
26 o.add_option('--'+s,action='store',type='float',dest=s)
28 fcats=[ str(i) for i in xrange(1,14) ]
29 o.add_option('--fuelcat',action='store',choices=fcats,dest='fuelcat')
31 o.add_option('--debug',action='store_true',dest='debug')
33 o.set_defaults(nx=200,ny=200,dx=6,dy=6,windx=2,windy=1,
34 slopex=.5,slopey=-.25,runseconds=60*60,historys=60,
35 timestep=.25,ignros=.1,ignx1=500,ignx2=500,
36 igny1=500,igny2=500,ignr=10,ignt1=2,ignt2=2,
37 fuelcat=3,debug=False)
39 (opts,args)=o.parse_args()
40 opts=opts.__dict__
42 time=opts.pop('timestep')
43 opts['times']=int(time)
44 opts['timen']=int( 1000*(time-int(time)) )
45 opts['timed']=1000
47 debug=opts.pop('debug')
48 if debug:
49 opts['debuglvl']=2
50 else:
51 opts['debuglvl']=0
53 opts['fuelcat']=int(opts['fuelcat'])
55 for n in nmls:
56 s=open(n+'.template','r').read()
57 open(n,'w').write(s % opts)
59 p=sp.Popen('./init.exe')
60 p.communicate()
62 p=sp.Popen('./fire.exe')
63 p.communicate()