2 use module_fr_sfire_core
3 ! add call to your subroutine here
6 integer :: ims,ime,jms,jme,icl,jcl,i,j
7 real,dimension(3,3)::tff,lff,lfn,tign,lfn1,tign1,lfn2,tign2
8 real,dimension(3,3)::real_tff,real_lff
9 real, dimension(5,5)::d
10 real, dimension(5,3)::lfn3,tign3
12 real,dimension(2,2)::rslt
13 real::test1_err,test2_err,test3_err,test4_err,test5_err
14 real::lfn00,lfn01,lfn10,lfn11,tign00,tign01,tign10,tign11,fuel_time_cell
15 real:: Result1,Result2,Result3,Result4,Result5,result
16 !data lfn/2., 1., 0., &
28 !<<<<<<< HEAD:standalone/fuel_interp_test_main.F
34 ! tign -- everywhere where lfn>=0, tign=3;
35 ! everywhere where lfn<0, tign=Z+3;
36 data lfn/0.5, -0.5, -1.5, &
39 !>>>>>>> origin/jm2/vktest:standalone/fuel_interp_test_main.F
41 data tign/3.0, 2.5, 1.5, &
45 data real_tff/3.0, 2.5, 2.0, &
49 data real_lff/0.0, -0.5, -1.0, &
53 write(*,101)'tign',tign
55 print *,"this is fuel_interp_test.exe"
56 call tign_lfn_interpolation(time_now,icl,jcl,ims,ime,jms,jme, &
65 write(*,*)'tign and tff'
70 write(*,*)'lfn and lff'
74 write(*,*)"Real result - calculated result"
75 write(*,*)real_tff-tff
76 test1_err=maxval(abs(real_tff-tff))
77 write(*,*)"test1_err=",test1_err
80 fuel_time_cell= 8.235294 ;
81 write(*,*)"Calculation of fuel_frac over 4 subcells"
86 write(*,*)'lff',lff(i,j),lff(i,j+1),lff(i+1,j),lff(i+1,j+1)
87 result= result+fuel_left_cell_3( &
88 lff(i,j),lff(i,j+1),lff(i+1,j),lff(i+1,j+1), &
89 tff(i,j),tff(i,j+1),tff(i+1,j),tff(i+1,j+1),&
90 time_now, fuel_time_cell)
91 write(*,*)'result after tep i and j',result,i,j
100 ! tign -- everywhere where lfn>=0, tign=3;
101 ! everywhere where lfn<0, tign=Z+3;
102 data lfn/2.0, 1.0, 0.0, &
106 data tign/3.0, 3.0, 3.0, &
110 data real_tff/3.0, 3.0, 3.0, &
114 data real_lff/1.0, 0.5, 0.0, &
118 print *,"this is fuel_interp_test.exe"
119 call tign_lfn_interpolation(time_now,icl,jcl,ims,ime,jms,jme, &
121 write(*,101)'tign',tign
122 write(*,101)'lfn',lfn
123 write(*,101)'tff',tign
124 write(*,101)'lff',lff
129 write(*,*)'tign and tff'
134 write(*,*)'lfn and lff'
138 write(*,*)"Real result - calculated result"
139 write(*,*)real_tff-tff
140 test2_err=maxval(abs(real_tff-tff))
141 write(*,*)"test2_err=",test2_err
146 !lfn - plane Z=3-X-Y;
147 ! tign -- everywhere where lfn>=0, tign=3;
148 ! everywhere where lfn<0, tign=Z+3;
149 data lfn/1.0, 0.0, -1.0, &
153 data tign/3.0, 3.0, 2.0, &
157 data real_tff/3.0, 2.5, 2.0, &
161 data real_lff/0.0, -0.5, -1.0, &
167 print *,"this is fuel_interp_test.exe"
168 call tign_lfn_interpolation(time_now,icl,jcl,ims,ime,jms,jme, &
170 write(*,101)'tign',tign
171 write(*,101)'lfn',lfn
172 write(*,101)'tff',tign
173 write(*,101)'lff',lff
178 write(*,*)'tign and tff'
183 write(*,*)'lfn and lff'
187 write(*,*)"Real result - calculated result"
188 write(*,*)real_tff-tff
189 test3_err=maxval(abs(real_tff-tff))
190 write(*,*)"test3_err=",test3_err
197 !lfn - plane Z=5-X-Y;
198 ! tign -- everywhere where lfn>=0, tign=3;
199 ! everywhere where lfn<0, tign=Z+3;
200 data lfn/3.0, 2.0, 1.0, &
204 data tign/3.0, 3.0, 3.0, &
208 data real_tff/3.0, 3.0, 3.0, &
212 data real_lff/2.0, 1.5, 1.0, &
218 print *,"this is fuel_interp_test.exe"
219 call tign_lfn_interpolation(time_now,icl,jcl,ims,ime,jms,jme, &
221 write(*,101)'tign',tign
222 write(*,101)'lfn',lfn
223 write(*,101)'tff',tign
224 write(*,101)'lff',lff
229 write(*,*)'tign and tff'
234 write(*,*)'lfn and lff'
238 write(*,*)"Real result - calculated result"
239 write(*,*)real_tff-tff
240 test4_err=maxval(abs(real_tff-tff))
241 write(*,*)"test4_err=",test4_err
246 write(*,*)"test1_err=",test1_err
247 write(*,*)"test2_err=",test2_err
248 write(*,*)"test3_err=",test3_err
249 write(*,*)"test4_err=",test4_err
250 write(*,*)"If all test*_err are equal to 0.0, than the code works &
251 correctly for this set of tests"
253 write(*,*)"Tests for fuel_left calculation"
257 write(*,*)"Test1, result in Matlab u=(-2;0;1) f =0.9169"
268 fuel_time_cell= 8.235294 ;
270 result1= fuel_left_cell_3( &
271 lfn00,lfn01,lfn10,lfn11, &
272 tign00,tign01,tign10,tign11,&
273 time_now, fuel_time_cell)
276 write(*,*)"lfn",lfn00,lfn01,lfn10,lfn11
278 write(*,*)"tign",tign00,tign01,tign10,tign11
280 write(*,*)"Result1=",result1
281 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
285 write(*,*)"Test2, result in Matlab u=(1;0;1) f =0.1660"
296 fuel_time_cell= 8.235294 ;
298 Result2= fuel_left_cell_3( &
299 lfn00,lfn01,lfn10,lfn11, &
300 tign00,tign01,tign10,tign11,&
301 time_now, fuel_time_cell)
304 write(*,*)"lfn",lfn00,lfn01,lfn10,lfn11
306 write(*,*)"tign",tign00,tign01,tign10,tign11
309 write(*,*)"Result2=",Result2
313 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
314 write(*,*)"Test3, result in Matlab u=-(2;0;4) f =0.4538"
325 fuel_time_cell= 8.235294 ;
327 result3= fuel_left_cell_3( &
328 lfn00,lfn01,lfn10,lfn11, &
329 tign00,tign01,tign10,tign11,&
330 time_now, fuel_time_cell)
333 write(*,*)"lfn",lfn00,lfn01,lfn10,lfn11
335 write(*,*)"tign",tign00,tign01,tign10,tign11
338 write(*,*)"Result3=",result3
340 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
344 write(*,*)"Test4, result in Matlab u=(-4;-4;2) f =0.7891"
355 fuel_time_cell= 8.235294 ;
357 Result4= fuel_left_cell_3( &
358 lfn00,lfn01,lfn10,lfn11, &
359 tign00,tign01,tign10,tign11,&
360 time_now, fuel_time_cell)
363 write(*,*)"lfn",lfn00,lfn01,lfn10,lfn11
365 write(*,*)"tign",tign00,tign01,tign10,tign11
368 write(*,*)"Result4=",Result4
370 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
374 write(*,*)"Test5, result in Matlab u=(-2;-2;3) f =0.9488"
385 fuel_time_cell= 8.235294 ;
387 Result5= fuel_left_cell_3( &
388 lfn00,lfn01,lfn10,lfn11, &
389 tign00,tign01,tign10,tign11,&
390 time_now, fuel_time_cell)
393 write(*,*)"lfn",lfn00,lfn01,lfn10,lfn11
395 write(*,*)"tign",tign00,tign01,tign10,tign11
398 write(*,*)"Result5=",Result5
410 write(*,101)'tign',tign
411 write(*,101)'lfn',lfn
412 print*,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
413 print*,"Big test, lfn- plane z=y-2; tign=y tnow=2"
418 !data lfn1/2.0, 1.0, 0.0, &
421 !data tign1/3.0, 3.0, 3.0, &
424 data lfn1/-1., 0., 1., &
428 data tign1/1.0, 2., 2., &
432 write(*,101)'tign',tign1
433 write(*,101)'lfn',lfn1
434 !data real_tff/3.0, 2.5, 2.0, &
438 !data real_lff/0.0, -0.5, -1.0, &
441 write(*,*)'icl,jcl',icl,jcl
442 print *,"this is fuel_interp_test.exe"
443 call tign_lfn_interpolation(time_now,icl,jcl,ims,ime,jms,jme, &
445 write(*,101)'tign',tign1
446 write(*,101)'lfn',lfn1
447 write(*,101)'tff',tff
448 write(*,101)'lff',lff
453 write(*,*)'tign and tff'
458 write(*,*)'lfn and lff'
462 ! write(*,*)"Real result - calculated result"
463 ! write(*,*)real_tff-tff
464 ! test1_err=maxval(abs(real_tff-tff))
465 ! write(*,*)"test1_err=",test1_err
468 fuel_time_cell= 8.235294 ;
469 write(*,*)"Calculation of fuel_frac over 4 subcells"
474 write(*,*)'lff',lff(i,j),lff(i,j+1),lff(i+1,j),lff(i+1,j+1)
475 write(*,*)'tff',tff(i,j),tff(i,j+1),tff(i+1,j),tff(i+1,j+1)
476 rslt(i,j)= fuel_left_cell_3( &
477 lff(i,j),lff(i,j+1),lff(i+1,j),lff(i+1,j+1), &
478 tff(i,j),tff(i,j+1),tff(i+1,j),tff(i+1,j+1),&
479 time_now, fuel_time_cell)
480 write(*,*)'result after step i and j',rslt(i,j),i,j
484 write(*,*)'rslt',rslt
488 write(*,*)'MAIN TEST #2'
490 data lfn3/-1., 0., 1., &
496 data tign3/1.0, 1., 1., &
502 write(*,101)'tign',tign3
503 write(*,101)'lfn',lfn3
505 print *,"this is fuel_interp_test.exe"
506 write(*,*)"icl,jcl",icl,jcl
507 ! call tign_lfn_interpolation(time_now,icl,jcl,ims,ime,jms,jme, &
508 ! tign3,lfn3,tff,lff)
509 write(*,101)'tign(icl-1:icl+1,1:3)',tign3(1,1:3)
510 write(*,101)'tign(icl-1:icl+1,1:3)',tign3(2,1)
511 write(*,101)'tign(icl-1:icl+1,1:3)',tign3(2,2)
512 write(*,101)'tign(icl-1:icl+1,1:3)',tign3(2,3)
513 write(*,101)'tign(icl-1:icl+1,1:3)',tign3(3,1)
514 write(*,101)'tign(icl-1:icl+1,1:3)',tign3
515 write(*,101)'lfn',lfn3(icl-1:icl+1,1:3)
516 write(*,101)'tff',tff
517 write(*,101)'lff',lff
520 d(1:5:2,1:5:2)=tign3(icl-1:icl+1,1:3)
522 write(*,*)'tign and tff'
525 d(1:5:2,1:5:2)=lfn3(icl-1:icl+1,1:3)
527 write(*,*)'lfn and lff'
531 fuel_time_cell= 8.235294 ;
532 write(*,*)"Calculation of fuel_frac over 4 subcells"
538 write(*,*)'lff',lff(i,j),lff(i,j+1),lff(i+1,j),lff(i+1,j+1)
540 result=fuel_left_cell_3( &
541 lff(i,j),lff(i,j+1),lff(i+1,j),lff(i+1,j+1), &
542 tff(i,j),tff(i,j+1),tff(i+1,j),tff(i+1,j+1),&
543 time_now, fuel_time_cell)
544 write(*,*)'result after step i and j',result,i,j