KTH framework for Nek5000 toolboxes; testing version  0.0.1
tsrs.f
Go to the documentation of this file.
1 
8 !=======================================================================
12  subroutine tsrs_register()
13  implicit none
14 
15  include 'SIZE'
16  include 'INPUT'
17  include 'FRAMELP'
18  include 'TSRSD'
19 
20  ! local variables
21  integer lpmid, il
22  real ltim
23  character*2 str
24 
25  ! functions
26  real dnekclock
27 !-----------------------------------------------------------------------
28  ! timing
29  ltim = dnekclock()
30 
31  ! check if the current module was already registered
32  call mntr_mod_is_name_reg(lpmid,tsrs_name)
33  if (lpmid.gt.0) then
34  call mntr_warn(lpmid,
35  $ 'module ['//trim(tsrs_name)//'] already registered')
36  return
37  endif
38 
39  ! find parent module
40  call mntr_mod_is_name_reg(lpmid,'FRAME')
41  if (lpmid.le.0) then
42  lpmid = 1
43  call mntr_abort(lpmid,
44  $ 'parent module ['//'FRAME'//'] not registered')
45  endif
46 
47  ! register module
48  call mntr_mod_reg(tsrs_id,lpmid,tsrs_name,
49  $ 'point time series')
50 
51  ! register timers
52  call mntr_tmr_is_name_reg(lpmid,'FRM_TOT')
53  ! total time
54  call mntr_tmr_reg(tsrs_tmr_tot_id,lpmid,tsrs_id,
55  $ 'TSRS_TOT','Time series total time',.false.)
56  lpmid = tsrs_tmr_tot_id
57  ! initialisation
58  call mntr_tmr_reg(tsrs_tmr_ini_id,lpmid,tsrs_id,
59  $ 'TSRS_INI','Time seires initialisation time',.true.)
60  call mntr_tmr_reg(tsrs_tmr_cvp_id,lpmid,tsrs_id,
61  $ 'TSRS_CVP','Vorticity and pressure calc. time',.true.)
62  ! interpolation
63  call mntr_tmr_reg(tsrs_tmr_int_id,lpmid,tsrs_id,
64  $ 'TSRS_INT','Time series interpolation time',.true.)
65  ! buffering
66  call mntr_tmr_reg(tsrs_tmr_bfr_id,lpmid,tsrs_id,
67  $ 'TSRS_BFR','Time series buffering time',.true.)
68  ! I/O
69  call mntr_tmr_reg(tsrs_tmr_io_id,lpmid,tsrs_id,
70  $ 'TSRS_IO','Time series I/O time',.true.)
71 
72  ! register and set active section
73  call rprm_sec_reg(tsrs_sec_id,tsrs_id,'_'//adjustl(tsrs_name),
74  $ 'Runtime paramere section for time series module')
75  call rprm_sec_set_act(.true.,tsrs_sec_id)
76 
77  ! register parameters
78  call rprm_rp_reg(tsrs_tstart_id,tsrs_sec_id,'TSTART',
79  $ 'Sampling starting time',rpar_real,0,1.0,.false.,' ')
80  call rprm_rp_reg(tsrs_tint_id,tsrs_sec_id,'TINT',
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.,' ')
84 
85  ! set initialisation flag
86  tsrs_ifinit=.false.
87 
88  ! timing
89  ltim = dnekclock() - ltim
90  call mntr_tmr_add(tsrs_tmr_tot_id,1,ltim)
91 
92  return
93  end subroutine
94 !=======================================================================
98  subroutine tsrs_init()
99  implicit none
100 
101  include 'SIZE'
102  include 'GEOM'
103  include 'TSTEP'
104  include 'FRAMELP'
105  include 'TSRSD'
106 
107  ! global memory access
108  integer nidd,npp,nekcomm,nekgroup,nekreal
109  common /nekmpi/ nidd,npp,nekcomm,nekgroup,nekreal
110 
111  ! local variables
112  integer itmp
113  real rtmp
114  logical ltmp
115  character*20 ctmp
116  integer ntot
117  integer npt_max, nxf, nyf, nzf
118  real ltim
119  real tol, bb_t ! interpolation tolerance and relative size to expand bounding boxes by
120  parameter(tol = 5.0e-13, bb_t = 0.01)
121 
122  ! functions
123  real dnekclock
124 !-----------------------------------------------------------------------
125  call mntr_log(tsrs_id,lp_inf,'Initialisation started')
126 
127  ! check if the module was already initialised
128  if (tsrs_ifinit) then
129  call mntr_warn(tsrs_id,
130  $ 'module ['//trim(tsrs_name)//'] already initialised.')
131  return
132  endif
133 
134  ! timing
135  ltim = dnekclock()
136 
137  ! get runtime parameters
138  call rprm_rp_get(itmp,rtmp,ltmp,ctmp,tsrs_tstart_id,rpar_real)
139  tsrs_tstart = rtmp
140 
141  call rprm_rp_get(itmp,rtmp,ltmp,ctmp,tsrs_tint_id,rpar_real)
142  tsrs_tint = rtmp
143 
144  call rprm_rp_get(itmp,rtmp,ltmp,ctmp,tsrs_skstep_id,rpar_int)
145  tsrs_skstep = itmp
146 
147  ! initialise time of the next sampling
148  if (time.gt.tsrs_tstart) then
149  itmp = floor((time - tsrs_tstart)/tsrs_tint)
150  tsrs_stime = tsrs_tstart + (itmp+1)*tsrs_tint
151  else
152  tsrs_stime = tsrs_tstart
153  end if
154  call mntr_log(tsrs_id,lp_inf,'Sampling time initialised')
155 
156  ! initialise findpts
157  ntot = lx1*ly1*lz1*lelt
158  npt_max = 256
159  nxf = 2*lx1 ! fine mesh for bb-test
160  nyf = 2*ly1
161  nzf = 2*lz1
162 
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,
165  $ npt_max,tol)
166  call mntr_log(tsrs_id,lp_inf,'Interpolation tool started')
167 
168  ! read and redistribute points among processors
170  call mntr_log(tsrs_id,lp_inf,'Points redistributed')
171 
172  ! clean the buffer
173  tsrs_ntsnap = 0
174  ntot = tsrs_nfld*lhis*tsrs_ltsnap
175  call rzero(tsrs_buff,ntot)
176  call rzero(tsrs_tmlist,tsrs_ltsnap)
177 
178  ! everything is initialised
179  tsrs_ifinit=.true.
180 
181  call mntr_log(tsrs_id,lp_inf,'Initialisation finalised')
182 
183  ! timing
184  ltim = dnekclock() - ltim
185  call mntr_tmr_add(tsrs_tmr_ini_id,1,ltim)
186 
187  return
188  end subroutine
189 !=======================================================================
193  subroutine tsrs_end()
194  implicit none
195 
196  include 'SIZE'
197  include 'TSRSD'
198 
199  ! local variables
200  logical ifapp, ifsave
201 !-----------------------------------------------------------------------
202  ! make sure all data in the buffer is saved
203  ifapp = .false.
204  ifsave = .true.
205  call tsrs_buffer_save(ifapp, ifsave)
206 
207  return
208  end subroutine
209 !=======================================================================
213  logical function tsrs_is_initialised()
214  implicit none
215 
216  include 'SIZE'
217  include 'TSRSD'
218 !-----------------------------------------------------------------------
219  tsrs_is_initialised = tsrs_ifinit
220 
221  return
222  end function
223 !=======================================================================
230  subroutine tsrs_main(ifsave)
231  implicit none
232 
233  include 'SIZE'
234  include 'TSTEP'
235  include 'SOLN'
236  include 'FRAMELP'
237  include 'TSRSD'
238 
239  ! argument list
240  logical ifsave
241 
242  ! local variables
243  integer ntot, itmp
244  real alp, bet
245  logical ifapp
246 
247  ! simple timing
248  real ltim
249 
250  ! functions
251  real dnekclock
252 !-----------------------------------------------------------------------
253  ! skip initial steps
254  if (istep.gt.tsrs_skstep) then
255  ! sample fields
256  if (time.ge.tsrs_stime) then
257  call mntr_log(tsrs_id,lp_prd,'Sampling data')
258  ! current sample for linear interpolation
259  call tsrs_get()
260  ! save it
261  ntot = tsrs_nfld*tsrs_npts
262  call copy(tsrs_sfld,tsrs_fld,ntot)
263  ! previous sample for linear interpolation
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),
268  $ vx,vy,vz)
269  call opcopy(vx,vy,vz,vxlag,vylag,vzlag)
270  call tsrs_get()
271  ! restore data
272  call copy(pr,tsrs_pr,ntot)
273  call opcopy(vx,vy,vz,tsrs_vel(1,1),tsrs_vel(1,2),
274  $ tsrs_vel(1,ldim))
275  ! linear interpolation
276  alp = (time-tsrs_stime)/dt
277  bet = 1.0 - alp
278  ntot = tsrs_nfld*tsrs_npts
279  call add2sxy(tsrs_fld,alp,tsrs_sfld,bet,ntot)
280  ! append the buffer
281  ifapp = .true.
282  call tsrs_buffer_save(ifapp, ifsave)
283  ! update sampling time
284  tsrs_stime = tsrs_stime + tsrs_tint
285  else
286  ! is I/O required
287  if (ifsave) then
288  ifapp = .false.
289  call tsrs_buffer_save(ifapp, ifsave)
290  end if
291  end if
292  else if (istep.eq.tsrs_skstep) then
293  ! correct sampling time; necessary because speciffic way of nek restart
294  if (time.ge.tsrs_stime) tsrs_stime = tsrs_stime + tsrs_tint
295  else ! in case the restart field was not loaded yet; requires tsrs_skstep>0
296  if (time.ge.tsrs_tstart) then
297  itmp = floor((time - tsrs_tstart)/tsrs_tint)
298  tsrs_stime = tsrs_tstart + (itmp+1)*tsrs_tint
299  end if
300  end if
301 
302  return
303  end subroutine
304 !=======================================================================
310  subroutine tsrs_get()
311  implicit none
312 
313  include 'SIZE'
314  include 'SOLN'
315  include 'TSRSD'
316 
317  ! global variables
318  ! work arrays
319  real slvel(LX1,LY1,LZ1,LELT,3)
320  common /scrmg/ slvel
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) ! du/dx, du/dy and du/dz
324  real dvdx(LX1,LY1,LZ1,LELT,3) ! dv/dx, dv/dy and dv/dz
325  real dwdx(LX1,LY1,LZ1,LELT,3) ! dw/dx, dw/dy and dw/dz
326  common /scrns/ dudx, dvdx
327  common /scrsf/ dwdx
328 
329  ! local variables
330  real ltim
331 
332  ! functions
333  real dnekclock
334 !-----------------------------------------------------------------------
335  ltim = dnekclock()
336  ! Map pressure to velocity mesh
337  call mappr(tmppr,pr,tmpvel(1,1,1,1,2),tmpvel(1,1,1,1,3))
338 
339  ! Compute derivative tensor and normalise pressure
340  call user_stat_trnsv(tmpvel,dudx,dvdx,dwdx,slvel,tmppr)
341  ltim = dnekclock() - ltim
342  call mntr_tmr_add(tsrs_tmr_cvp_id,1,ltim)
343 
344  ltim = dnekclock()
345  ! interpolate variables
346  call tsrs_interpolate(tmpvel,slvel,tmppr)
347  ltim = dnekclock() - ltim
348  call mntr_tmr_add(tsrs_tmr_int_id,1,ltim)
349 
350  return
351  end subroutine
352 !=======================================================================
357  implicit none
358 
359  include 'SIZE'
360  include 'TSRSD'
361 !#define DEBUG
362 #ifdef DEBUG
363  include 'INPUT'
364  include 'GEOM'
365 #endif
366 
367  ! local variables
368  integer il
369  integer nfail, npass
370  real toldist
371  parameter(toldist = 5e-6)
372  integer nptimb ! assumed point imbalance
373 
374  ! functions
375  integer iglsum
376 
377 #ifdef DEBUG
378  character*3 str1, str2
379  integer iunit, ierr, jl
380  ! call number
381  integer icalld
382  save icalld
383  data icalld /0/
384  real coord_int(ldim,lhis)
385  integer rcode(lhis),proc(lhis),elid(lhis)
386  real dist(lhis),rst(ldim*lhis)
387  ! timng variables
388  real ltime1, ltime2
389  ! functions
390  real dnekclock
391 #endif
392 !-----------------------------------------------------------------------
393  ! read in point position
394  call tsrs_mfi_points()
395 
396  ! identify points
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)
401 
402  ! find problems with interpolation
403  nfail = 0
404  do il = 1,tsrs_npts
405  ! check return code
406  if (tsrs_rcode(il).eq.1) then
407  if (sqrt(tsrs_dist(il)).gt.toldist) then
408  nfail = nfail + 1
409  !write(*,*) 'TSTR int', nid, tsrs_pts(:,il),tsrs_rcode(il)
410  end if
411  elseif(tsrs_rcode(il).eq.2) then
412  nfail = nfail + 1
413  !write(*,*) 'TSTR int', nid, tsrs_pts(:,il),tsrs_rcode(il)
414  endif
415  enddo
416  nfail = iglsum(nfail,1)
417 
418 #ifdef DEBUG
419  ! for testing
420  ! to output findpts data
421  icalld = icalld+1
422 
423  call io_file_freeid(iunit, ierr)
424  write(str1,'(i3.3)') nid
425  write(str2,'(i3.3)') icalld
426  open(unit=iunit,file='TSRSrpos.txt'//str1//'i'//str2)
427 
428  write(iunit,*) tsrs_nptot, tsrs_npts
429  do il=1, tsrs_npts
430  write(iunit,*) il, tsrs_ipts(il), (tsrs_pts(jl,il),jl=1,ldim)
431  enddo
432 
433  close(iunit)
434 
435  call io_file_freeid(iunit, ierr)
436  write(str1,'(i3.3)') nid
437  write(str2,'(i3.3)') icalld
438  open(unit=iunit,file='TSRSfpts.txt'//str1//'i'//str2)
439 
440  write(iunit,*) tsrs_nptot, tsrs_npts, nfail
441  do il=1,tsrs_npts
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)
445  enddo
446 
447  close(iunit)
448 
449  ! timing
450  call nekgsync()
451  ltime1 = dnekclock()
452  ! interpolate coordinates to see interpolation quality
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)
462  call nekgsync()
463  ltime1 = dnekclock() - ltime1
464 
465  ! to output refinement
466  call io_file_freeid(iunit, ierr)
467  write(str1,'(i3.3)') nid
468  write(str2,'(i3.3)') icalld
469  open(unit=iunit,file='TSRSintp.txt'//str1//'i'//str2)
470 
471  write(iunit,*) tsrs_nptot, tsrs_npts
472  do il=1, tsrs_npts
473  write(iunit,*) il, tsrs_ipts(il),
474  $ (tsrs_pts(jl,il)-coord_int(jl,il),jl=1,ldim)
475  enddo
476 
477  close(iunit)
478 #endif
479 
480  ! redistribute points to minimise communication
481  nptimb = 0
482  call pts_rdst(nptimb)
483 
484 #ifdef DEBUG
485  ! to check interpolation parametes correctess after transfer
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)
491 #endif
492 
493  ! Interesting; Even though all interpolation data seems to be fine I have to reinitialise it here
494  ! It looks like gslib has some internal data that has to be wahsed up; Must be new stuff not present in older gslib versions
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)
499 
500 #ifdef DEBUG
501  ! for testing
502  ! to output findpts data after redistribution
503  icalld = icalld+1
504 
505  call io_file_freeid(iunit, ierr)
506  write(str1,'(i3.3)') nid
507  write(str2,'(i3.3)') icalld
508  open(unit=iunit,file='TSRSrpos.txt'//str1//'i'//str2)
509 
510  write(iunit,*) tsrs_nptot, tsrs_npts
511  do il=1, tsrs_npts
512  write(iunit,*) il, tsrs_ipts(il), (tsrs_pts(jl,il),jl=1,ldim)
513  enddo
514 
515  close(iunit)
516 
517  call io_file_freeid(iunit, ierr)
518  write(str1,'(i3.3)') nid
519  write(str2,'(i3.3)') icalld
520  open(unit=iunit,file='TSRSfpts.txt'//str1//'i'//str2)
521 
522  write(iunit,*) tsrs_nptot, tsrs_npts, nfail
523  do il=1,tsrs_npts
524  write(iunit,*) il, tsrs_ipts(il), tsrs_proc(il), tsrs_elid(il), ! new interpolation parameters
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), ! old interpolation parameters transferred by pts_rdst
528  $ rcode(il), dist(il), ! notice dist can be different as it is not transferred (not needed findpts_eval)
529  $ (rst(jl+(il-1)*ldim),jl=1,ldim)
530  enddo
531 
532  close(iunit)
533 
534  ! timing
535  call nekgsync()
536  ltime2 = dnekclock()
537  ! interpolate coordinates to see interpolation quality
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)
547  call nekgsync()
548  ltime2 = dnekclock() - ltime2
549 
550  ! to output refinement
551  call io_file_freeid(iunit, ierr)
552  write(str1,'(i3.3)') nid
553  write(str2,'(i3.3)') icalld
554  open(unit=iunit,file='TSRSintp.txt'//str1//'i'//str2)
555 
556  write(iunit,*) tsrs_nptot, tsrs_npts,ltime1,ltime2
557  do il=1, tsrs_npts
558  write(iunit,*) il, tsrs_ipts(il),
559  $ (tsrs_pts(jl,il)-coord_int(jl,il),jl=1,ldim)
560  enddo
561 
562  close(iunit)
563 #endif
564 #undef DEBUG
565 
566  if (nfail.gt.0) call mntr_abort(tsrs_id,
567  $ 'tsrs_read_redistribute: Points not mapped')
568 
569  return
570  end subroutine
571 !=======================================================================
577  subroutine tsrs_interpolate(vlct,vort,pres)
578  implicit none
579 
580  include 'SIZE'
581  include 'TSRSD'
582 
583  ! argument list
584  real vlct(lx1*ly1*lz1*lelt,ldim)
585  real vort(lx1*ly1*lz1*lelt,ldim)
586  real pres(lx1*ly1*lz1*lelt)
587 
588  ! local variables
589  integer ifld, il
590 !-----------------------------------------------------------------------
591  ifld = 0
592  ! velocity
593  do il = 1, ldim
594  ifld = ifld + 1
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))
598  enddo
599 
600  ! pressure
601  ifld = ifld + 1
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)
605 
606  ! vorticity
607  do il = 1, ldim
608  ifld = ifld + 1
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))
612  enddo
613 
614  return
615  end subroutine
616 !=======================================================================
622  subroutine tsrs_buffer_save(ifapp, ifsave)
623  implicit none
624 
625  include 'SIZE'
626  include 'TSRSD'
627 
628  ! global memory space
629  ! dummy arrays
630  integer lbff, nbff
631  parameter(lbff=tsrs_nfld*lhis*tsrs_ltsnap)
632  real bff(lbff)
633  common /scrch/ bff
634 
635  ! argument list
636  logical ifapp, ifsave
637 
638  ! local variables
639  integer ntot, il, jl
640  real ltim
641 
642  ! functions
643  real dnekclock
644 !-----------------------------------------------------------------------
645  ! append buffer
646  if (ifapp) then
647  ltim = dnekclock()
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
653  call mntr_tmr_add(tsrs_tmr_bfr_id,1,ltim)
654  endif
655 
656  ! save data and clean buffer
657  if(ifsave.or.(tsrs_ntsnap.eq.tsrs_ltsnap)) then
658  if (tsrs_ntsnap.gt.0) then
659  ltim = dnekclock()
660 
661  ! reshuffle storage to simplify I/O
662  nbff = 0
663  do il = 1, tsrs_npts
664  do jl = 1, tsrs_ntsnap
665  call copy(bff(nbff+1),tsrs_buff(1,il,jl),tsrs_nfld)
666  nbff = nbff + tsrs_nfld
667  enddo
668  enddo
669  call tsrs_mfo_outfld(bff,nbff)
670 
671  ! clean the buffer
672  tsrs_ntsnap = 0
673  ntot = tsrs_nfld*lhis*tsrs_ltsnap
674  call rzero(tsrs_buff,ntot)
675  call rzero(tsrs_tmlist,tsrs_ltsnap)
676 
677  ltim = dnekclock() - ltim
678  call mntr_tmr_add(tsrs_tmr_io_id,1,ltim)
679  endif
680  endif
681 
682  return
683  end subroutine
684 !=======================================================================
685 
686 
687 
688 
689 
690 
691 
subroutine nekgsync()
Definition: comm_mpi.f:502
subroutine io_file_freeid(iunit, ierr)
Get free file unit number and store max unit value.
Definition: io_tools.f:47
subroutine mntr_tmr_is_name_reg(mid, mname)
Check if timer name is registered and return its id.
Definition: mntrtmr.f:146
subroutine mntr_warn(mid, logs)
Write warning message.
Definition: mntrlog.f:803
subroutine mntr_tmr_add(mid, icount, time)
Check if timer id is registered. This operation is performed locally.
Definition: mntrtmr.f:237
subroutine mntr_mod_is_name_reg(mid, mname)
Check if module name is registered and return its id.
Definition: mntrlog.f:459
subroutine mntr_abort(mid, logs)
Abort simulation.
Definition: mntrlog.f:837
subroutine mntr_log(mid, priority, logs)
Write log message.
Definition: mntrlog.f:600
subroutine mntr_mod_reg(mid, pmid, mname, mdscr)
Register new module.
Definition: mntrlog.f:346
subroutine mntr_tmr_reg(mid, pmid, modid, mname, mdscr, ifsum)
Register new timer.
Definition: mntrtmr.f:16
subroutine rprm_rp_get(ipval, rpval, lpval, cpval, rpid, ptype)
Get runtime parameter form active section. This operation is performed locally.
Definition: rprm.f:883
subroutine rprm_rp_reg(rpid, mid, pname, pdscr, ptype, ipval, rpval, lpval, cpval)
Register new runtime parameter.
Definition: rprm.f:484
subroutine rprm_sec_set_act(ifact, rpid)
Set section's activation flag. Master value is broadcasted.
Definition: rprm.f:422
subroutine rprm_sec_reg(rpid, mid, pname, pdscr)
Register new parameter section.
Definition: rprm.f:165
subroutine tsrs_mfi_points()
Read interpolation points positions, number and redistribute them.
Definition: tsrs_IO.f:378
subroutine tsrs_register()
Register point time seriesmodule for statistics tool.
Definition: tsrs.f:13
subroutine tsrs_init()
Initilise time series module.
Definition: tsrs.f:99
logical function tsrs_is_initialised()
Check if module was initialised.
Definition: tsrs.f:214
subroutine tsrs_mfo_outfld(bff, lbff)
Write a point history file.
Definition: tsrs_IO.f:15
subroutine tsrs_main(ifsave)
Main interface of time series module.
Definition: tsrs.f:231
subroutine tsrs_read_redistribute()
Read and redistribute points among mpi ranks.
Definition: tsrs.f:357
subroutine tsrs_end()
Finalise time series module.
Definition: tsrs.f:194
subroutine tsrs_get()
Perform interpolation and data buffering.
Definition: tsrs.f:311
subroutine tsrs_interpolate(vlct, vort, pres)
Interpolate fields on a set of points.
Definition: tsrs.f:578
subroutine tsrs_buffer_save(ifapp, ifsave)
Buffer and save interpolated fields.
Definition: tsrs.f:623
subroutine icopy(a, b, n)
Definition: math.f:289
subroutine copy(a, b, n)
Definition: math.f:260
subroutine add2sxy(x, a, y, b, n)
Definition: math.f:1574
subroutine rzero(a, n)
Definition: math.f:208
subroutine opcopy(a1, a2, a3, b1, b2, b3)
Definition: navier1.f:2474
subroutine mappr(pm1, pm2, pa, pb)
Definition: navier5.f:237
subroutine pts_rdst(nptimb)