47 $
'module ['//trim(arna_name)//
'] already registered')
56 $
'parent module ['//trim(tstpr_name)//
'] not registered')
61 $
'Arnoldi ARPACK spectra calculation')
65 call mntr_tmr_reg(arna_tmr_ini_id,tstpr_tmr_ini_id,arna_id,
66 $
'ARNA_INI',
'Arnoldi ARPACK initialisation time',.true.)
68 call mntr_tmr_reg(arna_tmr_evl_id,tstpr_tmr_evl_id,arna_id,
69 $
'ARNA_EVL',
'Arnoldi ARPACK evolution time',.true.)
72 call rprm_sec_reg(arna_sec_id,arna_id,
'_'//adjustl(arna_name),
73 $
'Runtime paramere section for Arnoldi ARPACK module')
78 $
'Krylov space size',rpar_int,50,0.0,.false.,
' ')
81 $
'Number of eigenvalues',rpar_int,10,0.0,.false.,
' ')
87 ltim = dnekclock() - ltim
117 integer ierr, lmid, lsid, lrpid
123 if (arna_ifinit)
then
125 $
'module ['//trim(arna_name)//
'] already initiaised.')
133 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,arna_nkrl_id,rpar_int)
136 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,arna_negv_id,rpar_int)
149 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,lrpid,rpar_log)
160 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,lrpid,rpar_int)
178 $
'Error reading checkpoint parameters')
184 $
'IFHEAT requires #undef ARPACK_DIRECT')
187 if (arna_nkrl.gt.arna_lkrl)
call mntr_abort(arna_id,
188 $
'arna_nkrl bigger than arna_lkrl')
190 if (arna_negv.ge.(arna_nkrl/2))
call mntr_abort(arna_id,
191 $
'arna_negv > arna_nkrl/2')
195 nsteps = max(nsteps,tstpr_step*arna_nkrl*tstpr_cmax*2+10)
214 call izero(ipntarp,14)
227 nwlarp = (3*arna_nkrl+6)*arna_nkrl
245 arna_ns = tstpr_nv*ndim
248 arna_ns = arna_ns + tstpr_nt
250 if (arna_ns.gt.arna_ls)
call mntr_abort(arna_id,
251 $
'arna_ns too big; arna_ns > arna_ls')
254 call rzero(workda,wddima)
255 call rzero(workla,wldima)
256 call rzero(workea,wedima)
257 call rzero(vbasea,arna_ls*arna_lkrl)
258 call rzero(resida,arna_ls)
259 call rzero(driarp,arna_lkrl*4)
281 call col3(resida(1),vxp,v1mask,tstpr_nv)
282 call col3(resida(1+tstpr_nv),vyp,v2mask,tstpr_nv)
283 if (if3d)
call col3(resida(1+2*tstpr_nv),vzp,v3mask,tstpr_nv)
288 call copy(resida(1),vxp,tstpr_nv)
289 call copy(resida(1+tstpr_nv),vyp,tstpr_nv)
290 if (if3d)
call copy(resida(1+2*tstpr_nv),vzp,tstpr_nv)
292 if(ifheat)
call copy(resida(1+ndim*tstpr_nv),tp,tstpr_nt)
304 if (idoarp.ne.-1.and.idoarp.ne.1)
then
307 $
'stepper_init; error with arna_naupd, ido = '//trim(ctmp))
311 call mntr_log(arna_id,lp_prd,
'ARPACK initialised')
312 call mntr_log(arna_id,lp_prd,
'Parameters:')
313 call mntr_log(arna_id,lp_prd,
'BMAT = '//trim(bmatarp))
314 call mntr_log(arna_id,lp_prd,
'WHICH = '//trim(whicharp))
315 call mntr_logr(arna_id,lp_prd,
'TOL = ',tstpr_tol)
316 call mntr_logi(arna_id,lp_prd,
'NEV = ',arna_negv)
317 call mntr_logi(arna_id,lp_prd,
'NCV = ',arna_nkrl)
318 call mntr_logi(arna_id,lp_prd,
'IPARAM(1) = ',iparp(1))
319 call mntr_logi(arna_id,lp_prd,
'IPARAM(3) = ',iparp(3))
320 call mntr_logi(arna_id,lp_prd,
'IPARAM(7) = ',iparp(7))
321 call mntr_logl(arna_id,lp_prd,
'RVEC = ',rvarp)
322 call mntr_log(arna_id,lp_prd,
'HOWMNY = '//trim(howarp))
328 ltim = dnekclock() - ltim
379 call col3(workda(ipntarp(2)),vxp,v1mask,tstpr_nv)
380 call col3(workda(ipntarp(2)+tstpr_nv),vyp,v2mask,tstpr_nv)
381 if(if3d)
call col3(workda(ipntarp(2)+2*tstpr_nv),vzp,
387 call copy(workda(ipntarp(2)),vxp,tstpr_nv)
388 call copy(workda(ipntarp(2)+tstpr_nv),vyp,tstpr_nv)
389 if (if3d)
call copy(workda(ipntarp(2)+2*tstpr_nv),vzp,tstpr_nv)
391 if(ifheat)
call copy(workda(ipntarp(2)+ndim*tstpr_nv),tp,tstpr_nt)
401 if (idoarp.eq.-2)
then
404 elseif (idoarp.eq.99)
then
407 elseif (idoarp.eq.-1.or.idoarp.eq.1)
then
412 $
'stepper_vsolve; error with arna_naupd, ido = '//trim(str))
416 ltim = dnekclock() - ltim
436 integer il, iunit, ierror
438 logical lifxyo, lifpo, lifvo, lifto, lifpso(LDIMT1)
442 integer NIDD,NPP,NEKCOMM,NEKGROUP,NEKREAL
443 common /nekmpi/ nidd,npp,nekcomm,nekgroup,nekreal
445 if (idoarp.eq.99)
then
448 $
'Postprocessing converged eigenvectors NV= ',iparp(5))
451 call pdneupd(nekcomm,rvarp,howarp,selarp,driarp,driarp(1,2),
452 $ vbasea,arna_ls,sigarp(1),sigarp(2),workea,bmatarp,arna_ns,
453 $ whicharp,arna_negv,tstpr_tol,resida,arna_nkrl,vbasea,
454 $ arna_ls,iparp,ipntarp,workda,workla,nwlarp,ierrarp)
456 call dneupd(rvarp,howarp,selarp,driarp,driarp(1,2),
457 $ vbasea,arna_ls,sigarp(1),sigarp(2),workea,bmatarp,arna_ns,
458 $ whicharp,arna_negv,tstpr_tol,resida,arna_nkrl,vbasea,
459 $ arna_ls,iparp,ipntarp,workda,workla,nwlarp,ierrarp)
462 if (ierrarp.eq.0)
then
464 $
'Writing eigenvalues and eigenvectors')
470 if (ierror.eq.0)
then
471 open (unit=iunit,
file=
'eigenvalues.txt',
472 $ action=
'write', iostat=ierror)
473 write(unit=iunit,fmt=410,iostat=ierror)
474 410
FORMAT(10x,
'I',17x,
're(RITZ)',17x,
'im(RITZ)',17x,
475 $
'ln|RITZ|',16x,
'arg(RITZ)')
480 $
'Error opening eigenvalue file.')
500 lifpso(il)= ifpso(il)
517 call copy(vxp,vbasea(1,il),tstpr_nv)
518 call copy(vyp,vbasea(1+tstpr_nv,il),tstpr_nv)
519 if (if3d)
call copy(vzp,vbasea(1+2*tstpr_nv,il),tstpr_nv)
521 call copy(tp,vbasea(1+ndim*tstpr_nv,il),tstpr_nt)
522 call outpost2(vxp,vyp,vzp,prp,tp,1,
'egv')
524 call outpost2(vxp,vyp,vzp,prp,tp,0,
'egv')
529 driarp(il,3) = log(sqrt(driarp(il,1)**2+
530 $ driarp(il,2)**2))*dumm
531 driarp(il,4) = atan2(driarp(il,2),driarp(il,1))*dumm
533 if (nid.eq.0)
write(unit=iunit,fmt=*,iostat=ierror)
534 $ il,driarp(il,1),driarp(il,2),driarp(il,3),driarp(il,4)
538 $
'Error writing eigenvalue file.')
546 ifpso(il) = lifpso(il)
550 if (nid.eq.0)
close(unit=iunit)
555 $
'arna_esolve; error with _neupd, info = '//trim(str))
582 integer NIDD,NPP,NEKCOMM,NEKGROUP,NEKREAL
583 common /nekmpi/ nidd,npp,nekcomm,nekgroup,nekreal
586 call pdnaupd(nekcomm,idoarp,bmatarp,arna_ns,whicharp,arna_negv,
587 $ tstpr_tol,resida,arna_nkrl,vbasea,arna_ls,iparp,ipntarp,workda,
588 $ workla,nwlarp,infarp,nparp,rnmarp,ncarp)
590 call dnaupd(idoarp,bmatarp,arna_ns,whicharp,arna_negv,
591 $ tstpr_tol,resida,arna_nkrl,vbasea,arna_ls,iparp,ipntarp,workda,
592 $ workla,nwlarp,infarp)
596 if (infarp.lt.0)
then
599 $
'arna_naupd; error with _naupd, info = '//trim(str))
602 if (idoarp.eq.2)
then
607 call col3(workda(ipntarp(2)),bm1,v1mask,tstpr_nv)
608 call col3(workda(ipntarp(2)+tstpr_nv),bm1,v2mask,tstpr_nv)
609 if (if3d)
call col3(workda(ipntarp(2)+2*tstpr_nv),
610 $ bm1,v3mask,tstpr_nv)
614 call col3(workda(ipntarp(2)+ndim*tstpr_nv),
615 $ bm1,tmask,tstpr_nt)
619 $ workda(ipntarp(2)+tstpr_nv),
620 $ workda(ipntarp(2)+2*tstpr_nv),
621 $ workda(ipntarp(2)+ndim*tstpr_nv),1.0)
624 call col2(workda(ipntarp(2)),workda(ipntarp(1)),arna_ns)
627 call pdnaupd(nekcomm,idoarp,bmatarp,arna_ns,whicharp,
628 $ arna_negv,tstpr_tol,resida,arna_nkrl,vbasea,arna_ls,
629 $ iparp,ipntarp,workda,workla,nwlarp,infarp,nparp,rnmarp,
632 call dnaupd(idoarp,bmatarp,arna_ns,whicharp,arna_negv,
633 $ tstpr_tol,resida,arna_nkrl,vbasea,arna_ls,iparp,ipntarp,
634 $ workda,workla,nwlarp,infarp)
638 if (infarp.lt.0)
then
641 $
'arna_naupd; inner prod. error with _naupd, info = '//trim(str))
643 if (idoarp.ne.2)
exit
648 if (idoarp.eq.-1.or.idoarp.eq.1)
then
649 call mntr_log(arna_id,lp_prd,
'Restarting stepper')
653 call copy(vxp,workda(ipntarp(1)),tstpr_nv)
654 call copy(vyp,workda(ipntarp(1)+tstpr_nv),tstpr_nv)
655 if (if3d)
call copy(vzp,workda(ipntarp(1)+2*tstpr_nv),tstpr_nv)
657 if(ifheat)
call copy(tp,workda(ipntarp(1)+ndim*tstpr_nv),
subroutine stepper_register()
Register Arnoldi ARPACK module.
subroutine stepper_vsolve
Create Krylov space, get Ritz values and restart stepper phase.
subroutine arna_esolve
ARPACK postprocessing.
logical function stepper_is_initialised()
Check if module was initialised.
subroutine stepper_init()
Initilise Arnoldi ARPACK module.
subroutine arna_naupd
Interface to pdnaupd.
subroutine arna_rst_read
Read from checkpoints.
subroutine arna_rst_save
Write restart files.
subroutine cnht_weight_fun(lvx, lvy, lvz, lt, coeff)
Weigth velocity and temperature fields.
subroutine mntr_logi(mid, priority, logs, ivar)
Write log message adding single integer.
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_logl(mid, priority, logs, lvar)
Write log message adding single logical.
subroutine mntr_tmr_reg(mid, pmid, modid, mname, mdscr, ifsum)
Register new timer.
subroutine mntr_check_abort(mid, ierr, logs)
Abort simulation.
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 col3(a, b, c, n)
subroutine outpost2(v1, v2, v3, vp, vt, nfldt, name3)