35 $
'module ['//trim(tsrs_name)//
'] already registered')
44 $
'parent module ['//
'FRAME'//
'] not registered')
49 $
'point time series')
55 $
'TSRS_TOT',
'Time series total time',.false.)
56 lpmid = tsrs_tmr_tot_id
59 $
'TSRS_INI',
'Time seires initialisation time',.true.)
61 $
'TSRS_CVP',
'Vorticity and pressure calc. time',.true.)
64 $
'TSRS_INT',
'Time series interpolation time',.true.)
67 $
'TSRS_BFR',
'Time series buffering time',.true.)
70 $
'TSRS_IO',
'Time series I/O time',.true.)
73 call rprm_sec_reg(tsrs_sec_id,tsrs_id,
'_'//adjustl(tsrs_name),
74 $
'Runtime paramere section for time series module')
78 call rprm_rp_reg(tsrs_tstart_id,tsrs_sec_id,
'TSTART',
79 $
'Sampling starting time',rpar_real,0,1.0,.false.,
' ')
81 $
'Sampling time interval',rpar_real,0,0.05,.false.,
' ')
82 call rprm_rp_reg(tsrs_skstep_id,tsrs_sec_id,
'SKSTEP',
83 $
'Skipped initial steps',rpar_int,0,0.0,.false.,
' ')
89 ltim = dnekclock() - ltim
108 integer nidd,npp,nekcomm,nekgroup,nekreal
109 common /nekmpi/ nidd,npp,nekcomm,nekgroup,nekreal
117 integer npt_max, nxf, nyf, nzf
120 parameter(tol = 5.0e-13, bb_t = 0.01)
125 call mntr_log(tsrs_id,lp_inf,
'Initialisation started')
128 if (tsrs_ifinit)
then
130 $
'module ['//trim(tsrs_name)//
'] already initialised.')
138 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,tsrs_tstart_id,rpar_real)
141 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,tsrs_tint_id,rpar_real)
144 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,tsrs_skstep_id,rpar_int)
148 if (time.gt.tsrs_tstart)
then
149 itmp = floor((time - tsrs_tstart)/tsrs_tint)
150 tsrs_stime = tsrs_tstart + (itmp+1)*tsrs_tint
152 tsrs_stime = tsrs_tstart
154 call mntr_log(tsrs_id,lp_inf,
'Sampling time initialised')
157 ntot = lx1*ly1*lz1*lelt
163 call fgslib_findpts_setup(tsrs_handle,nekcomm,npp,ldim,
164 $ xm1,ym1,zm1,nx1,ny1,nz1,nelt,nxf,nyf,nzf,bb_t,ntot,ntot,
166 call mntr_log(tsrs_id,lp_inf,
'Interpolation tool started')
170 call mntr_log(tsrs_id,lp_inf,
'Points redistributed')
174 ntot = tsrs_nfld*lhis*tsrs_ltsnap
175 call rzero(tsrs_buff,ntot)
176 call rzero(tsrs_tmlist,tsrs_ltsnap)
181 call mntr_log(tsrs_id,lp_inf,
'Initialisation finalised')
184 ltim = dnekclock() - ltim
200 logical ifapp, ifsave
254 if (istep.gt.tsrs_skstep)
then
256 if (time.ge.tsrs_stime)
then
257 call mntr_log(tsrs_id,lp_prd,
'Sampling data')
261 ntot = tsrs_nfld*tsrs_npts
262 call copy(tsrs_sfld,tsrs_fld,ntot)
264 ntot = lx2*ly2*lz2*nelv
265 call copy(tsrs_pr,pr,ntot)
266 call copy(pr,prlag,ntot)
267 call opcopy(tsrs_vel(1,1),tsrs_vel(1,2),tsrs_vel(1,ldim),
269 call opcopy(vx,vy,vz,vxlag,vylag,vzlag)
272 call copy(pr,tsrs_pr,ntot)
273 call opcopy(vx,vy,vz,tsrs_vel(1,1),tsrs_vel(1,2),
276 alp = (time-tsrs_stime)/dt
278 ntot = tsrs_nfld*tsrs_npts
279 call add2sxy(tsrs_fld,alp,tsrs_sfld,bet,ntot)
284 tsrs_stime = tsrs_stime + tsrs_tint
292 else if (istep.eq.tsrs_skstep)
then
294 if (time.ge.tsrs_stime) tsrs_stime = tsrs_stime + tsrs_tint
296 if (time.ge.tsrs_tstart)
then
297 itmp = floor((time - tsrs_tstart)/tsrs_tint)
298 tsrs_stime = tsrs_tstart + (itmp+1)*tsrs_tint
319 real slvel(LX1,LY1,LZ1,LELT,3)
321 real tmpvel(LX1,LY1,LZ1,LELT,3), tmppr(LX1,LY1,LZ1,LELT)
322 common /scruz/ tmpvel, tmppr
323 real dudx(LX1,LY1,LZ1,LELT,3)
324 real dvdx(LX1,LY1,LZ1,LELT,3)
325 real dwdx(LX1,LY1,LZ1,LELT,3)
326 common /scrns/ dudx, dvdx
337 call mappr(tmppr,pr,tmpvel(1,1,1,1,2),tmpvel(1,1,1,1,3))
340 call user_stat_trnsv(tmpvel,dudx,dvdx,dwdx,slvel,tmppr)
341 ltim = dnekclock() - ltim
347 ltim = dnekclock() - ltim
371 parameter(toldist = 5e-6)
378 character*3 str1, str2
379 integer iunit, ierr, jl
384 real coord_int(ldim,lhis)
385 integer rcode(lhis),proc(lhis),elid(lhis)
386 real dist(lhis),rst(ldim*lhis)
397 call fgslib_findpts(tsrs_handle,tsrs_rcode,1,tsrs_proc,1,
398 $ tsrs_elid,1,tsrs_rst,ldim,tsrs_dist,1,
399 & tsrs_pts(1,1),ldim,tsrs_pts(2,1),ldim,
400 & tsrs_pts(ldim,1),ldim,tsrs_npts)
406 if (tsrs_rcode(il).eq.1)
then
407 if (sqrt(tsrs_dist(il)).gt.toldist)
then
411 elseif(tsrs_rcode(il).eq.2)
then
416 nfail = iglsum(nfail,1)
424 write(str1,
'(i3.3)') nid
425 write(str2,
'(i3.3)') icalld
426 open(unit=iunit,
file=
'TSRSrpos.txt'//str1//
'i'//str2)
428 write(iunit,*) tsrs_nptot, tsrs_npts
430 write(iunit,*) il, tsrs_ipts(il), (tsrs_pts(jl,il),jl=1,ldim)
436 write(str1,
'(i3.3)') nid
437 write(str2,
'(i3.3)') icalld
438 open(unit=iunit,
file=
'TSRSfpts.txt'//str1//
'i'//str2)
440 write(iunit,*) tsrs_nptot, tsrs_npts, nfail
442 write(iunit,*) il, tsrs_ipts(il), tsrs_proc(il), tsrs_elid(il),
443 $ tsrs_rcode(il), tsrs_dist(il),
444 $ (tsrs_rst(jl+(il-1)*ldim),jl=1,ldim)
453 call fgslib_findpts_eval(tsrs_handle,coord_int(1,1),
454 $ ldim,tsrs_rcode,1,tsrs_proc,1,tsrs_elid,1,
455 $ tsrs_rst,ldim,tsrs_npts,xm1)
456 call fgslib_findpts_eval(tsrs_handle,coord_int(2,1),
457 $ ldim,tsrs_rcode,1,tsrs_proc,1,tsrs_elid,1,
458 $ tsrs_rst,ldim,tsrs_npts,ym1)
459 if (if3d)
call fgslib_findpts_eval(tsrs_handle,coord_int(ldim,1),
460 $ ldim,tsrs_rcode,1,tsrs_proc,1,tsrs_elid,1,
461 $ tsrs_rst,ldim,tsrs_npts,zm1)
463 ltime1 = dnekclock() - ltime1
467 write(str1,
'(i3.3)') nid
468 write(str2,
'(i3.3)') icalld
469 open(unit=iunit,
file=
'TSRSintp.txt'//str1//
'i'//str2)
471 write(iunit,*) tsrs_nptot, tsrs_npts
473 write(iunit,*) il, tsrs_ipts(il),
474 $ (tsrs_pts(jl,il)-coord_int(jl,il),jl=1,ldim)
486 call icopy(rcode,tsrs_rcode,lhis)
487 call icopy(proc,tsrs_proc,lhis)
488 call icopy(elid,tsrs_elid,lhis)
489 call copy(dist,tsrs_dist,lhis)
490 call copy(rst,tsrs_rst,ldim*lhis)
495 call fgslib_findpts(tsrs_handle,tsrs_rcode,1,tsrs_proc,1,
496 $ tsrs_elid,1,tsrs_rst,ldim,tsrs_dist,1,
497 & tsrs_pts(1,1),ldim,tsrs_pts(2,1),ldim,
498 & tsrs_pts(ldim,1),ldim,tsrs_npts)
506 write(str1,
'(i3.3)') nid
507 write(str2,
'(i3.3)') icalld
508 open(unit=iunit,
file=
'TSRSrpos.txt'//str1//
'i'//str2)
510 write(iunit,*) tsrs_nptot, tsrs_npts
512 write(iunit,*) il, tsrs_ipts(il), (tsrs_pts(jl,il),jl=1,ldim)
518 write(str1,
'(i3.3)') nid
519 write(str2,
'(i3.3)') icalld
520 open(unit=iunit,
file=
'TSRSfpts.txt'//str1//
'i'//str2)
522 write(iunit,*) tsrs_nptot, tsrs_npts, nfail
524 write(iunit,*) il, tsrs_ipts(il), tsrs_proc(il), tsrs_elid(il),
525 $ tsrs_rcode(il), tsrs_dist(il),
526 $ (tsrs_rst(jl+(il-1)*ldim),jl=1,ldim)
527 write(iunit,*) il, tsrs_ipts(il), proc(il), elid(il),
528 $ rcode(il), dist(il),
529 $ (rst(jl+(il-1)*ldim),jl=1,ldim)
538 call fgslib_findpts_eval(tsrs_handle,coord_int(1,1),
539 $ ldim,tsrs_rcode,1,tsrs_proc,1,tsrs_elid,1,
540 $ tsrs_rst,ldim,tsrs_npts,xm1)
541 call fgslib_findpts_eval(tsrs_handle,coord_int(2,1),
542 $ ldim,tsrs_rcode,1,tsrs_proc,1,tsrs_elid,1,
543 $ tsrs_rst,ldim,tsrs_npts,ym1)
544 if (if3d)
call fgslib_findpts_eval(tsrs_handle,coord_int(ldim,1),
545 $ ldim,tsrs_rcode,1,tsrs_proc,1,tsrs_elid,1,
546 $ tsrs_rst,ldim,tsrs_npts,zm1)
548 ltime2 = dnekclock() - ltime2
552 write(str1,
'(i3.3)') nid
553 write(str2,
'(i3.3)') icalld
554 open(unit=iunit,
file=
'TSRSintp.txt'//str1//
'i'//str2)
556 write(iunit,*) tsrs_nptot, tsrs_npts,ltime1,ltime2
558 write(iunit,*) il, tsrs_ipts(il),
559 $ (tsrs_pts(jl,il)-coord_int(jl,il),jl=1,ldim)
567 $
'tsrs_read_redistribute: Points not mapped')
584 real vlct(lx1*ly1*lz1*lelt,ldim)
585 real vort(lx1*ly1*lz1*lelt,ldim)
586 real pres(lx1*ly1*lz1*lelt)
595 call fgslib_findpts_eval(tsrs_handle,tsrs_fld(ifld,1),
596 $ tsrs_nfld,tsrs_rcode,1,tsrs_proc,1,tsrs_elid,1,
597 $ tsrs_rst,ldim,tsrs_npts,vlct(1,il))
602 call fgslib_findpts_eval(tsrs_handle,tsrs_fld(ifld,1),
603 $ tsrs_nfld,tsrs_rcode,1,tsrs_proc,1,tsrs_elid,1,
604 $ tsrs_rst,ldim,tsrs_npts,pres)
609 call fgslib_findpts_eval(tsrs_handle,tsrs_fld(ifld,1),
610 $ tsrs_nfld,tsrs_rcode,1,tsrs_proc,1,tsrs_elid,1,
611 $ tsrs_rst,ldim,tsrs_npts,vort(1,il))
631 parameter(lbff=tsrs_nfld*lhis*tsrs_ltsnap)
636 logical ifapp, ifsave
648 tsrs_ntsnap = tsrs_ntsnap + 1
649 ntot = tsrs_nfld*tsrs_npts
650 call copy(tsrs_buff(1,1,tsrs_ntsnap),tsrs_fld,ntot)
651 tsrs_tmlist(tsrs_ntsnap) = tsrs_stime
652 ltim = dnekclock() - ltim
657 if(ifsave.or.(tsrs_ntsnap.eq.tsrs_ltsnap))
then
658 if (tsrs_ntsnap.gt.0)
then
664 do jl = 1, tsrs_ntsnap
665 call copy(bff(nbff+1),tsrs_buff(1,il,jl),tsrs_nfld)
666 nbff = nbff + tsrs_nfld
673 ntot = tsrs_nfld*lhis*tsrs_ltsnap
674 call rzero(tsrs_buff,ntot)
675 call rzero(tsrs_tmlist,tsrs_ltsnap)
677 ltim = dnekclock() - ltim
subroutine mntr_tmr_is_name_reg(mid, mname)
Check if timer name is registered and return its id.
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 rprm_rp_get(ipval, rpval, lpval, cpval, rpid, ptype)
Get runtime parameter form active section. This operation is performed locally.
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 tsrs_mfi_points()
Read interpolation points positions, number and redistribute them.
subroutine tsrs_register()
Register point time seriesmodule for statistics tool.
subroutine tsrs_init()
Initilise time series module.
logical function tsrs_is_initialised()
Check if module was initialised.
subroutine tsrs_mfo_outfld(bff, lbff)
Write a point history file.
subroutine tsrs_main(ifsave)
Main interface of time series module.
subroutine tsrs_read_redistribute()
Read and redistribute points among mpi ranks.
subroutine tsrs_end()
Finalise time series module.
subroutine tsrs_get()
Perform interpolation and data buffering.
subroutine tsrs_interpolate(vlct, vort, pres)
Interpolate fields on a set of points.
subroutine tsrs_buffer_save(ifapp, ifsave)
Buffer and save interpolated fields.
subroutine icopy(a, b, n)
subroutine add2sxy(x, a, y, b, n)
subroutine opcopy(a1, a2, a3, b1, b2, b3)
subroutine mappr(pm1, pm2, pa, pb)
subroutine pts_rdst(nptimb)