21 integer(I4B) :: irvorigin
26 real(dp) :: qextl1(4), qextl2(4), qintl(5)
27 integer(I4B),
allocatable :: irectvert(:)
28 integer(I4B),
allocatable :: ipv4irv(:, :)
29 real(dp),
allocatable :: rectflow(:, :)
48 allocate (cell%irectvert(5))
49 allocate (cell%ipv4irv(2, 4))
50 allocate (cell%rectflow(2, 4))
52 cell%type =
'rectquad'
58 deallocate (this%defn)
59 deallocate (this%irectvert)
60 deallocate (this%type)
68 call this%load_rect_verts_flows()
84 do m = 1, this%defn%npolyverts
85 if (.not. this%defn%get_ispv180(m))
then
88 this%ipv4irv(1, n) = m
89 this%rectflow(1, n) = this%defn%get_faceflow(m)
90 this%ipv4irv(2, n) = 0
91 this%rectflow(2, n) =
dzero
94 this%ipv4irv(2, n) = m
95 this%rectflow(2, n) = this%defn%get_faceflow(m)
101 this%irectvert(5) = this%irectvert(1)
114 integer(I4B) :: irv, irv2, irv4, ipv1, ipv2, ipv4
115 integer(I4B),
dimension(4) :: irvnxt = (/2, 3, 4, 1/)
116 real(dp) :: x1, y1, x2, y2, x4, y4
128 ipv4 = this%irectvert(irv4)
129 ipv1 = this%irectvert(irv1)
130 x4 = this%defn%polyvert(1, ipv4)
131 y4 = this%defn%polyvert(2, ipv4)
132 x1 = this%defn%polyvert(1, ipv1)
133 y1 = this%defn%polyvert(2, ipv1)
136 ipv2 = this%irectvert(irv2)
137 x2 = this%defn%polyvert(1, ipv2)
138 if (x2 .le. x1)
return
139 else if (y1 .ge. y4)
then
141 ipv2 = this%irectvert(irv2)
142 y2 = this%defn%polyvert(2, ipv2)
143 if (y2 .gt. y1)
return
158 integer(I4B) :: irv2, irv4, ipv1, ipv2, ipv4
159 integer(I4B),
dimension(4) :: irvnxt = (/2, 3, 4, 1/)
160 real(DP) :: x1, y1, x2, y2, x4, y4, dx2, dy2, dx4, dy4
163 irv2 = irvnxt(this%irvOrigin)
164 irv4 = irvnxt(irvnxt(irv2))
167 ipv1 = this%irectvert(this%irvOrigin)
168 x1 = this%defn%polyvert(1, ipv1)
169 y1 = this%defn%polyvert(2, ipv1)
170 ipv2 = this%irectvert(irv2)
171 x2 = this%defn%polyvert(1, ipv2)
172 y2 = this%defn%polyvert(2, ipv2)
173 ipv4 = this%irectvert(irv4)
174 x4 = this%defn%polyvert(1, ipv4)
175 y4 = this%defn%polyvert(2, ipv4)
180 this%zOrigin = this%defn%bot
181 dx2 = x2 - this%xOrigin
182 dy2 = y2 - this%yOrigin
183 dx4 = x4 - this%xOrigin
184 dy4 = y4 - this%yOrigin
185 this%dx = dsqrt(dx4 * dx4 + dy4 * dy4)
186 this%dy = dsqrt(dx2 * dx2 + dy2 * dy2)
187 this%dz = this%defn%top - this%zOrigin
191 this%sinrot = dy4 / this%dx
192 this%cosrot = dx4 / this%dx
198 integer(I4B) :: iq, irv
200 rectflow = this%rectflow(iq, irv)
208 logical(LGP) :: is_refined
210 if (this%ipv4irv(2, i) .ne. 0)
then
subroutine, public create_defn(cellDefn)
Create a new cell definition object.
subroutine, public create_cell_rect_quad(cell)
Create a new rectangular-quad cell.
subroutine init_from(this, defn)
Initialize a rectangular-quad cell from cell definition.
subroutine get_rect_dim_rot(this)
Get rectangular cell dimensions and rotation.
subroutine destroy_cell_rect_quad(this)
Destroy the rectangular-quad cell.
real(dp) function get_rect_flow(this, iq, irv)
Return a rectangle face flow.
subroutine load_rect_verts_flows(this)
Load local polygon vertex indices and rectangular face flows.
logical(lgp) function face_is_refined(this, i)
Return whether a rectangle face is refined.
integer(i4b) function get_rect_ivert_sw(this)
Get index of SW rectangle vertex.
This module contains simulation constants.
real(dp), parameter dzero
real constant zero
This module defines variable data types.
Base grid cell definition.
Base type for grid cells of a concrete type. Contains a cell-definition which is information shared b...