1 module module_boundary_conditions
7 subroutine ndt_boundary_conditions( &
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
, &
18 integer, intent(in
):: &
19 ifds
, ifde
, kfds
, kfde
, jfds
, jfde
, & ! fire grid dimensions
20 ifms
, ifme
, kfms
, kfme
, jfms
, jfme
, &
21 ifps
, ifpe
, kfps
, kfpe
, jfps
, jfpe
, & ! fire patch bounds
22 ifts
, ifte
, kfts
, kfte
, jfts
, jfte
23 integer, parameter:: msize
= 14
24 real, intent(inout
), dimension(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
,msize
):: kmat
! global stiffness matrix
29 integer:: i
,j
,k
,ie
,je
,ke
34 ie
= snode(ifte
,ifde
,+1)
35 je
= snode(jfte
,jfde
,+1)
36 ke
= snode(kfte
,kfde
,+1)
44 s
=max(s
,abs(kmat(i
,k
,j
, 1)))
52 ! not efficient but will be executed only once
53 if(i
.eq
.ifds
.or
.i
.eq
.ifde
+1.or
.j
.eq
.jfds
.or
.j
.eq
.jfde
+1.or
.k
.eq
.kfde
+1)then
54 ! replace row/col (i,k,j) by scaled identity
55 print *,'replacing row/col ',i
,j
,k
,' by ',s
, '* identity'
56 kmat(i
-1,k
-1,j
-1,14)=0.
57 kmat(i
,k
-1,j
-1,13)=0.
58 kmat(i
+1,k
-1,j
-1,12)=0.
59 kmat(i
-1,k
-1,j
,11)=0.
61 kmat(i
+1,k
-1,j
, 9)=0.
62 kmat(i
-1,k
-1,j
+1, 8)=0.
63 kmat(i
,k
-1,j
+1, 7)=0.
64 kmat(i
+1,k
-1,j
+1, 6)=0.
65 kmat(i
-1,k
,j
-1, 5)=0.
67 kmat(i
+1,k
,j
-1, 3)=0.
88 end subroutine ndt_boundary_conditions
90 subroutine vec_boundary_conditions( &
91 ifds
, ifde
, kfds
, kfde
, jfds
, jfde
, & ! fire grid dimensions
92 ifms
, ifme
, kfms
, kfme
, jfms
, jfme
, &
93 ifps
, ifpe
, kfps
, kfpe
, jfps
, jfpe
, & ! fire patch bounds
94 ifts
, ifte
, kfts
, kfte
, jfts
, jfte
, &
101 integer, intent(in
):: &
102 ifds
, ifde
, kfds
, kfde
, jfds
, jfde
, & ! fire grid dimensions
103 ifms
, ifme
, kfms
, kfme
, jfms
, jfme
, &
104 ifps
, ifpe
, kfps
, kfpe
, jfps
, jfpe
, & ! fire patch bounds
105 ifts
, ifte
, kfts
, kfte
, jfts
, jfte
106 integer, parameter:: msize
= 14
107 real, intent(inout
), dimension(ifms
:ifme
,kfms
:kfme
,jfms
:jfme
):: F
! corner-based scalar field
111 integer:: i
,j
,k
,ie
,je
,ke
116 ie
= snode(ifte
,ifde
,+1)
117 je
= snode(jfte
,jfde
,+1)
118 ke
= snode(kfte
,kfde
,+1)
120 !call write_array(F(ifts:ie,kfts:ke,jfts:je),'F_bc_in')
125 ! not efficient, change later
126 if(i
.eq
.ifds
.or
.i
.eq
.ifde
+1.or
.j
.eq
.jfds
.or
.j
.eq
.jfde
+1.or
.k
.eq
.kfde
+1)then
133 !call write_array(F(ifts:ie,kfts:ke,jfts:je),'F_bc_out')
135 end subroutine vec_boundary_conditions
136 end module module_boundary_conditions