1 program ndt_boundary_conditions_test
3 use module_boundary_conditions
! testing only
4 use module_utils
! to read and write matrices as text files from matlab
8 real, pointer:: Kmat(:,:,:,:), & ! fortran is not case sensitive
13 ifds
, ifde
, kfds
, kfde
, jfds
, jfde
, & ! fire grid dimensions
14 ifms
, ifme
, kfms
, kfme
, jfms
, jfme
, &
15 ifps
, ifpe
, kfps
, kfpe
, jfps
, jfpe
, & ! fire patch bounds
16 ifts
, ifte
, kfts
, kfte
, jfts
, jfte
19 ! read input arrays in ikj index ordering and tight bounds
20 call read_array_nd(a
,s
,'K')
21 allocate(Kmat_m(s(1),s(2),s(3),s(4)))
37 if(msize
.ne
.14)call crash('msize must be 14')
45 ! allocate a little bigger with zeros in extra areas
46 ! print *,'allocating Kmat size',ifms,ifme,kfms,kfme,jfms,jfme,1,msize
47 allocate(Kmat(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
,1:msize
))
50 !print *,'copying the input matrix'
51 Kmat(1:s(1),1:s(2),1:s(3),1:s(4))=Kmat_m(1:s(1),1:s(2),1:s(3),1:s(4))
53 !write(*,'(a)')'calling ntd_boundary_conditions'
54 call ndt_boundary_conditions( &
55 ifds
, ifde
, kfds
, kfde
, jfds
, jfde
, & ! fire grid dimensions
56 ifms
, ifme
, kfms
, kfme
, jfms
, jfme
, &
57 ifps
, ifpe
, kfps
, kfpe
, jfps
, jfpe
, & ! fire patch bounds
58 ifts
, ifte
, kfts
, kfte
, jfts
, jfte
, &
61 !print *,'copying the output matrix'
62 Kmat_m(1:s(1),1:s(2),1:s(3),1:s(4))=Kmat(1:s(1),1:s(2),1:s(3),1:s(4))
64 call write_array_nd(reshape(Kmat_m
,(/product(s
)/)),s
,'Kb')
66 end program ndt_boundary_conditions_test