14 real(kind=kreal),
private :: current_time = 0.d0
15 real(kind=kreal),
private :: time_inc = 0.d0
16 real(kind=kreal),
private :: time_inc_base = 0.d0
35 real(kind=kreal),
intent(in) :: time
40 real(kind=kreal),
intent(in) :: dtime
45 real(kind=kreal),
intent(in) :: dtime_base
46 time_inc_base = dtime_base
50 current_time = current_time + time_inc
55 write(
ista,
'(A10,"-+-",A60,"-+-",A40)') repeat(
"-",10),repeat(
"-",60),repeat(
"-",40)
56 write(
ista,
'(2A5," | ",2A5,2A7,3A12," | ",A40)')
' ',
' ',
' ',
' # of',
'MAX #',
'TOT #',
'',
'',
'',
''
57 write(
ista,
'(2A5," | ",2A5,2A7,3A12," | ",A7,A33)') &
58 &
'STEP',
'SUB',
'STAT',
' CONT',
'NEWTON',
'NEWTON',
'START',
'TIME',
'END',
'MESSAGE',
''
59 write(
ista,
'(2A5," | ",2A5,2A7,3A12," | ",A40)') &
60 &
'',
'STEP',
' ',
'ITER',
'ITER',
'ITER',
'TIME',
'INC',
'TIME',
''
61 write(
ista,
'(A10,"-+-",A60,"-+-",A40)') repeat(
"-",10),repeat(
"-",60),repeat(
"-",40)
64 subroutine fstr_timeinc_printstatus( stepinfo, fstrPARAM, totstep, substep, NRstatI, NRstatR, AutoINC_stat, Cutback_stat )
67 integer(kind=kint),
intent(in) :: totstep
68 integer(kind=kint),
intent(in) :: substep
69 integer(kind=kint),
intent(in) :: NRstatI(:)
70 real(kind=kreal),
intent(in) :: nrstatr(:)
71 integer(kind=kint),
intent(inout) :: AutoINC_stat
72 integer(kind=kint),
intent(in) :: Cutback_stat
74 character(len=5) :: cstep, csstep, cstate, ccont
75 character(len=7) :: cmaxn, ctotn
76 character(len=12) :: ctime, cdtime, etime
77 character(len=40) :: message
80 painc = fstrparam%ainc(stepinfo%AincParam_id)
82 write(cstep,
'(I5)') totstep
83 write(csstep,
'(I5)') substep
87 write(ctime,
'(1pE12.4)') current_time
88 write(cdtime,
'(1pE12.4)') time_inc
90 if( cutback_stat > 0 )
then
91 write(etime,
'(1pE12.4)') current_time
92 write(cstate,
'(I4,A)') cutback_stat,
'F'
93 if( nrstati(
knstdresn) == 1 )
write(message,
'(A)')
'Failed to converge due to MAXITER.'
94 if( nrstati(
knstdresn) == 2 )
write(message,
'(A)')
'Failed to converge due to MAXRES.'
95 if( nrstati(
knstdresn) == 3 )
write(message,
'(A)')
'Failed to converge due to MAXCONTITER.'
96 if( nrstati(
knstdresn) == 4 )
write(message,
'(A)')
'Failed to converge due to MatSolveError.'
97 if( cutback_stat == painc%CBbound )
write(message,
'(A)')
'# of successive cutback reached max.'
99 write(etime,
'(1pE12.4)') current_time+time_inc
100 write(cstate,
'(A5)')
'S'
101 write(message,
'(A)')
''
104 write(
ista,
'(2A5," | ",2A5,2A7,3A12," | ",A40)') cstep, csstep, cstate, ccont, &
105 & cmaxn, ctotn, ctime, cdtime, etime, message
110 logical,
intent(in) :: success_flag
111 write(
ista,
'(A10,"-+-",A60,"-+-",A40)') repeat(
"-",10),repeat(
"-",60),repeat(
"-",40)
112 if(success_flag)
then
113 write(
ista,
'(A)')
'FSTR_SOLVE_NLGEOM HAS COMPLETED SUCCESSFULLY'
115 write(
ista,
'(A)')
'FSTR_SOLVE_NLGEOM HAS NOT COMPLETED SUCCESSFULLY'
123 real(kind=kreal) :: endtime, remain_time
125 endtime = stepinfo%starttime + stepinfo%elapsetime
126 remain_time = (endtime-current_time)/stepinfo%elapsetime
137 if( stepinfo%timepoint_id == 0 )
return
140 & fstrparam%timepoints(stepinfo%timepoint_id))
147 integer(kind=kint),
intent(in) :: substep
148 integer(kind=kint),
intent(in) :: NRstatI(:)
149 real(kind=kreal),
intent(in) :: nrstatr(:)
150 integer(kind=kint),
intent(inout) :: AutoINC_stat
151 integer(kind=kint),
intent(in) :: Cutback_stat
153 real(kind=kreal) :: timeinc0
154 real(kind=kreal) :: endtime, remain
155 logical :: to_be_decreased, to_be_increased
158 painc = fstrparam%ainc(stepinfo%AincParam_id)
161 timeinc0 = stepinfo%initdt
163 if( cutback_stat > 0 )
then
164 timeinc0 = painc%ainc_Rc*time_inc
165 if(
myrank == 0)
write(*,
'(2(A,E10.3))')
'time increment is decreased from ', time_inc_base,
' to ', timeinc0
168 if( substep == 1 )
then
169 timeinc0 = stepinfo%initdt
172 timeinc0 = time_inc_base
175 to_be_decreased = .false.
181 to_be_increased = .true.
189 if(to_be_decreased)
then
190 autoinc_stat = min(autoinc_stat,0) - 1
191 else if(to_be_increased)
then
192 autoinc_stat = max(autoinc_stat,0) + 1
197 if( autoinc_stat <= -painc%NRtimes_s )
then
198 timeinc0 = painc%ainc_Rs*timeinc0
199 if(
myrank == 0)
write(*,
'(2(A,E10.3))')
'time increment is decreased from ', time_inc_base,
' to ', timeinc0
200 else if( autoinc_stat >= painc%NRtimes_l )
then
201 timeinc0 = dmin1(painc%ainc_Rl*timeinc0,stepinfo%maxdt)
202 if(
myrank == 0)
write(*,
'(2(A,E10.3))')
'time increment is increased from ', time_inc_base,
' to ', timeinc0
208 if( timeinc0 < stepinfo%mindt )
then
210 write(*,
'(2(A,E10.3))')
'Error: current time increment ',timeinc0,
' is smaller than lower bound',stepinfo%mindt
216 endtime = stepinfo%starttime + stepinfo%elapsetime
217 time_inc_base = dmin1(timeinc0,endtime-current_time)
218 if( stepinfo%timepoint_id > 0 )
then
220 time_inc = dmin1(time_inc_base,remain)
222 time_inc = time_inc_base