104 include
"roccomf90.h"
109 CHARACTER(*),
INTENT(in) :: insurf, invol
110 DOUBLE PRECISION,
INTENT(in) :: initialtime
115 CHARACTER(*) :: casename
120 TYPE(t_region
),
POINTER :: regions(:)
123 CHARACTER(CHRLEN) ::
msg, versionstring, headerstring, fname
125 INTEGER :: headerwidth
126 INTEGER :: solver,
error, margin, versionwidth, ireg, errorflag
128 LOGICAL :: fileexists,dummylogical
136 global => globalgenx%global
138 global%timeStamp = initialtime
139 global%currentTime = initialtime
140 global%currentIter = -1
143 global%casename = casename
144 global%verbLevel = verblevel
147 global%currentTime = -1._rfreal
148 global%currentIter = -1
153 'RFLO_InitFlowSolver.F90' )
155 global%nProcAlloc = 1
156 global%myProcid = masterproc
157 global%mpierr = err_none
158 global%error = err_none
160 global%pi = 4._rfreal*atan(1._rfreal)
161 global%rad = global%pi/180._rfreal
162 global%calcCellCtr = .false.
163 global%calcFaceCtr = .false.
167 global%moveGridNbour = 6
172 fname = trim(global%winName)//
'/RocfloControl.txt'
174 OPEN(if_control,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
175 global%error = errorflag
176 IF (global%error /= 0) &
177 CALL
errorstop( global,err_file_open,__line__,
'File: '//trim(fname) )
179 READ(if_control,
'(A)',iostat=errorflag) global%casename
180 global%error = errorflag
181 IF (global%error /= 0) &
182 CALL
errorstop( global,err_file_read,__line__,
'File: '//trim(fname) )
184 READ(if_control,*,iostat=errorflag) global%verbLevel
185 global%error = errorflag
186 IF (global%error /= 0) global%verbLevel = 1
188 READ(if_control,
'(A)',iostat=errorflag) global%inDir
189 global%error = errorflag
190 IF (global%error /= 0)
THEN
191 global%inDir = trim(global%winName)//
'/'
193 IF (global%inDir(len_trim(global%inDir):len_trim(global%inDir)) /=
'/') &
194 global%inDir = trim(global%inDir)//
'/'
197 READ(if_control,
'(A)',iostat=errorflag) global%outDir
198 global%error = errorflag
199 IF (global%error /= 0)
THEN
200 global%outDir = trim(global%winName)//
'/'
202 IF (global%outDir(len_trim(global%outDir):len_trim(global%outDir)) /=
'/') &
203 global%outDir = trim(global%outDir)//
'/'
205 global%error = err_none
213 global%mpiComm = mpi_comm_world
214 CALL mpi_init( global%mpierr )
215 IF (global%mpierr /= 0) CALL
errorstop( global,err_mpi_trouble,__line__ )
216 global%mpiTagMax = 32768
221 dummylogical = .true.
222 CALL mpi_attr_get(mpi_comm_world,mpi_tag_ub,global%mpiTagMax,dummylogical,dummy)
226 CALL mpi_comm_size( global%mpiComm,global%nProcAlloc,global%mpierr )
227 IF (global%mpierr /= 0) CALL
errorstop( global,err_mpi_trouble,__line__ )
229 CALL mpi_comm_rank( global%mpiComm,global%myProcid,global%mpierr )
230 IF (global%mpierr /= 0) CALL
errorstop( global,err_mpi_trouble,__line__ )
233 IF (global%myProcid==masterproc .AND. global%verbLevel/=verbose_none)
THEN
237 versionwidth = len_trim(versionstring)
238 margin = (headerwidth-versionwidth)/2
239 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
240 headerstring(1:1) =
'*'
241 headerstring(headerwidth:headerwidth) =
'*'
243 WRITE(stdout,
'(/,A)') solver_name//
' *****************************************************'
244 WRITE(stdout,
'(A)') solver_name//
' * *'
245 WRITE(stdout,
'(A)') solver_name//
' * RocfloMP *'
246 WRITE(stdout,
'(A)') solver_name//
' * *'
248 WRITE(stdout,
'(A)') solver_name//
' * Copyright (C) 2015 Illinois Rocstar LLC. *'
249 WRITE(stdout,
'(A)') solver_name//
' * *'
250 WRITE(stdout,
'(A,/)') solver_name//
' *****************************************************'
255 IF (global%myProcid==masterproc .AND. global%verbLevel/=verbose_low)
THEN
260 WRITE(stdout,
'(A)' ) solver_name//
' -----------------------------------------------'
261 WRITE(stdout,
'(A)' ) solver_name//
' WARNING '
262 WRITE(stdout,
'(A)' ) solver_name//
' Compiled to check for gradients of u,v,w and T '
263 WRITE(stdout,
'(A,/)') solver_name//
' -----------------------------------------------'
268 versionwidth = len_trim(versionstring)
269 margin = (headerwidth-versionwidth)/2
270 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
271 WRITE(stdout,
'(A)' ) solver_name//
' --------------------------------'
272 WRITE(stdout,
'(A)' ) solver_name//
' Compiled with Statistics module '
273 WRITE(stdout,
'(A)' ) solver_name//
' '//trim(headerstring)
274 WRITE(stdout,
'(A,/)') solver_name//
' --------------------------------'
279 versionwidth = len_trim(versionstring)
280 margin = (headerwidth-versionwidth)/2
281 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
282 WRITE(stdout,
'(A)' ) solver_name//
' --------------------------------'
283 WRITE(stdout,
'(A)' ) solver_name//
' Compiled with Lagrangian module '
284 WRITE(stdout,
'(A)' ) solver_name//
' '//trim(headerstring)
285 WRITE(stdout,
'(A,/)') solver_name//
' --------------------------------'
290 versionwidth = len_trim(versionstring)
291 margin = (headerwidth-versionwidth)/2
292 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
293 WRITE(stdout,
'(A)' ) solver_name//
' --------------------------------'
294 WRITE(stdout,
'(A)' ) solver_name//
' Compiled with Eulerian module '
295 WRITE(stdout,
'(A)' ) solver_name//
' '//trim(headerstring)
296 WRITE(stdout,
'(A,/)') solver_name//
' --------------------------------'
301 versionwidth = len_trim(versionstring)
302 margin = (headerwidth-versionwidth)/2
303 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
304 WRITE(stdout,
'(A)' ) solver_name//
' --------------------------------'
305 WRITE(stdout,
'(A)' ) solver_name//
' Compiled with Radiation module '
306 WRITE(stdout,
'(A)' ) solver_name//
' '//trim(headerstring)
307 WRITE(stdout,
'(A,/)') solver_name//
' --------------------------------'
312 versionwidth = len_trim(versionstring)
313 margin = (headerwidth-versionwidth)/2
314 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
315 WRITE(stdout,
'(A)' ) solver_name//
' --------------------------------'
316 WRITE(stdout,
'(A)' ) solver_name//
' Compiled with Species module '
317 WRITE(stdout,
'(A)' ) solver_name//
' '//trim(headerstring)
318 WRITE(stdout,
'(A,/)') solver_name//
' --------------------------------'
323 versionwidth = len_trim(versionstring)
324 margin = (headerwidth-versionwidth)/2
325 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
326 WRITE(stdout,
'(A)' ) solver_name//
' --------------------------------'
327 WRITE(stdout,
'(A)' ) solver_name//
' Compiled with Turbulence module '
328 WRITE(stdout,
'(A)' ) solver_name//
' '//trim(headerstring)
329 WRITE(stdout,
'(A,/)') solver_name//
' --------------------------------'
334 versionwidth = len_trim(versionstring)
335 margin = (headerwidth-versionwidth)/2
336 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
337 WRITE(stdout,
'(A)' ) solver_name//
' --------------------------------'
338 WRITE(stdout,
'(A)' ) solver_name//
' Compiled with Interaction module'
339 WRITE(stdout,
'(A)' ) solver_name//
' '//trim(headerstring)
340 WRITE(stdout,
'(A,/)') solver_name//
' --------------------------------'
345 versionwidth = len_trim(versionstring)
346 margin = (headerwidth-versionwidth)/2
347 headerstring(margin+1:margin+versionwidth) = versionstring(1:versionwidth)
348 WRITE(stdout,
'(A)' ) solver_name//
' --------------------------------'
349 WRITE(stdout,
'(A)' ) solver_name//
' Compiled with Periodic module '
350 WRITE(stdout,
'(A)' ) solver_name//
' '//trim(headerstring)
351 WRITE(stdout,
'(A,/)') solver_name//
' --------------------------------'
357 INQUIRE(file=
"STOP",exist=fileexists)
360 errorflag = com_call_system(
"rm -f STOP")
361 global%error = errorflag
362 IF (global%error /= 0) &
363 CALL
errorstop( global,err_system_command,__line__,
'rm -f STOP' )
365 CALL system(
'rm -f STOP' )
371 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_low)
THEN
372 WRITE(stdout,
'(A,A,A,/)') solver_name//
' Case <', &
373 trim(global%casename),
'> running'
375 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high)
THEN
376 WRITE(stdout,
'(A)') solver_name//
' Reading region topology ...'
381 globalgenx%regions => regions
387 global%nProcAlloc =
min(global%nProcAlloc,global%nRegions)
396 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_low) &
397 WRITE(stdout,
'(A)') solver_name//
' Reading user input ...'
415 DO ireg=1,global%nRegions
416 IF (regions(ireg)%mixtInput%flowModel == flow_navst) solver = 1
423 CALL mpi_barrier( global%mpiComm,global%mpierr )
425 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
426 WRITE(stdout,
'(A)') solver_name//
' Checking BCs of regions ...'
436 CALL mpi_barrier( global%mpiComm,global%mpierr )
439 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
440 WRITE(stdout,
'(A)') solver_name// &
441 ' Searching source regions for edge & corner cells ...'
449 CALL mpi_barrier( global%mpiComm,global%mpierr )
451 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
452 WRITE(stdout,
'(A)') solver_name//
' Allocating memory ...'
459 CALL mpi_barrier( global%mpiComm,global%mpierr )
461 IF (global%degenrtEc .AND. global%myProcid==masterproc)
THEN
462 IF (global%verbLevel>=verbose_high) &
463 WRITE(stdout,
'(A)') solver_name// &
464 ' Write degenerated edges and corners into file ...'
474 CALL mpi_barrier( global%mpiComm,global%mpierr )
476 IF (global%flowType == flow_unsteady .AND. global%doStat==active)
THEN
477 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
478 WRITE(stdout,
'(A)') solver_name// &
479 ' Doing stat mapping ...'
487 CALL mpi_barrier( global%mpiComm,global%mpierr )
489 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
490 WRITE(stdout,
'(A)') solver_name// &
491 ' Reading grid file, exchanging geometry ...'
499 CALL mpi_barrier( global%mpiComm,global%mpierr )
501 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
502 WRITE(stdout,
'(A)') solver_name// &
503 ' Initializing Grid Procedures ...'
509 CALL mpi_barrier( global%mpiComm,global%mpierr )
511 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
512 WRITE(stdout,
'(A)') solver_name//
' Preparing GenX interface ...'
520 CALL mpi_barrier( global%mpiComm,global%mpierr )
522 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
523 WRITE(stdout,
'(A)') solver_name// &
524 ' Getting geometry ...'
531 CALL mpi_barrier( global%mpiComm,global%mpierr )
533 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
534 WRITE(stdout,
'(A)') solver_name//
' Calculating & checking grid metrics ...'
542 CALL mpi_barrier( global%mpiComm,global%mpierr )
544 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
545 WRITE(stdout,
'(A)') solver_name//
' Calculating & checking turbulence metrics ...'
551 CALL mpi_barrier( global%mpiComm,global%mpierr )
553 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
554 WRITE(stdout,
'(A)') solver_name//
' Setting metrics for lagrangian particles ...'
561 CALL mpi_barrier( global%mpiComm,global%mpierr )
563 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
564 WRITE(stdout,
'(A)') solver_name//
' Reading flow solution ...'
571 CALL mpi_barrier( global%mpiComm,global%mpierr )
573 IF (global%thrustType /= thrust_none)
THEN
574 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
575 WRITE(stdout,
'(A)') solver_name//
' Searching for thrust patches ...'
577 CALL mpi_barrier( global%mpiComm,global%mpierr )
579 DO ireg=1,global%nRegions
580 IF (regions(ireg)%procid==global%myProcid .AND. &
581 regions(ireg)%active==active)
THEN
591 CALL mpi_barrier( global%mpiComm,global%mpierr )
593 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
594 WRITE(stdout,
'(A)') solver_name//
' Initializing statistics ...'
601 CALL mpi_barrier( global%mpiComm,global%mpierr )
603 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
604 WRITE(stdout,
'(A)') solver_name//
' Opening native output files ...'
609 IF (global%thrustType /= thrust_none) &
612 IF (global%aeroCoeffs == active .AND. global%myProcid==masterproc) &
615 IF (global%myProcid==masterproc .AND. global%verbLevel/=verbose_none) &
616 WRITE(stdout,
'(//,A,/,A,/,A)') solver_name//
' Time stepping', &
617 solver_name//
' =============', &
622 IF (global%myProcid==masterproc .AND. global%verbLevel/=verbose_none)
THEN
623 WRITE(stdout,
'(A)') solver_name
624 IF (global%flowType == flow_steady) &
625 WRITE(stdout,1010) solver_name,solver_name
626 IF (global%flowType == flow_unsteady) &
627 WRITE(stdout,1015) solver_name,solver_name
634 CALL mpi_barrier( global%mpiComm,global%mpierr )
636 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
637 WRITE(stdout,
'(A)') solver_name//
' Sending boundary values to Rocstar ...'
638 DO ireg=1,global%nRegions
639 IF (regions(ireg)%procid==global%myProcid .AND. &
640 regions(ireg)%active==active)
THEN
647 CALL mpi_barrier( global%mpiComm,global%mpierr )
649 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high) &
650 WRITE(stdout,
'(A)') solver_name//
' All processors initialized ...'
657 1010
FORMAT(
a,
' iter',4
x,
'res-norm',5
x,
'force-x',6
x,
'force-y',6
x,
'force-z', &
658 6
x,
'mass-in',6
x,
'mass-out',/,
a,1
x,84(
'-'))
659 1015
FORMAT(
a,
' time',10
x,
'delta-t',6
x,
'force-x',6
x,
'force-y',6
x,
'force-z', &
660 6
x,
'mass-in',6
x,
'mass-out'/,
a,1
x,90(
'-'))
subroutine, public statbuildversionstring(versionString)
subroutine turb_buildversionstring(versionString)
subroutine peul_buildversionstring(versionString)
subroutine rflo_openthrustfile(global)
subroutine plag_rflo_setmetrics(regions)
subroutine, public initstatistics(regions)
subroutine, public rflo_markdegeneratvert(regions)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine inrt_buildversionstring(versionString)
subroutine radi_buildversionstring(versionString)
subroutine peri_buildversionstring(versionString)
subroutine rflo_getflowsolution(regions)
MPI_Comm communicator() const
subroutine rflo_openconverfile(global)
subroutine buildversionstring(versionString)
subroutine, public statmapping(global)
subroutine turb_calcmetrics(regions, isInit)
subroutine spec_buildversionstring(versionString)
subroutine rflo_initgridprocedures(regions)
**********************************************************************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
subroutine rflo_checkminimumcells(regions)
subroutine rflo_sendboundaryvalues(region, initialize)
subroutine, public rflo_openforcemomcofile(global)
subroutine, public rflo_readrestartinfo(global)
subroutine rflo_initflowsolver(casename, verbLevel, global, regions)
subroutine rflo_openprobefile(regions)
subroutine rflo_randominit(regions)
subroutine rflo_findsourceregions(regions)
subroutine rflo_findthrustpatches(region, iReg)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine rflo_findsourcepatches(regions)
void obtain_attribute(const COM::Attribute *attribute_in, COM::Attribute *user_attribute, int *pane_id=NULL)
Fill the destination (second) attribute from files using the data corresponding to the source (first)...
subroutine rflo_readregiontopology(global, regions)
subroutine rflo_getgeometry(regions, iread)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine, public rflo_writedegeneratec(regions)
subroutine, public rflo_calcgridmetrics(regions)
subroutine deregisterfunction(global)
subroutine rflo_initgenxinterface(regions, handle, solver, inSurf, inVolPlag, obtain_attribute)
subroutine rflo_checkregionfaces(regions)
subroutine plag_buildversionstring(versionString)
subroutine rflo_domemoryallocation(regions)