testing
[wrf-fire-matlab.git] / femwind / coarsening_icl_fortran.m
blob42b1500ee319c65db5ecf30ad9e6b94900c197cc
1 function [hzc,icl_z]=coarsening_icl_fortran(dx,dy,dz,params)
2 % call fortran version
4 [hzc,icl_z]=coarsening_icl(dx,dy,dz,params)
6 if params.test_fortran
7     disp('testing if coarsening_icl_test same result in fortran')
8     exe = './fortran/coarsening_icl_test.exe';
9     if exist(exe,'file') 
10         %Writing all arrays to text files for use by fortran tester
11         write_array(dx,'dx');
12         write_array(dy,'dy');
13         write_array(dz,'dz');
14         write_array(diag(params.a),'A');
15         write_array(params.minaspect,'minaspect');
16         write_array(params.maxaspect,'maxaspect');
17         system(exe)
18         hzcf=[read_array('cr_x'),read_array('cr_y')];
19         icl_zf = read_array('icl_z'); icl_zf=icl_zf(:)'; % row
20         if any(hzc ~= hzcf) || any(icl_zf ~= icl_z)
21             hzc,icl_z
22             hzcf,icl_zf
23             error('coarsening_icl_fortran different')
24         end
25         disp('coarsening_icl_test same result in fortran OK')
26     else
27         warning(['file ',exe,' does not exist'])
28     end
29 end
30 end