1 function err=check_ros(fuel)
3 % check relative error between fortran and matlab
4 % example: fuels; big(check_ros(fuel)) should return of order 1e-5
7 nwinds=length(fuel(k).wind);
10 ros=fire_ros(fuel(k),speed,0);
11 err(k,j,1)=(fuel(k).ros_wind(j)-ros)/(ros+eps);
12 % ros_before=fire_ros_before(fuel(k),speed,0);
13 % fprintf('fuel=%g speed=%g ros=%g ros_before=%g\n',k,speed,ros,ros_before)
14 % if abs(ros-ros_before)>eps, error('ros different'),end
16 nslopes=length(fuel(k).slope);
18 tanphi=fuel(k).slope(j);
19 ros=fire_ros(fuel(k),0,tanphi);
20 err(k,j,2)=(fuel(k).ros_slope(j)-ros)/(ros+eps);