1 function tign=create_tign
2 % nodify to your liking
3 [ii,jj]=meshgrid(1:420);
4 tign=sqrt(2*(ii-200).^2+(jj-171).^2)+1;
6 write_array_2d('input_tign_g',tign)
7 write_array_2d('input_tign_in',tign)
9 function write_array_2d(filename,a)
10 % write_array_2d(filename,a)
11 % Purpose: write 2d matrix as input to WRF-Fire
14 % filename string, the name of the file
15 % a 2d matrix, the array to be written
17 % Example: write_array_2d('input_ht',ht)
20 % read_array_2d read the file back by a=read_array_2d(filename)
21 % image_array_2d visualize the array by image_array_2d(a)
23 h=fopen(filename,'w');
24 fprintf(h,'%i\n',m,n);
25 fprintf(h,'%.7g\n',a');