67 TYPE(t_region
),
POINTER :: regions(:)
73 CHARACTER(CHRLEN) :: rcsidentstring
74 INTEGER :: errorflag,icelldtmin,ireg,iregdtmin
75 INTEGER,
DIMENSION(:),
ALLOCATABLE :: globalvalsint,localvalsint
77 REAL(RFREAL),
DIMENSION(:),
ALLOCATABLE :: globalvalsreal,localvalsreal
79 TYPE(t_region
),
POINTER :: pregion
85 rcsidentstring =
'$RCSfile: RFLU_MinimumTimeStep.F90,v $ $Revision: 1.14 $'
87 global => regions(1)%global
90 'RFLU_MinimumTimeStep.F90')
97 DO ireg = 1,global%nRegionsLocal
98 pregion => regions(ireg)
100 IF ( pregion%mixtInput%frozenFlag .EQV. .false. )
THEN
101 pregion%dtMin = pregion%mixtInput%cfl*pregion%dtMin
102 pregion%dtMin =
min(global%dtImposed,pregion%dtMin)
104 pregion%dtMin = global%dtImposed
116 ALLOCATE(localvalsreal(0:global%nRegions),stat=errorflag)
117 global%error = errorflag
118 IF ( global%error /= err_none )
THEN
119 CALL
errorstop(global,err_allocate,__line__,
'localValsReal')
122 ALLOCATE(globalvalsreal(0:global%nRegions),stat=errorflag)
123 global%error = errorflag
124 IF ( global%error /= err_none )
THEN
125 CALL
errorstop(global,err_allocate,__line__,
'globalValsReal')
133 DO ireg = 0,global%nRegions
134 localvalsreal(ireg) = huge(1.0_rfreal)
137 DO ireg = 1,global%nRegionsLocal
138 pregion => regions(ireg)
140 localvalsreal(pregion%iRegionGlobal) = pregion%dtMin
143 CALL mpi_allreduce(localvalsreal(0:global%nRegions), &
144 globalvalsreal(0:global%nRegions),global%nRegions+1, &
145 mpi_rfreal,mpi_min,global%mpiComm,errorflag)
146 global%error = errorflag
147 IF ( global%error /= err_none )
THEN
148 CALL
errorstop(global,err_mpi_trouble,__line__)
155 dtmin = huge(1.0_rfreal)
157 DO ireg = 0,global%nRegions
158 IF ( globalvalsreal(ireg) < dtmin )
THEN
159 dtmin = globalvalsreal(ireg)
164 DO ireg = 1,global%nRegionsLocal
165 regions(ireg)%global%dtMin = dtmin
172 DEALLOCATE(localvalsreal,stat=errorflag)
173 global%error = errorflag
174 IF ( global%error /= err_none )
THEN
175 CALL
errorstop(global,err_deallocate,__line__,
'localValsReal')
178 DEALLOCATE(globalvalsreal,stat=errorflag)
179 global%error = errorflag
180 IF ( global%error /= err_none )
THEN
181 CALL
errorstop(global,err_deallocate,__line__,
'globalValsReal')
189 global%dTimeSystem = global%dtMin
199 IF ( global%dtMin < global%dtImposed .AND. &
200 global%dtMin < global%dtMinLimit )
THEN
206 ALLOCATE(localvalsint(0:global%nRegions),stat=errorflag)
207 global%error = errorflag
208 IF ( global%error /= err_none )
THEN
209 CALL
errorstop(global,err_allocate,__line__,
'localValsInt')
212 ALLOCATE(globalvalsint(0:global%nRegions),stat=errorflag)
213 global%error = errorflag
214 IF ( global%error /= err_none )
THEN
215 CALL
errorstop(global,err_allocate,__line__,
'globalValsInt')
223 DO ireg = 0,global%nRegions
224 localvalsint(ireg) = -huge(1)
227 DO ireg = 1,global%nRegionsLocal
228 pregion => regions(ireg)
230 localvalsint(pregion%iRegionGlobal) = pregion%dtMinLoc
233 CALL mpi_allreduce(localvalsint(0:global%nRegions), &
234 globalvalsint(0:global%nRegions),global%nRegions+1, &
235 mpi_integer,mpi_max,global%mpiComm,errorflag)
236 global%error = errorflag
237 IF ( global%error /= err_none )
THEN
238 CALL
errorstop(global,err_mpi_trouble,__line__)
241 IF ( global%myProcid == masterproc )
THEN
242 icelldtmin = globalvalsint(iregdtmin)
249 DEALLOCATE(localvalsint,stat=errorflag)
250 global%error = errorflag
251 IF ( global%error /= err_none )
THEN
252 CALL
errorstop(global,err_deallocate,__line__,
'localValsInt')
255 DEALLOCATE(globalvalsint,stat=errorflag)
256 global%error = errorflag
257 IF ( global%error /= err_none )
THEN
258 CALL
errorstop(global,err_deallocate,__line__,
'globalValsInt')
265 IF ( global%myProcid == masterproc .AND. &
266 global%verbLevel > verbose_none )
THEN
267 WRITE(stdout,
'(A,1X,A)') solver_name,
'Printing time step information...'
268 WRITE(stdout,
'(A,3X,A,1X,E16.9)') solver_name,
'Smallest time step:', &
270 WRITE(stdout,
'(A,3X,A)') solver_name,
'Location of smallest time step:'
271 WRITE(stdout,
'(A,5X,A,4X,I6)') solver_name,
'Region:',iregdtmin
272 WRITE(stdout,
'(A,5X,A,1X,I9)') solver_name,
'Cell: ',icelldtmin
273 WRITE(stdout,
'(A,1X,A)') solver_name, &
274 'Printing time step information done.'
subroutine registerfunction(global, funName, fileName)
subroutine rflu_minimumtimestep(regions)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)