1 function [unit_long,unit_lat,long,lat,time_now,mesh_size,ign_pnt,bound]=read_file_ignition(data,wrfout)
3 % Volodymyr Kondratenko April 3 2012
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7 % Input: data : String - data, that contains the name of the Text file.
8 % First 2 columns - coordinates of all the
9 % points on the boundary (lon,lat).
10 % 1rt row - time_now (second number is not needed, is set to 0);
11 % 2nd row - size of the mesh;
12 % 3rd row - coordinates of ignition point;
13 % All next rows - coordinates of all the
14 % points on the boundary (lon,lat). %
15 % wrfout : String with the name of the wrfout file,
16 % It is needed for reading the latitude and longtitude
17 % coordinates of the mesh and also UNIT_FXLONG and
18 % UNIT_FXLAT variables
20 % unit_long = UNIT_FXLONG;
21 % unit_lat = UNIT_FXLAT;
22 % long = FXLONG, longtitude coordinates of the mesh
23 % lat = FXLAT, latitude coordinates of the mesh
24 % time_now = time of ignition on the boundary
25 % mesh_size = size of the mesh
26 % ign_pnt - point of ignition
27 % bound - set of ordered points of the boundary 1st=last
28 % bound(i,1)-horisontal; bound(i,1)-vertical coordinate
34 unit_long=ncread(wrfout,'UNIT_FXLONG');
37 unit_lat=ncread(wrfout,'UNIT_FXLAT');
38 unit_long=unit_long(1);
40 long=ncread(wrfout,'FXLONG');
41 lat=ncread(wrfout,'FXLAT');
46 data = fscanf(fid,'%g %g',[2 inf]); % It has two rows now.
56 ign_pnt(1)=ign_pnt(1)*unit_long;
57 ign_pnt(2)=ign_pnt(2)*unit_lat;
58 bound=data(4:data_size(1),:);
59 bound(:,1)=bound(:,1)*unit_long;
60 bound(:,2)=bound(:,2)*unit_lat;
62 plot(bound(:,1),bound(:,2),'-',ign_pnt(1),ign_pnt(2),'o')