37#include "Simulation.h"
40 integer,
intent(IN) :: nlevels
41 real,dimension(nlevels),
intent(IN) :: isolevels
42 real,dimension(:,:,:),
intent(IN) :: ctrData
43 integer,dimension(HIGH,MDIM),
intent(IN) :: blkLimits
44 integer,
intent(IN) :: blkIndex
45 real,dimension(nlevels),
intent(OUT) :: areas
47 real,
allocatable, dimension(:,:,:) :: mcData
49 integer, dimension(
3) :: mcdataSize
51 integer :: i,j,k,ii,jj,kk, istat
52 real :: datamin, datamax
53 real, dimension(MDIM) :: deltas
55 real :: xmin,ymin,zmin,xmax,ymax,zmax
56 real, dimension(
2,MDIM) :: boundBox
58 call Grid_getBlkBoundBox(blkIndex, boundBox)
60 xmin
= boundBox(
1,
IAXIS)
61 ymin
= boundBox(
1,
JAXIS)
62 zmin
= boundBox(
1,
KAXIS)
63 xmax
= boundBox(
2,
IAXIS)
64 ymax
= boundBox(
2,
JAXIS)
65 zmax
= boundBox(
2,
KAXIS)
80 allocate(mcData(mcdataSize(
1), mcdataSize(
2), mcdataSize(
3)),
STAT=istat)
81 if (istat
/= 0)
call Driver_abort(
"Cannot allocate celldata in ut_contourSurfaceAreaBlock")
91 do j
= 1, mcdataSize(
2)
93 do i
= 1, mcdataSize(
1)
95 mcData(i,j,
1)
= ctrData(ii,jj,kk)
96 mcData(i,j,
2)
= mcData(i,j,
1)
97 mcData(i,j,
3)
= mcData(i,j,
1)
98 datamax
= max(datamax,mcData(i,j,
1))
99 datamin
= min(datamin,mcData(i,j,
1))
103 else if (NDIM
==3)
then
105 do k
= 1, mcdataSize(
3)
107 do j
= 1, mcdataSize(
2)
109 do i
= 1, mcdataSize(
1)
111 mcData(i,j,k)
= ctrData(ii,jj,kk)
112 datamax
= max(datamax,mcData(i,j,k))
113 datamin
= min(datamin,mcData(i,j,k))
120 call Driver_abort(
"Surface area measurement only works in 2 or 3 dimensions")
125 if( datamin
<= isolevels(i)
.AND. isolevels(i)
<= datamax )
then
126 call interior_iso_surface_area(mcData,mcdatasize(
1),mcdataSize(
2),mcdataSize(
3),
&
127 deltas(
1),deltas(
2),deltas(
3),isolevels(i),areas(i))
129 areas(i)
= areas(i)
/(zmax
-zmin)
subroutine ut_contourSurfaceAreaBlock(nlevels, isolevels, ctrData, blkLimits, blkIndex, areas)