Merge branch 'fixf'
[wrf-fire-matlab.git] / femwind / fortran / vec_boundary_conditions_test.f90
blob5a88fc6171bce7c43d8e1cfb15f7ccf091395bd5
1 program vec_boundary_conditions_test
3 use module_boundary_conditions ! testing only
4 use module_utils ! to read and write matrices as text files from matlab
6 implicit none
8 real, pointer:: F(:,:,:), & ! fortran is not case sensitive
9 F_m(:,:,:)
10 integer :: n(3)
12 integer :: &
13 ifds, ifde, kfds, kfde, jfds, jfde, & ! fire domain bounds
14 ifms, ifme, kfms, kfme, jfms, jfme, & ! fire memory bounds
15 ifps, ifpe, kfps, kfpe, jfps, jfpe, & ! fire memory bounds
16 ifts, ifte, kfts, kfte, jfts,jfte ! fire tile bounds
17 integer :: i,j,k,jx
19 ! read input arrays in ikj index ordering and tight bounds
20 call read_array(F_m,'F')
21 n = shape(F_m)
23 ifts = 1
24 ifte = n(1)-1
25 kfts = 1
26 kfte = n(2)-1
27 jfts = 1
28 jfte = n(3)-1
29 ifds=ifts
30 ifde=ifte
31 kfds=kfts
32 kfde=kfte
33 jfds=jfts
34 jfde=jfte
35 ifms = ifts-1
36 ifme = ifte+2
37 jfms = jfts-1
38 jfme = jfte+2
39 kfms = kfts-1
40 kfme = kfte+2
42 ! allocate a little bigger with zeros in extra areas
43 allocate(F(ifms:ifme,kfms:kfme,jfms:jfme))
45 ! copy the input data
46 F(1:n(1),1:n(2),1:n(3))=F_m
48 write(*,'(a)')'calling vec_boundary_conditions'
49 call vec_boundary_conditions( &
50 ifds, ifde, kfds, kfde, jfds, jfde, & ! fire domain bounds
51 ifms, ifme, kfms, kfme, jfms, jfme, & ! fire memory bounds
52 ifps, ifpe, kfps, kfpe, jfps, jfpe, & ! fire memory bounds
53 ifts, ifte, kfts, kfte, jfts,jfte, & ! fire tile bounds
56 ! copy the output data
57 F_m=F(1:n(1),1:n(2),1:n(3))
59 call write_array(F_m,'Fb')
61 end program vec_boundary_conditions_test