60 INTEGER :: ireg, ilev, iregbin
62 TYPE(t_region
) :: region
68 CHARACTER(CHRLEN) :: rcsidentstring
69 CHARACTER(CHRLEN+4) :: fname
71 INTEGER :: errorflag, ndimplag
72 INTEGER :: pidini,regini,
icell,indexi,indexj,indexk
74 INTEGER :: ibinlog,nbinslog
75 INTEGER :: icontal,icontalox
76 INTEGER,
POINTER :: cvmass(:)
77 INTEGER,
POINTER :: aiv(:,:)
78 INTEGER,
DIMENSION(0:500) :: sizebin,sizebinlog
80 REAL(RFREAL) :: diambinmicron,
x,
y,
z,diammicron,diammicronlog
81 REAL(RFREAL) :: diammaxlog,diamminlog,diambinlogdelta,ribin
82 REAL(RFREAL) :: dlogjph,dlogjmh
83 REAL(RFREAL) :: massl,xminrange,xposplag
84 REAL(RFREAL) :: diammax,diammin
85 REAL(RFREAL),
DIMENSION(0:500) :: compalbin,compaloxbin,compalbinlog,&
87 REAL(RFREAL),
DIMENSION(0:500) :: diambin, diambinlog,weightbin
88 REAL(RFREAL),
DIMENSION(0:500) :: diam32bin,diam43bin,&
89 diam2bin,diam3bin,diam4bin,massalbin,&
90 massaloxbin,masstotbin
91 REAL(RFREAL),
DIMENSION(0:500) :: xmombin,ymombin,zmombin
92 REAL(RFREAL),
DIMENSION(0:500) :: uvelbin,vvelbin,wvelbin
93 REAL(RFREAL),
DIMENSION(0:500) :: diam32binlog,diam43binlog,&
94 diam2binlog,diam3binlog,diam4binlog,&
95 massalbinlog,massaloxbinlog,masstotbinlog
96 REAL(RFREAL),
DIMENSION(0:500) :: xmombinlog,ymombinlog,zmombinlog
97 REAL(RFREAL),
DIMENSION(0:500) :: uvelbinlog,vvelbinlog,wvelbinlog
98 REAL(RFREAL),
POINTER :: cv(:,:), dv(:,:)
104 rcsidentstring =
'$RCSfile: PLAG_BinSortNozzleInlet.F90,v $ $Revision: 1.6 $'
106 global => region%global
108 CALL
registerfunction( global,
'PLAG_BinSortNozzleInlet',
'PLAG_BinSortNozzleInlet.F90' )
112 ndimplag = region%levels(ilev)%plag%nPcls
115 sizebinlog(0:500) = 0
116 diambin(0:500) = 0.0_rfreal
117 diambinlog(0:500) = 0.0_rfreal
118 weightbin(0:500) = 1.0_rfreal
120 diamminlog = log( 5.0_rfreal)
121 diammaxlog = log(250.0_rfreal)
122 diambinmicron = 5.0_rfreal
125 diammax = 250.0_rfreal
132 compalbin(0:500) = 0.0_rfreal
133 compaloxbin(0:500) = 0.0_rfreal
134 compalbinlog(0:500) = 0.0_rfreal
135 compaloxbinlog(0:500) = 0.0_rfreal
137 massalbin(0:500) = 0.0_rfreal
138 massaloxbin(0:500) = 0.0_rfreal
139 masstotbin(0:500) = 0.0_rfreal
141 xmombin(0:500) = 0.0_rfreal
142 ymombin(0:500) = 0.0_rfreal
143 zmombin(0:500) = 0.0_rfreal
145 uvelbin(0:500) = 0.0_rfreal
146 vvelbin(0:500) = 0.0_rfreal
147 wvelbin(0:500) = 0.0_rfreal
149 massalbinlog(0:500) = 0.0_rfreal
150 massaloxbinlog(0:500) = 0.0_rfreal
151 masstotbinlog(0:500) = 0.0_rfreal
153 xmombinlog(0:500) = 0.0_rfreal
154 ymombinlog(0:500) = 0.0_rfreal
155 zmombinlog(0:500) = 0.0_rfreal
157 uvelbinlog(0:500) = 0.0_rfreal
158 vvelbinlog(0:500) = 0.0_rfreal
159 wvelbinlog(0:500) = 0.0_rfreal
161 IF (ireg /= iregbin) goto 1999
163 print*,
'PLAG_BinSortNozzleInlet: iRegBin, nDimPlag = ',iregbin,ndimplag
169 xminrange = 0.0_rfreal
171 SELECT CASE (iregbin)
173 xminrange = 0.39_rfreal
176 xminrange = 0.465_rfreal
179 xminrange = 0.0_rfreal
182 diambinlogdelta = (diammaxlog-diamminlog)/
REAL((nBinsLog-1),kind=rfreal)
184 DO ibin = 1, nbinslog
185 ribin =
REAL(ibin,kind=rfreal)
186 diambinlog(ibin) = ((nbinslog-ribin)*diamminlog +(ribin-1.0_rfreal)*diammaxlog)/&
187 REAL((nBinsLog-1),kind=rfreal)
189 dlogjph = ( (nbinslog-ribin-0.5_rfreal)*diamminlog &
190 +(ribin+0.5_rfreal-1)*diammaxlog)/ &
191 REAL((nBinsLog-1),kind=rfreal)
193 dlogjmh = ( (nbinslog-ribin+0.5_rfreal)*diamminlog &
194 +(ribin-0.5_rfreal-1)*diammaxlog)/ &
195 REAL((nBinsLog-1),kind=rfreal)
197 weightbin(ibin) = exp(dlogjph) -exp(dlogjmh)
204 aiv => region%levels(ilev)%plag%aiv
205 cv => region%levels(ilev)%plag%cv
206 dv => region%levels(ilev)%plag%dv
207 cvmass => region%levels(ilev)%plag%cvPlagMass
212 xposplag = cv(cv_plag_xpos,
i)
214 IF ( xposplag >= xminrange )
THEN
215 diammicron = dv(dv_plag_diam,
i)*1.0e+06_rfreal
217 ibin=nint(diammicron/diambinmicron)
219 IF(diammicron < diammin ) ibin = 1
220 IF(diammicron > diammax ) ibin = nbins
222 sizebin(ibin) = sizebin(ibin)+1
224 massl =
sum(cv(cvmass(:),
i))
226 massalbin(ibin) = massalbin(ibin) +cv(cvmass(icontal),
i)
227 massaloxbin(ibin) = massaloxbin(ibin) +cv(cvmass(icontalox),
i)
228 masstotbin(ibin) = masstotbin(ibin) +massl
230 diam2bin(ibin) = diam2bin(ibin) +diammicron**2
231 diam3bin(ibin) = diam3bin(ibin) +diammicron**3
232 diam4bin(ibin) = diam4bin(ibin) +diammicron**4
234 xmombin(ibin) = xmombin(ibin) +cv(cv_plag_xmom,
i)
235 ymombin(ibin) = ymombin(ibin) +cv(cv_plag_ymom,
i)
236 zmombin(ibin) = zmombin(ibin) +cv(cv_plag_zmom,
i)
241 IF ( sizebin(ibin) > 0 )
THEN
242 compalbin(ibin) = massalbin(ibin)/masstotbin(ibin)
243 compaloxbin(ibin) = massaloxbin(ibin)/masstotbin(ibin)
245 diam43bin(ibin) = diam4bin(ibin)/diam3bin(ibin)
246 diam32bin(ibin) = diam3bin(ibin)/diam2bin(ibin)
248 uvelbin(ibin) = xmombin(ibin)/masstotbin(ibin)
249 vvelbin(ibin) = ymombin(ibin)/masstotbin(ibin)
250 wvelbin(ibin) = zmombin(ibin)/masstotbin(ibin)
256 WRITE(fname,
'(A,I2,A,1PE11.5,A)') &
257 trim(global%casename)//
'.plag_bin_reg_',iregbin,
'_',global%currentTime,
'.dat'
258 OPEN(if_plot,file=fname,
status=
'unknown',
form=
'formatted',iostat=errorflag)
259 global%error = errorflag
260 IF (global%error /= 0) CALL
errorstop( global,err_file_open,__line__,fname )
262 IF (global%currentTime <= 0._rfreal)
THEN
263 WRITE(if_plot,1005,err=10) trim(global%casename),global%timeStamp
265 WRITE(if_plot,1005,err=10) trim(global%casename),global%currentTime
268 WRITE(if_plot,1010,err=10)
'diamBin sizeBin compAl compAlOx diam32 diam43 u v w'
270 WRITE(if_plot,1015) iregbin, nbins
273 WRITE(if_plot,1020,err=10) ibin*5,sizebin(ibin),&
274 nint(compalbin(ibin)*100.0_rfreal),&
275 nint(compaloxbin(ibin)*100.0_rfreal), &
276 nint(diam32bin(ibin)),nint(diam43bin(ibin)),&
277 uvelbin(ibin),vvelbin(ibin),wvelbin(ibin)
280 CLOSE(if_plot,iostat=errorflag)
281 global%error = errorflag
282 IF (global%error /= 0) CALL
errorstop( global,err_file_close,__line__,fname )
286 WRITE(fname,
'(A,I2,A,1PE11.5,A)') &
287 trim(global%casename)//
'.plag_cv_bin_reg_',iregbin,
'_',global%currentTime,
'.dat'
288 OPEN(if_plot,file=fname,
status=
'unknown',
form=
'formatted',iostat=errorflag)
289 global%error = errorflag
290 IF (global%error /= 0) CALL
errorstop( global,err_file_open,__line__,fname )
292 IF (global%currentTime <= 0._rfreal)
THEN
293 WRITE(if_plot,1005,err=10) trim(global%casename),global%timeStamp
295 WRITE(if_plot,1005,err=10) trim(global%casename),global%currentTime
298 WRITE(if_plot,1010,err=10)
'diamBin sizeBin massAl massAlOxBin massTot diam2 diam3 diam4 xMom yMom zMom'
300 WRITE(if_plot,1015) iregbin, nbins
303 WRITE(if_plot,1030,err=10) ibin*5,sizebin(ibin),&
304 massalbin(ibin),massaloxbin(ibin),masstotbin(ibin),&
305 diam2bin(ibin),diam3bin(ibin),diam4bin(ibin),&
306 xmombin(ibin),ymombin(ibin),zmombin(ibin)
309 CLOSE(if_plot,iostat=errorflag)
310 global%error = errorflag
311 IF (global%error /= 0) CALL
errorstop( global,err_file_close,__line__,fname )
316 xposplag = cv(cv_plag_xpos,
i)
318 IF ( xposplag >= xminrange )
THEN
319 diammicron = dv(dv_plag_diam,
i)*1.0e+06_rfreal
320 diammicronlog = log(diammicron)
322 ibinlog=nint(1.0_rfreal + (diammicronlog-diamminlog)/diambinlogdelta)
324 IF(diammicronlog < diamminlog ) ibinlog = 1
325 IF(diammicronlog > diammaxlog ) ibinlog = nbinslog
327 sizebinlog(ibinlog) = sizebinlog(ibinlog)+1
329 massl =
sum(cv(cvmass(:),
i))
331 massalbinlog(ibinlog) = massalbinlog(ibinlog) +cv(cvmass(icontal),
i)
332 massaloxbinlog(ibinlog) = massaloxbinlog(ibinlog) +cv(cvmass(icontalox),
i)
333 masstotbinlog(ibinlog) = masstotbinlog(ibinlog) +massl
335 diam2binlog(ibinlog) = diam2binlog(ibinlog) +diammicron**2
336 diam3binlog(ibinlog) = diam3binlog(ibinlog) +diammicron**3
337 diam4binlog(ibinlog) = diam4binlog(ibinlog) +diammicron**4
339 xmombinlog(ibinlog) = xmombinlog(ibinlog) +cv(cv_plag_xmom,
i)
340 ymombinlog(ibinlog) = ymombinlog(ibinlog) +cv(cv_plag_ymom,
i)
341 zmombinlog(ibinlog) = zmombinlog(ibinlog) +cv(cv_plag_zmom,
i)
345 DO ibinlog = 1, nbinslog
346 IF ( sizebinlog(ibinlog) > 0 )
THEN
347 compalbinlog(ibinlog) = massalbinlog(ibinlog)/masstotbinlog(ibinlog)
348 compaloxbinlog(ibinlog) = massaloxbinlog(ibinlog)/masstotbinlog(ibinlog)
350 diam43binlog(ibinlog) = diam4binlog(ibinlog)/diam3binlog(ibinlog)
351 diam32binlog(ibinlog) = diam3binlog(ibinlog)/diam2binlog(ibinlog)
353 uvelbinlog(ibinlog) = xmombinlog(ibinlog)/masstotbinlog(ibinlog)
354 vvelbinlog(ibinlog) = ymombinlog(ibinlog)/masstotbinlog(ibinlog)
355 wvelbinlog(ibinlog) = zmombinlog(ibinlog)/masstotbinlog(ibinlog)
361 WRITE(fname,
'(A,I2,A,1PE11.5,A)') &
362 trim(global%casename)//
'.plag_logbin_reg_',iregbin,
'_',global%currentTime,
'.dat'
363 OPEN(if_plot,file=fname,
status=
'unknown',
form=
'formatted',iostat=errorflag)
364 global%error = errorflag
365 IF (global%error /= 0) CALL
errorstop( global,err_file_open,__line__,fname )
367 IF (global%currentTime <= 0._rfreal)
THEN
368 WRITE(if_plot,1005,err=10) trim(global%casename),global%timeStamp
370 WRITE(if_plot,1005,err=10) trim(global%casename),global%currentTime
373 WRITE(if_plot,1010,err=10)
'diamBinLog sizeBinLog sizeBinWeight compAl compAlOx diam32 diam43 u v w'
374 WRITE(if_plot,1015) iregbin, nbinslog
376 DO ibinlog = 1, nbinslog
377 WRITE(if_plot,1025,err=10) exp(diambinlog(ibinlog)),sizebinlog(ibinlog),&
378 sizebinlog(ibinlog)/weightbin(ibinlog),&
379 nint(compalbinlog(ibinlog)*100.0_rfreal),&
380 nint(compaloxbinlog(ibinlog)*100.0_rfreal), &
381 nint(diam32binlog(ibinlog)),nint(diam43binlog(ibinlog)),&
382 uvelbinlog(ibinlog),vvelbinlog(ibinlog),wvelbinlog(ibinlog)
387 CLOSE(if_plot,iostat=errorflag)
388 global%error = errorflag
389 IF (global%error /= 0) CALL
errorstop( global,err_file_close,__line__,fname )
396 CALL
errorstop( global,err_file_write,__line__,fname )
400 1005
FORMAT(
'TITLE="',
a,
'. Time: ',1pe11.5,
'."')
401 1010
FORMAT(
'VARIABLES= ',
a)
402 1015
FORMAT(
'ZONE T="',i5.5,
'", I=',i10,
', F=POINT')
403 1020
FORMAT(1
x,i5,1
x,i6,4(1
x,i5),3(1
x,1pe12.5))
404 1025
FORMAT((1
x,1pe12.5),1
x,i5,(1
x,1pe12.5),4(1
x,i5),3(1
x,1pe12.5))
405 1030
FORMAT(1
x,i4,1
x,i6,9(1
x,e23.16))
Tfloat sum() const
Return the sum of all the pixel values in an image.
void int int REAL REAL * y
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine plag_binsortnozzleinlet(iReg, iLev, region, iRegBin)
void int int int REAL REAL REAL * z
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE icell
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)