ouput with XLONG XLAT
[wrf-fire-matlab.git] / femwind / femwind_rate_fortran_compare_test.m
blobddb04b0fe86da87ce17e075ec02ba47fddab402f
1 function p=femwind_rate_fortran_compare_test(pin)
3 disp('basic convergence speed test')
4 p=femwind_main;
5 p.graphics=-2;
6 p.sc_all = 1;
7 p.sc2_all = 1;
8 % p.levels=8;
9 % params.P_by_x=1;  % coarsening proportioned by x  % now always
10 p.coarse_K=1; % 'variational';  
11 p.coarse_K=2; % 'assembly';
12 p.levels=15;
13 %p.levels=3; fprintf('levels=%i for debugging only!',p.levels)
14 p.debug_level=0;
15 p.test_fortran=0;
16 p.run_fortran=1;
17 p.run_matlab=1;
18 if exist('pin','var')
19     f=fieldnames(pin);;
20 else
21     f={};
22 end
23 for i=1:length(f)
24     ff=f{i};
25     fprintf('overiding p.%s=',ff)
26     disp(pin.(ff))
27     p.(ff)=pin.(ff);
28 end
30 p=femwind_main(p);
31 rates(3,1) =  0.066948270621534;  % 3 levels, coarse P variational
32 rates(8,1) =  0.066931756926231;  % 8 levels, coarse P variational
33 rates(8,2) =  0.066930988019406;  % 8 levels, coarse P assembly
34 rates(15,2)=  0.066930988013484;  % max levels, coarse P assembly
35 rate = rates(p.levels,p.coarse_K);
36 if abs(p.rate - rate) < 1e-8
37     disp('basic convergence rate test OK')
38 else
39     error(sprintf('something changed, expected convergence rate %g got %g diff %g',...
40        rate,p.rate,rate-p.rate))
41 end
42 end