35 $
'module ['//trim(stat_name)//
'] already registered')
44 $
'parent module ['//
'FRAME'//
'] not registered')
49 $
'2D and 3D statistics')
52 if (stat_rdim.eq.1)
then
64 $
'STAT_TOT',
'Statistics total time',.false.)
65 lpmid = stat_tmr_tot_id
68 $
'STAT_INI',
'Statistics initialisation time',.true.)
71 $
'STAT_AVG',
'Statistics averaging time',.true.)
73 if (stat_rdim.eq.1)
then
76 $
'STAT_CMM',
'Statistics communication time',.true.)
80 $
'STAT_IO',
'Statistics IO time',.true.)
83 call rprm_sec_reg(stat_sec_id,stat_id,
'_'//adjustl(stat_name),
84 $
'Runtime paramere section for statistics module')
88 call rprm_rp_reg(stat_avstep_id,stat_sec_id,
'AVSTEP',
89 $
'Frequency of averaging',rpar_int,10,0.0,.false.,
' ')
91 call rprm_rp_reg(stat_skstep_id,stat_sec_id,
'SKSTEP',
92 $
'Skipped initial steps',rpar_int,10,0.0,.false.,
' ')
94 call rprm_rp_reg(stat_iostep_id,stat_sec_id,
'IOSTEP',
95 $
'Frequency of filed saving',rpar_int,100,0.0,.false.,
' ')
101 ltim = dnekclock() - ltim
128 call mntr_log(stat_id,lp_inf,
'Initialisation started')
131 if (stat_ifinit)
then
133 $
'module ['//trim(stat_name)//
'] already initiaised.')
138 if (stat_rdim.eq.1)
then
141 call mntr_log(stat_id,lp_inf,
'Map 2D finalised')
147 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,stat_avstep_id,rpar_int)
149 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,stat_skstep_id,rpar_int)
151 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,stat_iostep_id,rpar_int)
158 if (stat_rdim.eq.1)
then
161 call mntr_log(stat_id,lp_vrb,
'Getting loacal int. coeff.')
164 call mntr_log(stat_id,lp_inf,
'1D local finalised')
167 itmp = lx1**(ldim-stat_rdim)*lelt*stat_lvar
168 call rzero(stat_ruavg,itmp)
173 call mntr_log(stat_id,lp_inf,
'Initialisation finalised')
176 ltim = dnekclock() - ltim
199 if (stat_atime.gt.0.0)
then
200 if (stat_rdim.eq.1)
then
202 call mntr_log(stat_id,lp_inf,
'Global sum')
204 ltim = dnekclock() - ltim
209 call mntr_log(stat_id,lp_inf,
'Writing stat file')
211 ltim = dnekclock() - ltim
254 if (istep.gt.stat_skstep)
then
255 itmp = istep - stat_skstep
258 if (mod(itmp,stat_avstep).eq.0)
then
261 call mntr_log(stat_id,lp_inf,
'Average compute')
264 ltim = dnekclock() - ltim
269 if (mod(itmp,stat_iostep).eq.0)
then
270 if (stat_rdim.eq.1)
then
273 call mntr_log(stat_id,lp_inf,
'Global sum')
275 ltim = dnekclock() - ltim
280 call mntr_log(stat_id,lp_inf,
'Writing stat file')
282 ltim = dnekclock() - ltim
287 itmp = lx1**(ldim-stat_rdim)*lelt*stat_lvar
288 call rzero(stat_ruavg,itmp)
322 integer mid,mp,nekcomm,nekgroup,nekreal
323 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
325 real lxyzd(lx1,ly1,lz1,lelt,3)
329 integer il, jl, kl, el
335 integer*8 unodes(lx1*lz1*lelt)
338 $
'stat_init_int1D; IFAXIS not supported')
341 if (map2d_idir.eq.1)
then
342 call copy(lwm1,wxm1,nx1)
349 if(map2d_lmap(el).ne.-1)
then
350 call mxm(dxm1,nx1,xm1(1,1,1,el),nx1,lxyzd(1,1,1,el,1),il)
351 call mxm(dxm1,nx1,ym1(1,1,1,el),nx1,lxyzd(1,1,1,el,2),il)
352 if (if3d)
call mxm(dxm1,nx1,zm1(1,1,1,el),nx1,
353 $ lxyzd(1,1,1,el,3),il)
356 elseif (map2d_idir.eq.2)
then
357 call copy(lwm1,wym1,ny1)
363 if(map2d_lmap(el).ne.-1)
then
365 call mxm(xm1(1,1,il,el),nx1,dytm1,ny1,
366 $ lxyzd(1,1,il,el,1),ny1)
367 call mxm(ym1(1,1,il,el),nx1,dytm1,ny1,
368 $ lxyzd(1,1,il,el,2),ny1)
369 if (if3d)
call mxm(zm1(1,1,il,el),nx1,dytm1,ny1,
370 $ lxyzd(1,1,il,el,3),ny1)
376 call copy(lwm1,wzm1,nz1)
383 if(map2d_lmap(el).ne.-1)
then
384 call mxm(xm1(1,1,1,el),il,dztm1,nz1,
385 $ lxyzd(1,1,1,el,1),nz1)
386 call mxm(ym1(1,1,1,el),il,dztm1,nz1,
387 $ lxyzd(1,1,1,el,2),nz1)
388 call mxm(zm1(1,1,1,el),il,dztm1,nz1,
389 $ lxyzd(1,1,1,el,3),nz1)
393 call mntr_abort(stat_id,
'2D run cannot be z averaged.')
400 if(lx1.ne.stat_nm1.or.lx1.ne.stat_nm2.or.lx1.ne.stat_nm3)
then
402 $
'stat_init_int1D; unequal array sizes')
405 if(lx1.ne.stat_nm1.or.lx1.ne.stat_nm2.or.1.ne.stat_nm3)
then
407 $
'stat_init_int1D; unequal array sizes')
413 il = stat_nm1*stat_nm2*stat_nm3
416 if(map2d_lmap(el).ne.-1)
then
417 call vsq(lxyzd(1,1,1,el,1),il)
418 call vsq(lxyzd(1,1,1,el,2),il)
419 if (if3d)
call vsq(lxyzd(1,1,1,el,3),il)
421 call add2(lxyzd(1,1,1,el,1),lxyzd(1,1,1,el,2),il)
422 if (if3d)
call add2(lxyzd(1,1,1,el,1),lxyzd(1,1,1,el,3),il)
424 call vsqrt(lxyzd(1,1,1,el,1),il)
429 call rzero(stat_bm1d,il)
436 if(map2d_lmap(el).ne.-1)
then
440 stat_bm1d(il,jl,kl,el) =
441 $ lwm1(il)*stat_bm1d(il,jl,kl,el)
452 il = stat_nm2*stat_nm3*nelt
453 call rzero(stat_abm1d,il)
461 stat_abm1d(jl,kl,el2) = stat_abm1d(jl,kl,el2) +
462 $ stat_bm1d(il,jl,kl,el)
471 el = stat_nm2*stat_nm3
473 kl = map2d_gmap(il) - 1
475 unodes(el*(il-1) + jl) = int(el,8)*int(kl,8) + jl
479 call fgslib_gs_setup(gs_handle,unodes,kl,nekcomm,mp)
481 call fgslib_gs_op(gs_handle,stat_abm1d,1,1,0)
484 call fgslib_gs_free (gs_handle)
504 real rvar(lx1,ly1,lz1,lelt)
505 real var(lx1,ly1,lz1,lelt)
509 integer il, jl, kl, el
512 if (stat_rdim.eq.0)
then
513 el = lx1*ly1*lz1*lelt
514 call copy(rvar,var,el)
517 if (map2d_idir.eq.1)
then
519 if(map2d_lmap(el).ne.-1)
then
523 rvar(il,jl,kl,el) = var(il,jl,kl,el)
529 elseif (map2d_idir.eq.2)
then
531 if(map2d_lmap(el).ne.-1)
then
535 rvar(il,jl,kl,el) = var(jl,il,kl,el)
543 if(map2d_lmap(el).ne.-1)
then
547 rvar(il,jl,kl,el) = var(jl,kl,il,el)
573 real lvar(lx1,ly1,lz1,lelt)
578 real rtmp(lx1,lz1,lelt)
582 integer il, jl, kl, el
585 if(npos.gt.stat_lvar)
586 $
call mntr_abort(stat_id,
'inconsistent npos ')
588 if (stat_rdim.eq.1)
then
598 rtmp(jl,kl,el) = rtmp(jl,kl,el) +
599 $ stat_bm1d(il,jl,kl,el)*lvar(il,jl,kl,el)
606 el = stat_nm2*stat_nm3*nelv
607 call add2sxy(stat_ruavg(1,1,npos),alpha,rtmp,beta,el)
609 el = lx1**(ldim)*lelt
610 call add2sxy(stat_ruavg(1,1,npos),alpha,lvar,beta,el)
630 real lvar1(lx1,ly1,lz1,lelt), lvar2(lx1,ly1,lz1,lelt)
635 real rtmp(lx1,lz1,lelt)
636 real rtmp2(lx1,ly1,lz1,lelt)
637 common /ctmp0/ rtmp, rtmp2
640 integer il, jl, kl, el
643 if(npos.gt.stat_lvar)
644 $
call mntr_abort(stat_id,
'inconsistent npos ')
646 if (stat_rdim.eq.1)
then
656 rtmp(jl,kl,el) = rtmp(jl,kl,el) +
657 $ stat_bm1d(il,jl,kl,el)*
658 $ lvar1(il,jl,kl,el)*lvar2(il,jl,kl,el)
665 el = stat_nm2*stat_nm3*nelv
666 call add2sxy(stat_ruavg(1,1,npos),alpha,rtmp,beta,el)
668 el = lx1**(ldim)*lelt
669 call col3(rtmp2,lvar1,lvar2,el)
670 call add2sxy(stat_ruavg(1,1,npos),alpha,rtmp2,beta,el)
689 integer mid,mp,nekcomm,nekgroup,nekreal
690 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
694 integer*8 unodes(lx1*lz1*lelt)
698 real rtmp_ruavg(lx1*lz1,lelt)
701 if (stat_rdim.eq.0)
return
704 call mntr_log(stat_id,lp_vrb,
'Global statistics summation.')
709 call rzero(rtmp_ruavg,el)
713 do jl = 1,stat_nm2*stat_nm3
714 rtmp_ruavg(jl,el2) = rtmp_ruavg(jl,el2) +
715 $ stat_ruavg(jl,el,il)
720 el = stat_nm2*stat_nm3*map2d_lnum
721 call copy(stat_ruavg(1,1,il),rtmp_ruavg,el)
725 itmp1 = stat_nm2*stat_nm3
726 do il = 1, map2d_lnum
727 itmp2 = map2d_gmap(il) - 1
729 unodes(itmp1*(il-1) + jl) = int(itmp1,8)*int(itmp2,8) + jl
732 itmp2 = itmp1*map2d_lnum
733 call fgslib_gs_setup(gs_handle,unodes,itmp2,nekcomm,mp)
737 call fgslib_gs_op(gs_handle,stat_ruavg(1,1,il),1,1,0)
741 call fgslib_gs_free (gs_handle)
745 itmp1=stat_nm2*stat_nm3
747 if (map2d_own(il).eq.nid)
then
749 call invcol2(stat_ruavg(1,il,jl),
750 $ stat_abm1d(1,1,il),itmp1)
774 real slvel(LX1,LY1,LZ1,LELT,3), slp(LX1,LY1,LZ1,LELT)
775 common /scrmg/ slvel, slp
776 real tmpvel(LX1,LY1,LZ1,LELT,3), tmppr(LX1,LY1,LZ1,LELT)
777 common /scruz/ tmpvel, tmppr
778 real dudx(LX1,LY1,LZ1,LELT,3)
779 real dvdx(LX1,LY1,LZ1,LELT,3)
780 real dwdx(LX1,LY1,LZ1,LELT,3)
781 common /scrns/ dudx, dvdx
786 real alpha, beta,dtime
795 call mntr_log(stat_id,lp_vrb,
'Average fields.')
798 dtime=time-stat_atime-stat_tstart
801 stat_atime=time-stat_tstart
806 beta=dtime/stat_atime
810 call mappr(tmppr,pr,tmpvel(1,1,1,1,2),tmpvel(1,1,1,1,3))
813 call user_stat_trnsv(tmpvel,dudx,dvdx,dwdx,slvel,tmppr)
820 call stat_reshufflev(slvel(1,1,1,1,1),tmpvel(1,1,1,1,1),nelv)
821 call stat_reshufflev(slvel(1,1,1,1,2),tmpvel(1,1,1,1,2),nelv)
823 $ tmpvel(1,1,1,1,3),nelv)
830 call stat_reshufflev(tmpvel(1,1,1,1,1),dudx(1,1,1,1,1),nelv)
831 call stat_reshufflev(tmpvel(1,1,1,1,2),dudx(1,1,1,1,2),nelv)
833 $ dudx(1,1,1,1,3),nelv)
835 itmp = lx1*ly1*lz1*lelt*ldim
836 call copy(dudx,tmpvel,itmp)
839 call stat_reshufflev(tmpvel(1,1,1,1,1),dvdx(1,1,1,1,1),nelv)
840 call stat_reshufflev(tmpvel(1,1,1,1,2),dvdx(1,1,1,1,2),nelv)
842 $ dvdx(1,1,1,1,3),nelv)
844 itmp = lx1*ly1*lz1*lelt*ldim
845 call copy(dvdx,tmpvel,itmp)
849 call stat_reshufflev(tmpvel(1,1,1,1,1),dwdx(1,1,1,1,1),nelv)
850 call stat_reshufflev(tmpvel(1,1,1,1,2),dwdx(1,1,1,1,2),nelv)
851 call stat_reshufflev(tmpvel(1,1,1,1,3),dwdx(1,1,1,1,3),nelv)
853 itmp = lx1*ly1*lz1*lelt*ldim
854 call copy(dwdx,tmpvel,itmp)
884 call stat_compute_1dav2(slvel(1,1,1,1,1),slvel(1,1,1,1,1),
890 call stat_compute_1dav2(slvel(1,1,1,1,2),slvel(1,1,1,1,2),
896 call stat_compute_1dav2(slvel(1,1,1,1,3),slvel(1,1,1,1,3),
909 call stat_compute_1dav2(slvel(1,1,1,1,1),slvel(1,1,1,1,2),
915 call stat_compute_1dav2(slvel(1,1,1,1,2),slvel(1,1,1,1,3),
921 call stat_compute_1dav2(slvel(1,1,1,1,1),slvel(1,1,1,1,3),
1002 itmp = lx1*ly1*lz1*lelt*ldim
1003 call col3(tmpvel(1,1,1,1,1),slvel(1,1,1,1,1),slvel(1,1,1,1,1),
1009 call stat_compute_1dav2(slvel(1,1,1,1,1),tmpvel(1,1,1,1,1),
1015 call stat_compute_1dav2(slvel(1,1,1,1,2),tmpvel(1,1,1,1,2),
1021 call stat_compute_1dav2(slvel(1,1,1,1,3),tmpvel(1,1,1,1,3),
1028 call stat_compute_1dav2(tmpvel(1,1,1,1,1),slvel(1,1,1,1,2),
1034 call stat_compute_1dav2(tmpvel(1,1,1,1,1),slvel(1,1,1,1,3),
1040 call stat_compute_1dav2(tmpvel(1,1,1,1,2),slvel(1,1,1,1,1),
1046 call stat_compute_1dav2(tmpvel(1,1,1,1,2),slvel(1,1,1,1,3),
1053 call stat_compute_1dav2(tmpvel(1,1,1,1,3),slvel(1,1,1,1,1),
1059 call stat_compute_1dav2(tmpvel(1,1,1,1,3),slvel(1,1,1,1,2),
1066 itmp = lx1*ly1*lz1*lelt
1067 call col3(tmppr(1,1,1,1),slp(1,1,1,1),slp(1,1,1,1),
1084 itmp = lx1*ly1*lz1*lelt
1085 call col3(tmppr(1,1,1,1),slvel(1,1,1,1,1),slvel(1,1,1,1,2),
1094 call stat_compute_1dav2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,1),
1100 call stat_compute_1dav2(tmpvel(1,1,1,1,2),tmpvel(1,1,1,1,2),
1106 call stat_compute_1dav2(tmpvel(1,1,1,1,3),tmpvel(1,1,1,1,3),
1111 itmp = lx1*ly1*lz1*lelt*ldim
1112 call col3(tmpvel(1,1,1,1,1),dudx(1,1,1,1,1),dudx(1,1,1,1,1),
1114 itmp = lx1*ly1*lz1*lelt
1115 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,2),itmp)
1116 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,3),itmp)
1122 itmp = lx1*ly1*lz1*lelt*ldim
1123 call col3(tmpvel(1,1,1,1,1),dvdx(1,1,1,1,1),dvdx(1,1,1,1,1),
1125 itmp = lx1*ly1*lz1*lelt
1126 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,2),itmp)
1127 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,3),itmp)
1133 itmp = lx1*ly1*lz1*lelt*ldim
1134 call col3(tmpvel(1,1,1,1,1),dwdx(1,1,1,1,1),dwdx(1,1,1,1,1),
1136 itmp = lx1*ly1*lz1*lelt
1137 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,2),itmp)
1138 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,3),itmp)
1145 itmp = lx1*ly1*lz1*lelt*ldim
1146 call col3(tmpvel(1,1,1,1,1),dudx(1,1,1,1,1),dvdx(1,1,1,1,1),
1148 itmp = lx1*ly1*lz1*lelt
1149 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,2),itmp)
1150 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,3),itmp)
1156 itmp = lx1*ly1*lz1*lelt*ldim
1157 call col3(tmpvel(1,1,1,1,1),dudx(1,1,1,1,1),dwdx(1,1,1,1,1),
1159 itmp = lx1*ly1*lz1*lelt
1160 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,2),itmp)
1161 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,3),itmp)
1167 itmp = lx1*ly1*lz1*lelt*ldim
1168 call col3(tmpvel(1,1,1,1,1),dvdx(1,1,1,1,1),dwdx(1,1,1,1,1),
1170 itmp = lx1*ly1*lz1*lelt
1171 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,2),itmp)
1172 call add2(tmpvel(1,1,1,1,1),tmpvel(1,1,1,1,3),itmp)
subroutine map2d_register()
Register 2D mapping routines.
subroutine map2d_init()
Initilise map2d module.
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 stat_avg
Main interface of statistics module.
subroutine stat_gs_sum
Global statistics summation.
subroutine stat_init()
Initilise statistics module.
subroutine stat_register()
Register 2D and 3D statistics module.
logical function stat_is_initialised()
Check if module was initialised.
subroutine stat_compute_1dav2(lvar1, lvar2, npos, alpha, beta)
Perform local 1D integration on multiplication of 2 variables.
subroutine stat_mfo()
Main interface for saving statistics.
subroutine stat_compute()
Compute statistics.
subroutine stat_init_int1d()
Get local integration coefficients.
subroutine stat_reshufflev(rvar, var, nl)
Array reshuffle.
subroutine stat_end()
Finalise statistics module.
subroutine stat_compute_1dav1(lvar, npos, alpha, beta)
Perform local 1D integration on 1 variable.
subroutine col3(a, b, c, n)
subroutine invcol2(a, b, n)
subroutine add2sxy(x, a, y, b, n)
subroutine mxm(a, n1, b, n2, c, n3)
subroutine mappr(pm1, pm2, pa, pb)