70 INTEGER :: ireg, ilev,
i,
j,
k
73 CHARACTER(CHRLEN) ::
msg, verbosity, versionstring, headerstring
75 TYPE(t_region
) ,
POINTER :: regions(:)
77 TYPE(t_mixt) ,
POINTER :: mixt
78 TYPE(t_region
) ,
POINTER :: regionss1(:), regionss2(:)
86 INTEGER :: indcp = 0, indmol = 0
88 INTEGER :: ibegs1,iends1,ijumps1
89 INTEGER :: jbegs1,jends1,jjumps1
90 INTEGER :: kbegs1,kends1,kjumps1
91 INTEGER :: icoffs1,ijcoffs1
93 INTEGER :: ibegs2,iends2,ijumps2
94 INTEGER :: jbegs2,jends2,jjumps2
95 INTEGER :: kbegs2,kends2,kjumps2
96 INTEGER :: icoffs2,ijcoffs2
98 INTEGER :: variableindexs1, variableindexs2
99 INTEGER :: filetypes1, filetypes2
100 INTEGER :: similaritytypes2
101 INTEGER :: inodess1, jnodess1, knodess1
102 INTEGER :: inodess2, jnodess2, knodess2
103 INTEGER :: iregs1, iregs2
104 INTEGER :: margin, versionwidth, errorflag
105 INTEGER,
PARAMETER :: headerwidth = 54
107 REAL(RFREAL) :: evs1min, evs2min, evs1max, evs2max
119 global%verbLevel = verbose_none
121 global%flowType = flow_steady
122 global%currentTime = -1._rfreal
123 global%currentIter = -1
128 global%nProcAlloc = 1
129 global%myProcid = masterproc
130 global%mpierr = err_none
131 global%error = err_none
133 global%pi = 4._rfreal*atan(1._rfreal)
134 global%rad = global%pi/180._rfreal
139 CALL mpi_init( global%mpierr )
140 IF (global%mpierr /=0 ) CALL
errorstop( global, err_mpi_trouble,__line__ )
146 versionwidth = len_trim(versionstring)
147 margin = (headerwidth-versionwidth)/2
148 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
149 headerstring(1:1) =
'*'
150 headerstring(headerwidth:headerwidth) =
'*'
152 WRITE(stdout,
'(/,A)')
' ******************************************************'
153 WRITE(stdout,
'(A)')
' * *'
154 WRITE(stdout,
'(A)')
' * ROCVAV: Verification And Validation Tool *'
155 WRITE(stdout,
'(A)')
' * ======================================== *'
156 WRITE(stdout,
'(A)')
' * *'
157 WRITE(stdout,
'(A)')
' '//trim(headerstring)
158 WRITE(stdout,
'(A)')
' * Copyright (c) by the University of Illinois *'
159 WRITE(stdout,
'(A)')
' * *'
160 WRITE(stdout,
'(A,/)')
' ******************************************************'
164 CALL getarg(1,global%casename)
165 CALL getarg(2,verbosity)
167 IF (len_trim(global%casename)==0 .OR. len_trim(verbosity)==0)
THEN
168 WRITE(stdout,
'(/,A,//,5(A,/))') &
169 'Usage: rocvav <casename> <verbosity>', &
170 ' verbosity = 0 - no output', &
171 ' = 1 - moderate output',&
174 CALL mpi_finalize( global%mpierr )
179 READ(verbosity,*) global%verbLevel
183 global%startLevel = 1
187 IF (global%verbLevel /= verbose_none) &
188 WRITE(stdout,
'(/,A)')
'RFLO Reading region topology ...'
192 DO ireg=1,global%nRegions
193 regionss1(ireg)%startLevel = global%startLevel
194 regionss1(ireg)%currLevel = global%startLevel
195 IF (regionss1(ireg)%nGridLevels < regionss1(ireg)%currLevel)
THEN
196 WRITE(
msg,1000) ireg,global%startLevel
203 IF (global%verbLevel /= verbose_none) &
204 WRITE(stdout,
'(/,A)')
'RFLO Reading user input ...'
212 IF (global%flowType == flow_steady)
THEN
213 global%currentIter = 0
215 global%timeStamp = 0.0_rfreal
220 IF (global%verbLevel /= verbose_none) &
221 WRITE(stdout,
'(/,A)')
'RocVAV Reading user input ...'
227 IF (global%verbLevel /= verbose_none) &
228 WRITE(stdout,
'(/,A)')
'RocVAV Reading Stream1 Data ...'
234 IF (global%verbLevel /= verbose_none) &
235 WRITE(stdout,
'(/,A)')
'RocVAV Compute Analytical Solution Data for Stream2...'
241 IF (global%verbLevel /= verbose_none) &
242 WRITE(stdout,
'(/,A)')
'RocVAV Reading Stream2 Data ...'
248 DO icompare=1,globalrvav%nComparisons
250 rvavcompare => globalrvav%RVAVcompare(icompare)
252 IF (global%verbLevel /= verbose_none)
THEN
253 WRITE(stdout,
'(/,A,I5.5,A)')
'In comparison = ',icompare,
'we are comparing:'
254 WRITE(stdout,
'(A,I5.5)')
'Stream1 block = ' ,rvavcompare%blockS1
255 WRITE(stdout,
'(A,I5.5)')
'Stream2 block = ' ,rvavcompare%blockS2
256 WRITE(stdout,
'(A,I5.5)')
'Stream1 variable = ' ,rvavcompare%variableIndexS1
257 WRITE(stdout,
'(A,I5.5)')
'Stream2 variable = ' ,rvavcompare%variableIndexS2
262 IF (globalrvav%fileTypeS1 == file_computed .AND. &
263 globalrvav%fileTypeS2 == file_computed)
THEN
265 IF (rvavcompare%blockS1 /= rvavcompare%blockS2)
THEN
266 WRITE(stdout,
'(/,A)')
'Streams 1 and 2 are both Computed Results'
267 WRITE(stdout,
'(A)')
'Block numbers on Stream1 and Stream2 do not match'
268 WRITE(stdout,
'(A)')
'RocVAV will abort'
269 CALL
errorstop( global, err_previous_errors,__line__ )
274 IF (rvavcompare%operationS1 /= rvavcompare%operationS2)
THEN
275 WRITE(stdout,
'(/,A)')
'Operations in Stream1 and Stream2 do not match'
276 WRITE(stdout,
'(A)')
'RocVAV will abort'
277 CALL
errorstop( global, err_previous_errors,__line__ )
280 ibegs1 = rvavcompare%ibegS1
281 iends1 = rvavcompare%iendS1
282 ijumps1 = rvavcompare%ijumpS1
284 jbegs1 = rvavcompare%jbegS1
285 jends1 = rvavcompare%jendS1
286 jjumps1 = rvavcompare%jjumpS1
288 kbegs1 = rvavcompare%kbegS1
289 kends1 = rvavcompare%kendS1
290 kjumps1 = rvavcompare%kjumpS1
292 variableindexs1 = rvavcompare%variableIndexS1
293 filetypes1 = globalrvav%fileTypeS1
295 ibegs2 = rvavcompare%ibegS2
296 iends2 = rvavcompare%iendS2
297 ijumps2 = rvavcompare%ijumpS2
299 jbegs2 = rvavcompare%jbegS2
300 jends2 = rvavcompare%jendS2
301 jjumps2 = rvavcompare%jjumpS2
303 kbegs2 = rvavcompare%kbegS2
304 kends2 = rvavcompare%kendS2
305 kjumps2 = rvavcompare%kjumpS2
307 icoffs1 = globalrvav%iCOffS1
308 ijcoffs1 = globalrvav%iCOffS1
310 icoffs2 = globalrvav%iCOffS2
311 ijcoffs2 = globalrvav%iCOffS2
313 variableindexs2 = rvavcompare%variableIndexS2
314 filetypes2 = globalrvav%fileTypeS2
315 similaritytypes2 = globalrvav%similarityTypeS2
317 inodess1 = int(
REAL( (iends1-ibegs1)/ijumps1,kind=rfreal))+1
318 jnodess1 = int(
REAL( (jends1-jbegs1)/jjumps1,kind=rfreal))+1
319 knodess1 = int(
REAL( (kends1-kbegs1)/kjumps1,kind=rfreal))+1
321 inodess2 = int(
REAL( (iends2-ibegs2)/ijumps2,kind=rfreal))+1
322 jnodess2 = int(
REAL( (jends2-jbegs2)/jjumps2,kind=rfreal))+1
323 knodess2 = int(
REAL( (kends2-kbegs2)/kjumps2,kind=rfreal))+1
325 IF (global%verbLevel /= verbose_none)
THEN
326 WRITE(stdout,
'(/,A,3(I5,3X))')
'Stream1 iNodes,jNodes,kNodes = ', &
327 inodess1,jnodess1,knodess1
328 WRITE(stdout,
'(A,3(I5,3X))')
'Stream2 iNodes,jNodes,kNodes = ', &
329 inodess2,jnodess2,knodess2
334 IF (.NOT.
ASSOCIATED(globalrvav%evS1))
THEN
335 ALLOCATE( globalrvav%evS1(inodess1,jnodess1,knodess1),stat=errorflag )
336 global%error = errorflag
337 IF (global%error /= 0) CALL
errorstop( global, err_allocate, __line__ )
340 IF (.NOT.
ASSOCIATED(globalrvav%evS2))
THEN
341 ALLOCATE( globalrvav%evS2(inodess2,jnodess2,knodess2),stat=errorflag )
342 global%error = errorflag
343 IF (global%error /= 0) CALL
errorstop( global, err_allocate, __line__ )
348 globalrvav%evS1 = 0.0_rfreal
349 globalrvav%evS2 = 0.0_rfreal
353 iregs1 = rvavcompare%blockS1
355 IF (global%verbLevel /= verbose_none) &
356 WRITE(stdout,
'(/,A)')
'Entering RVAV_ExtractVariables-EVS1'
359 ibegs1,iends1,ijumps1, &
360 jbegs1,jends1,jjumps1, &
361 kbegs1,kends1,kjumps1, &
365 indcp,indmol,globalrvav%evS1 )
367 IF (global%verbLevel /= verbose_none) &
368 WRITE(stdout,
'(/,A)')
'Exiting RVAV_ExtractVariables-EVS1'
372 iregs2 = rvavcompare%blockS2
374 IF (global%verbLevel /= verbose_none) &
375 WRITE(stdout,
'(/,A)')
'Entering RVAV_ExtractVariables-EVS2'
378 ibegs2,iends2,ijumps2, &
379 jbegs2,jends2,jjumps2, &
380 kbegs2,kends2,kjumps2, &
384 indcp,indmol,globalrvav%evS2 )
386 IF (global%verbLevel /= verbose_none) &
387 WRITE(stdout,
'(/,A)')
'Exiting RVAV_ExtractVariables-EVS2'
391 IF ( filetypes2 == file_analytical .AND. &
392 similaritytypes2 /= 0 )
THEN
393 IF ( global%verbLevel/=verbose_none ) &
394 WRITE(stdout,
'(/,A)')
'Entering RVAV_ComputeSimilarField-EVS2'
397 inodess1,jnodess1,knodess1, &
402 IF ( global%verbLevel/=verbose_none ) &
403 WRITE(stdout,
'(/,A)')
'Entering RVAV_ComputeSimilarField-EVS2'
409 IF (global%verbLevel /= verbose_none)
THEN
410 evs1min = +1.0e+30_rfreal
411 evs1max = -1.0e+30_rfreal
412 evs2min = +1.0e+30_rfreal
413 evs2max = -1.0e+30_rfreal
418 evs1min =
min(globalrvav%evS1(
i,
j,
k), evs1min)
419 evs1max =
max(globalrvav%evS1(
i,
j,
k), evs1max)
427 evs2min =
min(globalrvav%evS2(
i,
j,
k), evs2min)
428 evs2max =
max(globalrvav%evS2(
i,
j,
k), evs2max)
433 WRITE(stdout,
'(A,2E14.5)')
'MIN-MAX of EVS1',evs1min,evs1max
434 WRITE(stdout,
'(A,2E14.5)')
'MIN-MAX of EVS2',evs2min,evs2max
440 inodess1 = int(
REAL((iends1-ibegs1)/ijumps1,kind=rfreal)) + 1
441 jnodess1 = int(
REAL((jends1-jbegs1)/jjumps1,kind=rfreal)) + 1
442 knodess1 = int(
REAL((kends1-kbegs1)/kjumps1,kind=rfreal)) + 1
444 inodess2 = int(
REAL((iends2-ibegs2)/ijumps2,kind=rfreal)) + 1
445 jnodess2 = int(
REAL((jends2-jbegs2)/jjumps2,kind=rfreal)) + 1
446 knodess2 = int(
REAL((kends2-kbegs2)/kjumps2,kind=rfreal)) + 1
448 IF (global%verbLevel /= verbose_none)
THEN
449 WRITE(stdout,
'(/,A,3(I5,3X))')
'Stream1 iNodes,jNodes,kNodes = ', &
450 inodess1,jnodess1,knodess1
451 WRITE(stdout,
'(/,A,3(I5,3X))')
'Stream2 iNodes,jNodes,kNodes = ', &
452 inodess2,jnodess2,knodess2
455 IF (rvavcompare%operationS1 == compute_errors_only)
THEN
456 IF (inodess1 /= inodess2)
THEN
457 WRITE(stdout,
'(/,A,2(I5,3X))') &
458 'Non Matching Number of I-Nodes for Streams 1 and 2: ', &
460 CALL
errorstop( global, err_previous_errors,__line__ )
463 IF (jnodess1 /= jnodess2)
THEN
464 WRITE(stdout,
'(/,A,2(I5,3X))') &
465 'Non Matching Number of J-Nodes for Streams 1 and 2: ', &
467 CALL
errorstop( global, err_previous_errors,__line__ )
470 IF (knodess1 /= knodess2)
THEN
471 WRITE(stdout,
'(/,A,2(I5,3X))') &
472 'Non Matching Number of K-Nodes for Streams 1 and 2: ', &
474 CALL
errorstop( global, err_previous_errors,__line__ )
479 IF (rvavcompare%operationS1 == compute_errors_only)
THEN
489 DEALLOCATE( globalrvav%evS1,stat=errorflag )
490 global%error = errorflag
491 IF( global%error /= 0 ) CALL
errorstop( global,err_deallocate,__line__ )
493 DEALLOCATE( globalrvav%evS2,stat=errorflag )
494 global%error = errorflag
495 IF( global%error /= 0 ) CALL
errorstop( global,err_deallocate,__line__ )
503 WRITE(stdout,
'(/,A)')
'RocVAV Finished.'
506 CALL mpi_finalize( global%mpierr )
509 1000
FORMAT(
'Region ',i5,
', grid level= ',i2,
'.')
subroutine rvav_readfilestream2(regionsS1, regionsS2)
subroutine rvav_computeerror(global, iCompare, iNodes, jNodes, kNodes)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
subroutine registerfunction(global, funName, fileName)
subroutine rflo_readsolutionregion(iReg, regions)
subroutine rvav_computesimilarfield(global, iNodes, jNodes, kNodes, similarityType, variableIndex, ev)
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
subroutine rflo_readgridregion(iReg, regions)
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
subroutine rvav_plotresults(global, iCompare, iNodes, jNodes, kNodes)
subroutine rvav_readfilestream1(regionsS1)
subroutine buildversionstring(versionString)
subroutine rvav_computeanalyticalsolution(similarityType, regionsS1)
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine rflo_getdimensdummynodes(region, iLev, idnbeg, idnend, jdnbeg, jdnend, kdnbeg, kdnend)
subroutine rflo_readregiontopology(global, regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)