Merge branch 'fixf'
[wrf-fire-matlab.git] / detection / sfire_simple_ext.m
blobb4b11dee0cbd551e3ea863abf639492530a5f1b5
1 function t1=sfire_simple_ext(rr,t0,mask,ncycles)
2 % in:
3 % rr            structure with 2d fields r11...r33 
4 % t0            starting tign
5 % mask          if not 0, update 
6 % out:
7 % t1            updated ignition times
9 if ncycles<=0,
10     [m,n]=size(rr.r11);
11     f=fopen('r.dat','w');
12     ft_write(f,[m,n],'int')
13     ft_write(f,rr.r11,'double')
14     ft_write(f,rr.r12,'double')
15     ft_write(f,rr.r13,'double')
16     ft_write(f,rr.r21,'double')
17     ft_write(f,rr.r23,'double')
18     ft_write(f,rr.r31,'double')
19     ft_write(f,rr.r32,'double')
20     ft_write(f,rr.r33,'double')
21     fclose(f);
22 else
23     [m,n]=size(t0);
24     f=fopen('in.dat','w');
25     ft_write(f,ncycles,'int')
26     ft_write(f,t0,'double')
27     ft_write(f,mask,'double')
28     fclose(f);
29     ! DYLD_FRAMEWORK_PATH=; DYLD_LIBRARY_PATH=; GFORTRAN_STDOUT_UNIT=6; ./sfire_simple.exe
30     f=fopen('out.dat','r');
31     t1=ft_read(f,'double',m*n);
32     t1=reshape(t1,m,n);
33     fclose(f);
34 end