1 module module_w_assembly
7 subroutine w_assembly( &
8 ifds
, ifde
, kfds
,kfde
, jfds
, jfde
, & ! fire grid dimensions
9 ifms
, ifme
, kfms
,kfme
, jfms
, jfme
, &
10 ifps
, ifpe
, kfps
, kfpe
, jfps
, jfpe
, & ! fire patch bounds
11 ifts
, ifte
, kfts
, kfte
, jfts
,jfte
, &
12 lambda
,u0
, v0
, w0
, A
, X
, Y
, Z
, & !Input from femwind, u0, v0, w0, Spatial Grid Data
14 !Purpose: Create Arrays of Wind Vector Component Values at Center Points of Spatial Grid
16 !A Coefficient Matrix size 3X3, symmetric positive definite
17 !u0, v0, w0 Initial wind speed values in x,y,z direction at grid cell centers
18 !iflags1 iflags1 = 1 returns Kloc and Jg from hexa, iflags2 = 2 returns Floc and Jg from hexa
19 !iflags2 iflags2 =1 indicates add initial wind to calculated wind
21 ! U,V,W Computed wind values in x,y,z direction
27 integer, intent(in
):: &
28 ifds
, ifde
, kfds
,kfde
, jfds
, jfde
, & ! fire grid dimensions
29 ifms
, ifme
, kfms
,kfme
, jfms
, jfme
, &
30 ifps
, ifpe
, kfps
, kfpe
, jfps
, jfpe
, & ! fire patch bounds
31 ifts
, ifte
, kfts
, kfte
, jfts
,jfte
33 real, intent(in
), dimension(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
):: lambda
36 real, intent(in
) :: A(3,3)
37 real, intent(in
), dimension(ifms
:ifme
, kfms
:kfme
, jfms
:jfme
)::X
,Y
,Z
,u0
, v0
, w0
40 real, intent(out
), dimension(ifms
:ifme
, kfms
:kfme
, jfms
:jfme
)::U
,V
,W
44 integer:: ie1
, ie2
, ie3
, ic1
, ic2
, ic3
, iloc
, i
, k1
, k2
, k3
45 real :: Kloc(8,8), Floc(8), Jg(8,3)
46 real :: Xloc(3,8), u0loc(3)
62 !*** u0loc is an input for module_hexa, but is not used to construct K. Do I need to define this?
65 !print *, 'u0 vector is', u0
73 Xloc(1,iloc
)=X(ie1
+ ic1
, ie3
+ ic3
, ie2
+ ic2
)
74 Xloc(2,iloc
)=Y(ie1
+ ic1
, ie3
+ ic3
, ie2
+ ic2
)
75 Xloc(3,iloc
)=Z(ie1
+ ic1
, ie3
+ ic3
, ie2
+ ic2
)
79 u0loc(1) = u0(ie1
,ie3
,ie2
)
80 u0loc(2) = v0(ie1
, ie3
,ie2
)
81 u0loc(3) = w0(ie1
, ie3
,ie2
)
82 !fine print *, 'local lambda is', lambda_loc
83 !print* , 'Xloc is', Xloc
84 !print* , 'u0loc is', u0loc(1)
85 call hexa(A
,Xloc
,u0loc
,Kloc
,Floc
,Jg
,vol
,3)
88 !*** end of constant part
92 iloc
=1+ic1
+2*(ic2
+2*ic3
); !local index of the node in the element
96 lambda_loc(iloc
) = lambda(k1
,k3
,k2
)
100 grad
= matmul(transpose(Jg
),lambda_loc
)
101 !not ok print *,'Grad before multiplication by A_inv is', grad
104 grad
= matmul(transpose(A_inv
),grad
)
105 ! Not ok print *,'Grad after multiplication by A_inv is', grad
107 U(ie1
, ie3
, ie2
)=grad(1)+ u0(ie1
, ie3
, ie2
)
108 V(ie1
, ie3
, ie2
)=grad(2)+ v0(ie1
, ie3
, ie2
)
109 W(ie1
, ie3
, ie2
)=grad(3)+ w0(ie1
, ie3
, ie2
)
112 !print *, 'lambda array', lambda
115 !print *,'Shape of U', shape(U)
117 end subroutine w_assembly
118 end module module_w_assembly