34 $
'module ['//trim(pwit_name)//
'] already registered')
43 $
'parent module ['//trim(tstpr_name)//
'] not registered')
48 $
'Power iterations for time stepper')
52 call mntr_tmr_reg(pwit_tmr_ini_id,tstpr_tmr_ini_id,pwit_id,
53 $
'PWIT_INI',
'Power iteration initialisation time',.true.)
55 call mntr_tmr_reg(pwit_tmr_evl_id,tstpr_tmr_evl_id,pwit_id,
56 $
'PWIT_EVL',
'Power iteration evolution time',.true.)
59 call rprm_sec_reg(pwit_sec_id,pwit_id,
'_'//adjustl(pwit_name),
60 $
'Runtime paramere section for power iteration module')
65 $
'Vector initial norm',rpar_real,0,1.0,.false.,
' ')
71 ltim = dnekclock() - ltim
91 integer itmp, il, set_in
92 real rtmp, ltim, lnorm
97 integer ierr, lmid, lsid, lrpid
100 real dnekclock, cnht_glsc2_wt
101 logical chkpts_is_initialised
104 if (pwit_ifinit)
then
106 $
'module ['//trim(pwit_name)//
'] already initialised.')
114 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,pwit_l2n_id,rpar_real)
127 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,lrpid,rpar_log)
138 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,lrpid,rpar_int)
156 $
'Error reading checkpoint parameters')
160 if(.not.chkpts_is_initialised())
call mntr_abort(pwit_id,
161 $
'Checkpointing module not initialised')
162 set_in = pwit_fnum -1
170 lnorm = cnht_glsc2_wt(vxp,vyp,vzp,tp,vxp,vyp,vzp,tp,bm1)
171 lnorm = sqrt(pwit_l2n/lnorm)
174 if (tstpr_pr.ne.0)
then
176 itmp = nx2*ny2*nz2*nelv
177 call cmult(prp,lnorm,itmp)
185 call cnht_opcopy (pwit_vx,pwit_vy,pwit_vz,pwit_t,vxp,vyp,vzp,tp)
188 call mntr_log(pwit_id,lp_prd,
'POWER ITERATIONS initialised')
189 call mntr_logr(pwit_id,lp_prd,
'L2NORM = ',pwit_l2n)
195 ltim = dnekclock() - ltim
232 real TA1 (LPX1*LPY1*LPZ1*LELV), TA2 (LPX1*LPY1*LPZ1*LELV),
233 $ TA3 (LPX1*LPY1*LPZ1*LELV), TAT (LPX1*LPY1*LPZ1*LELT)
234 COMMON /scruz/ ta1, ta2, ta3, tat
238 real lnorm, grth_old, ltim
241 real dnekclock, cnht_glsc2_wt
247 lnorm = cnht_glsc2_wt(vxp,vyp,vzp,tp,vxp,vyp,vzp,tp,bm1)
248 lnorm = sqrt(pwit_l2n/lnorm)
251 if (tstpr_pr.ne.0)
then
253 itmp = nx2*ny2*nz2*nelv
254 call cmult(prp,lnorm,itmp)
264 grth_old = pwit_grw - grth_old
267 call cnht_opsub3 (ta1,ta2,ta3,tat,pwit_vx,pwit_vy,pwit_vz,pwit_t,
269 lnorm = cnht_glsc2_wt(ta1,ta2,ta3,tat,ta1,ta2,ta3,tat,bm1)
273 call mntr_log(pwit_id,lp_prd,
'POWER ITERATIONS: convergence')
274 call mntr_logr(pwit_id,lp_prd,
'||V-V_old|| = ',lnorm)
275 call mntr_logr(pwit_id,lp_prd,
'Growth ',pwit_grw)
281 call outpost2(vxp,vyp,vzp,prp,tp,itmp,
'PWI')
284 call outpost2(ta1,ta2,ta3,prp,tat,itmp,
'VDF')
287 if(lnorm.lt.tstpr_tol.and.grth_old.lt.tstpr_tol)
then
288 call mntr_log(pwit_id,lp_prd,
'Reached stopping criteria')
293 call cnht_opcopy(pwit_vx,pwit_vy,pwit_vz,pwit_t,vxp,vyp,vzp,tp)
297 if (lastep.eq.1.or.tstpr_cmax.eq.tstpr_vstep)
then
305 ltim = dnekclock() - ltim
308 if (lastep.eq.1)
then
310 call mntr_log(pwit_id,lp_prd,
'POWER ITERATIONS finalised')
311 call mntr_logr(pwit_id,lp_prd,
'||V-V_old|| = ',lnorm)
312 call mntr_logr(pwit_id,lp_prd,
'Growth ',pwit_grw)
336 integer ifile, step_cnt, fnum
337 character*132 fname(chkptms_fmax)
344 call mntr_log(pwit_id,lp_inf,
'Reading checkpoint snapshot')
376 integer ifile, step_cnt, set_out, fnum
377 character*132 fname(chkptms_fmax)
385 call mntr_log(pwit_id,lp_inf,
'Writing checkpoint snapshot')
subroutine stepper_register()
Register Arnoldi ARPACK module.
subroutine stepper_vsolve
Create Krylov space, get Ritz values and restart stepper phase.
logical function stepper_is_initialised()
Check if module was initialised.
subroutine stepper_init()
Initilise Arnoldi ARPACK module.
subroutine chkpt_get_fset(step_cnt, set_out)
Get step count to the checkpoint and a set number.
subroutine chkptms_restart_read(fname, fnum)
Read checkpoint snapshot.
subroutine chkptms_restart_write(fname, fnum, ifcoord)
Write checkpoint snapshot.
subroutine chkptms_set_name(fname, fnum, nset, ifile)
Generate set of restart file names in snapshot.
subroutine cnht_opcopy(a1, a2, a3, a4, b1, b2, b3, b4)
Copy vectors A=B (velocity and temperature)
subroutine cnht_opsub3(a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4)
Subtract vectors A = B-C (velocity and temperature)
subroutine cnht_opcmult(a1, a2, a3, a4, const)
Multiply vector by constant A = c*A (single coeff. for velocity and temperature)
subroutine mntr_logr(mid, priority, logs, rvar)
Write log message adding single real.
subroutine mntr_warn(mid, logs)
Write warning message.
subroutine mntr_tmr_add(mid, icount, time)
Check if timer id is registered. This operation is performed locally.
subroutine mntr_mod_is_name_reg(mid, mname)
Check if module name is registered and return its id.
subroutine mntr_abort(mid, logs)
Abort simulation.
subroutine mntr_log(mid, priority, logs)
Write log message.
subroutine mntr_mod_reg(mid, pmid, mname, mdscr)
Register new module.
subroutine mntr_tmr_reg(mid, pmid, modid, mname, mdscr, ifsum)
Register new timer.
subroutine mntr_check_abort(mid, ierr, logs)
Abort simulation.
subroutine stepper_read(set_in)
Read restart files.
subroutine stepper_write
Write restart files.
subroutine rprm_rp_is_name_reg(rpid, mid, pname, ptype)
Check if parameter name is registered and return its id. Check flags as well.
subroutine rprm_rp_get(ipval, rpval, lpval, cpval, rpid, ptype)
Get runtime parameter form active section. This operation is performed locally.
subroutine rprm_sec_is_name_reg(rpid, mid, pname)
Check if section name is registered and return its id. Check mid as well.
subroutine rprm_rp_reg(rpid, mid, pname, pdscr, ptype, ipval, rpval, lpval, cpval)
Register new runtime parameter.
subroutine rprm_sec_set_act(ifact, rpid)
Set section's activation flag. Master value is broadcasted.
subroutine rprm_sec_reg(rpid, mid, pname, pdscr)
Register new parameter section.
subroutine tstpr_dssum
Average velocity and temperature at element faces.
subroutine cmult(a, const, n)
subroutine outpost2(v1, v2, v3, vp, vt, nfldt, name3)