fixing call hexa in test, prints
[wrf-fire-matlab.git] / femwind / fortran / hexa_test.f90
blobbf4523275acbc37fe7146859a82b41b29251b7ce
1 program hexa_test
3 use module_hexa ! testing only
4 use module_utils ! to read and write matrices as text files from matlab
5 use module_lin_alg
7 implicit none
9 real, pointer:: A(:,:,:), X(:,:,:), u0(:,:,:), aflag(:,:,:) ! fortran is not case sensitive
10 integer:: iflag
11 !real:: A(3,3), X(3,8), u0(3) ! fortran is not case sensitive
12 real, pointer:: Kloc(:,:,:), Floc(:,:,:), Jg(:,:,:) ! for convenience, make all arrays 3D
13 real:: vol
15 print *,'hexa_test.exe start:'
16 allocate(Kloc(8,8,1))
17 allocate(Floc(8,1,1))
18 allocate(Jg(8,3,1)) ! for convenience, make all arrays 3D
20 call read_array(A,'A')
21 call read_array(X,'X')
22 call read_array(u0,'u0')
23 call read_array(aflag,'iflags')
26 iflag = aflag(1,1,1)
28 call print_matrix('A',A(:,:,1))
29 call print_matrix('X',X(:,:,1))
30 call print_matrix('u0',u0(:,:,1))
31 write(*,*)'iflag=',iflag
33 write(*,*)'calling hexa'
34 call hexa(A(:,:,1),X(:,:,1),u0(:,:,1),Kloc(:,:,1),Floc(:,:,1),Jg(:,:,1),vol,iflag)
35 write(*,*)'hexa output'
37 call print_matrix('Kloc',Kloc(:,:,1))
38 call print_matrix('Floc',Floc(:,:,1))
39 call print_matrix('Jg',Jg(:,:,1))
40 write(*,*)'vol=',vol
42 call write_array(Kloc,'Kloc')
43 call write_array(Floc,'Floc')
44 call write_array(Jg,'Jg')
46 print *,'hexa_test.exe end:'
48 end program hexa_test