subroutine penrgy(p,wp,wpp) c c Volume integral of p(x,y)**2 c implicit none include 'itg.par' real p(lz,mz,nz,nspecz),wpp(mz,nz),wp,coef integer l,m,n include 'itg.cmn' c c ... note dr(l)=2.0*dx c ... normalize by delta=pi*y0 in the x-direction c wp=0.0 coef=0.25/(pi*y0) c do 10 n=1,nd do 10 m=1,md wpp(m,n)=p(1,m,n,1)*p(1,m,n,1)*dr(1)*0.5 do 20 l=2,ldb wpp(m,n)=wpp(m,n)+p(l,m,n,1)*p(l,m,n,1)*dr(l) 20 continue wpp(m,n)=wpp(m,n)+p(ld,m,n,1)*p(ld,m,n,1)*dr(ld)*0.5 wpp(m,n)=coef*wpp(m,n) wp=wp+wpp(m,n) 10 continue c return end