31 LOGICAL,
external :: compare
37 INTEGER,
parameter :: reportnst_freq = 10
44 INTEGER :: failedcount_total
45 INTEGER :: countincpt_total
52 INTEGER,
allocatable :: minnst(:)
53 INTEGER,
allocatable :: minnst_all(:)
56 INTEGER,
allocatable :: maxnst(:)
57 INTEGER,
allocatable :: maxnst_all(:)
61 INTEGER,
allocatable :: countnst(:)
62 INTEGER,
allocatable :: countnst_all(:)
65 INTEGER,
allocatable :: homogns(:)
66 INTEGER,
allocatable :: homogns_all(:)
70 INTEGER,
allocatable :: hetrgns(:)
71 INTEGER,
allocatable :: hetrgns_all(:)
75 INTEGER,
allocatable :: failedcount_all(:)
78 INTEGER,
allocatable :: maxattempts(:)
79 INTEGER,
allocatable :: maxattempts_all(:)
82 INTEGER,
allocatable :: countincpt(:)
83 INTEGER,
allocatable :: countincpt_all(:)
85 DOUBLE PRECISION :: ode_starttime
110 failedcount_total = 0
115 allocate( failedcount_all(0:
numpes-1) )
120 allocate( minnst(0:
numpes-1)); minnst = 0
121 allocate( minnst_all(0:
numpes-1) )
125 allocate( maxnst(0:
numpes-1) ); maxnst = 0
126 allocate( maxnst_all(0:
numpes-1) )
130 allocate( countnst(5) );
IF(reportnst==1) countnst = 0
131 allocate( countnst_all(5) )
134 allocate( homogns(0:
numpes-1) ); homogns = 0
135 allocate( homogns_all(0:
numpes-1) )
139 allocate( hetrgns(0:
numpes-1) ); hetrgns = 0;
140 allocate( hetrgns_all(0:
numpes-1) )
143 allocate( maxattempts(0:
numpes-1) ); maxattempts = 0
144 allocate( maxattempts_all(0:
numpes-1) )
148 allocate( countincpt(0:
numpes-1) ); countincpt = 0
149 allocate( countincpt_all(0:
numpes-1) )
177 CALL cpu_time(ode_starttime)
185 write(*,
"(/3x,'Integrating stiff chemistry...')",advance=
"NO")
203 lode_dimn, latps, lincpt)
210 INTEGER,
intent(in) :: lNEQ_DIMN
214 INTEGER,
dimension(lNEQ_DIMN),
intent(in) :: lNEQ
216 INTEGER,
intent(in) :: lNST
218 INTEGER,
intent(in) :: lODE_DIMN
221 INTEGER,
intent(in) :: lAtps
224 LOGICAL,
intent(in) :: lIncpt
227 IF(lneq(1) == lode_dimn)
THEN 233 maxattempts(
mype) = max(latps, maxattempts(
mype))
235 minnst(
mype) = min(minnst(
mype), lnst)
236 maxnst(
mype) = max(maxnst(
mype), lnst)
239 countnst(1) = countnst(1) + 1
240 ELSE IF (lnst < 100)
THEN 241 countnst(2) = countnst(2) + 1
242 ELSE IF (lnst < 1000)
THEN 243 countnst(3) = countnst(3) + 1
244 ELSE IF (lnst < 10000)
THEN 245 countnst(4) = countnst(4) + 1
247 countnst(5) = countnst(5) + 1
250 IF(lincpt) countincpt(
mype) = countincpt(
mype) + 1
277 CHARACTER(LEN=64) :: lMsg0, lMsg1
279 DOUBLE PRECISION :: lODE_EndTime, lODE_RunTime
285 IF(mype ==
pe_io)
WRITE(*,
"(2x,'DONE.',/)")
288 CALL cpu_time(lode_endtime)
289 lode_runtime = lode_endtime - ode_starttime
293 minnst_all = 0;
CALL global_sum(minnst, minnst_all)
294 maxnst_all = 0;
CALL global_sum(maxnst, maxnst_all)
319 IF(mype ==
pe_io)
THEN 322 lmsg0=
'';
write(lmsg0,*) minval(minnst_all)
323 lmsg1=
'';
write(lmsg1,*) maxval(maxnst_all)
324 write(*,1000) trim(adjustl(lmsg0)), trim(adjustl(lmsg1))
327 lmsg0=
'';
write(lmsg0,*) sum(homogns_all)
328 lmsg1=
'';
write(lmsg1,*) sum(hetrgns_all)
329 write(*,1001) trim(adjustl(lmsg0)), trim(adjustl(lmsg1))
332 lmsg0=
'';
write(lmsg0,*) maxval(maxattempts_all)
333 write(*,1004) trim(adjustl(lmsg0))
336 countincpt_total = countincpt_total + sum(countincpt_all)
338 IF(countincpt_total > 0)
THEN 339 lmsg0=
'';
write(lmsg0,*) sum(countincpt_all)
340 lmsg1=
'';
write(lmsg1,*) countincpt_total
341 write(*,1002)
'incomplete', trim(adjustl(lmsg0)), trim(adjustl
345 failedcount_total = failedcount_total + sum(failedcount_all)
347 IF(failedcount_total > 0)
THEN 348 lmsg0=
'';
write(lmsg0,*) sum(failedcount_all)
349 lmsg1=
'';
write(lmsg1,*) failedcount_total
350 write(*,1002)
'failed', trim(adjustl(lmsg0)), trim(adjustl(lmsg1
353 IF(lode_runtime > 3.6d3)
THEN 354 lmsg0=
'';
write(lmsg0,
"(f8.4)") lode_runtime/3.6d3
356 ELSEIF(lode_runtime > 6.0d1)
THEN 357 lmsg0=
'';
write(lmsg0,
"(f8.4)") lode_runtime/6.0d1
360 lmsg0=
'';
write(lmsg0,
"(f8.4)") lode_runtime
363 write(*,1003) trim(adjustl(lmsg0)), trim(adjustl(lmsg1))
368 if(reportnst == reportnst_freq)
then 373 countnst_all = int(countnst_all/reportnst_freq)
375 if(mype ==
pe_io)
then 376 write(*,
"(/5x,'Average Integration Distribution:')")
377 write(*,
"(7x,'NST < 10^1: ', I6)")countnst_all(1)
378 write(*,
"(7x,'NST < 10^2: ', I6)")countnst_all(2)
379 write(*,
"(7x,'NST < 10^3: ', I6)")countnst_all(3)
380 write(*,
"(7x,'NST < 10^4: ', I6)")countnst_all(4)
381 write(*,
"(7x,'NST > 10^5: ', I6)")countnst_all(5)
390 reportnst = reportnst + 1
393 if(mype ==
pe_io)
write(*,
"(/' ')")
397 1000
Format(5x,
'Minimum/Maximum number of steps over all cells: ',a,
'/' 398 Format(5x,
'Number of cells with Homogeneous/Heterogeneous reactions: ''/' 399 Format(5x,
'Number of Current/Cumulative ',a,
' integrations: ',a,
'/' 400 Format(5x,
'CPU Time Used: ',a,
' ',a)
401 1004
Format(5x,
'Maximum number of integration attempts: ',a)
subroutine, public write_stiff_chem_stats
subroutine, public update_stiff_chem_stats(lNEQ, lNEQ_DIMN, lNST, lODE_DIMN, lAtps, lIncpt)
integer, dimension(:), allocatable, public failedcount
subroutine, public init_stiff_chem_stats
subroutine, public allocate_stiff_chem_stats