1 program w_assembly_test
7 !Purpose: Create Arrays of Wind Vector Component Values at Center Points of Spatial Grid
9 !A Coefficient Matrix size 3X3, symmetric positive definite
10 !u0, v0, w0 Initial wind speed values in x,y,z direction at grid cell centers
11 !X,Y,Z 3-D Physical Location in the Mesh Grid
12 !iflags1 iflags1 = 1 returns Kloc and Jg from hexa, iflags2 = 2 returns Floc and Jg from hexa
13 !iflags2 iflags2 =1 indicates add initial wind to calculated wind
15 !U,V,W Computed wind values in x,y,z direction
19 real, pointer:: u0mat(:,:,:),v0mat(:,:,:), w0mat(:,:,:), Umat(:,:,:), &
20 Vmat(:,:,:), Wmat(:,:,:), u0(:,:,:), v0(:,:,:), w0(:,:,:), &
21 U(:,:,:), V(:,:,:),W(:,:,:),lambda(:,:,:), lambdamat(:,:,:), & ! Calculated final windFinal
22 Xmat(:,:,:),Ymat(:,:,:),Zmat(:,:,:), X(:,:,:),Y(:,:,:),Z(:,:,:),A_m(:,:,:)
25 real, pointer :: a1(:), a2(:)
26 integer :: n1(2),lambda_dim(3),u_dim(3), x_dim(3)
29 ifds
, ifde
, kfds
, kfde
, jfds
, jfde
, & ! fire domain bounds
30 ifms
, ifme
, kfms
, kfme
, jfms
, jfme
, & ! fire memory bounds
31 ifps
, ifpe
, kfps
, kfpe
, jfps
, jfpe
, & ! fire patch bounds
32 ifts
, ifte
, kfts
, kfte
, jfts
,jfte
! fire tile bounds
39 call read_array(A_m
,'A_test')
40 Amat
= reshape(A_m
,(/3,3/))
42 call read_array(lambda
, 'lambda_test')
43 lambda_dim
= shape(lambda
)
45 print *, 'lambda array has shape', shape(lambda
)
47 ! read input arrays in ikj index ordering and tight bounds
48 call read_array(X
,'X_test')
49 call read_array(Y
,'Y_test')
50 call read_array(Z
,'Z_test')
52 call read_array(u0
,'u0_test') !Recovering Inital Wind Arrays
53 call read_array(v0
,'v0_test')
54 call read_array(w0
,'w0_test')
59 !Checking that dimensions of lambda and are X arrays are consistent
60 if (x_dim(1).ne
.lambda_dim(1).or
.x_dim(2).ne
.lambda_dim(2).or
.x_dim(3).ne
.lambda_dim(3)) then
61 call crash('Lambda dimensions must equal the dimensions of X')
84 allocate(lambdamat(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
88 allocate(Xmat(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
89 allocate(Ymat(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
90 allocate(Zmat(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
92 allocate(u0mat(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
93 allocate(v0mat(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
94 allocate(w0mat(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
96 ! copy the input data to tile sized bounds
97 ! X Y Z are corner based, upper bound larger by one
101 Xmat(i
,k
,j
) = X(i
,k
,j
)
102 Ymat(i
,k
,j
) = Y(i
,k
,j
)
103 Zmat(i
,k
,j
) = Z(i
,k
,j
)
104 lambdamat(i
,k
,j
) = lambda(i
,k
,j
)
112 u0mat(i
,k
,j
) = u0(i
,k
,j
)
113 v0mat(i
,k
,j
) = v0(i
,k
,j
)
114 w0mat(i
,k
,j
) = w0(i
,k
,j
)
122 allocate(U(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
123 allocate(V(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
124 allocate(W(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
))
130 !write(*,'(a)')'calling w_assembly'
132 ifds
, ifde
, kfds
, kfde
, jfds
, jfde
, & ! fire domain bounds
133 ifms
, ifme
, kfms
, kfme
, jfms
, jfme
, & ! fire memory bounds
134 ifps
, ifpe
, kfps
, kfpe
, jfps
, jfpe
, & ! fire patch bounds
135 ifts
, ifte
, kfts
, kfte
, jfts
,jfte
, & ! fire tile bounds
136 lambdamat
,u0mat
, v0mat
, w0mat
, Amat
, & !Input from femwind, u0, v0, w0,Spatial Grid Data
140 !write(*,'(a,3i8)')'copying the output data to array size ',n2,msize
142 allocate(Umat(ifts
:ifte
,kfts
:kfte
,jfts
:jfte
))
143 allocate(Vmat(ifts
:ifte
,kfts
:kfte
,jfts
:jfte
))
144 allocate(Wmat(ifts
:ifte
,kfts
:kfte
,jfts
:jfte
))
145 !keep track of indexing
155 !print *, 'Shape of Umat is', shape(Umat)
157 call write_array(Umat
,'U_test')
158 call write_array(Vmat
,'V_test')
159 call write_array(Wmat
,'W_test')
162 end program w_assembly_test