; twod1.pro ; Based on TWOD1.FR ; Revisions: ; 2001 Nov 5 - IDL version ;***file twod1.fr ;***dick french ;***latest revision 6//81 ; ;---this fortran 5 routine is used in program golc. it computes the ; integrand used for determination of the bending angle for ; two-dimensional waves using geometric optics. see rgf mit#3 p.131+. ; this version is for constant fractional amplitude gravity waves. ; ; function twod1,ha,i,j,dxhat,hhat,eps,wlpsh, $ psi,rhat,shphw,idiag ; twopi=!dpi*2.d0 ; zkhat=twopi*wlpsh zlhat=twopi/shphw xj=double(j)*dxhat rdif=ha+xj*xj/(2.d0*rhat) - double(i-1)/hhat arg=zkhat*rdif + zlhat*xj + psi ca=cos(arg) sa=sin(arg) ex=exp(-rdif) znu=ex*(1.d0 + eps*sa) fac=eps*ex*ca dndr=-znu + fac*zkhat dndx=fac*zlhat twod1=dndr-xj*dndx if(idiag eq 0) then return,twod1 print, "j=",j," znu=",znu print, "zkhat=",zkhat," zlhat=",zlhat print, "arg=",arg," ex=",ex print, "dndr=",dndr," dndx=",dndx print, "xj=",xj," rdif=",rdif print, "twod1=",twod1 print return,twod1 end