subroutine tenrgy(tm,wdtt,wtt) c c Volume integral of (del (tm)/d(theta))**2 c implicit none include 'itg.par' c real tm(lz,mz,nz,nspecz),wtt(mz,nz),coef,wdtt,qmr,qnr,delt integer mr,l,m,n include 'itg.cmn' c c ... note that dr(l)=2.0*dx c ... normalize by delta=pi*y0 in the x-direction c coef=0.25/(pi*y0) wdtt=0.0 c do 10 n=1,nd qnr=float(nrr(n))/z0 do 10 m=1,md mr=mrr(m,n) qmr=float(mr)/y0 wtt(m,n)=0.0 delt=(qmr*bdel(1)-qnr)*tm(1,m,n,1) wtt(m,n)=wtt(m,n)+delt*delt*dr(1)*0.5 do 20 l=2,ldb delt=(qmr*bdel(l)-qnr)*tm(l,m,n,1) wtt(m,n)=wtt(m,n)+delt*delt*dr(l) 20 continue delt=(qmr*bdel(ld)-qnr)*tm(ld,m,n,1) wtt(m,n)=wtt(m,n)+delt*delt*dr(ld)*0.5 wtt(m,n)=coef*wtt(m,n) wdtt=wdtt+wtt(m,n) 10 continue c return end