地球流体力学第三章各种波的图形.pdf
重力惯性波重力惯性波FortranFortran 程序程序Program my_001IMPLICIT NoneINTEGER,PARAMETER:M=16,n=2,Lx=16,Ly=16,T=6REAL,PARAMETER:pi=3.1415926REAL,PARAMETER:f=pi/6REAL x(M),y(M),sigmaREAL eta(M,M,6),u(M,M,6),v(M,M,6)INTEGER i,j,kdo i=1,Mx(i)=(i-1)*pi*2/Lxy(i)=(i-1)*pi*2/Lyenddosigma=2*pi/Tdo k=0,5do j=1,Mdo i=1,Meta(i,j,k+1)=cos(x(i)+y(j)-sigma*k)u(i,j,k+1)=sigma*cos(x(i)+y(j)-pi*k)-f*sin(x(i)+y(j)-sigma*k)v(i,j,k+1)=sigma*cos(x(i)+y(j)-pi*k)+f*sin(x(i)+y(j)-sigma*k)enddo;enddo;enddoopen(11,file=zlgxb.grd,form=binary)do k=1,6write(11) (eta(i,j,k),i=1,M),j=1,M)write(11) (u(i,j,k),i=1,M),j=1,M)write(11) (v(i,j,k),i=1,M),j=1,M)enddoclose(11)endgsgs 文件文件REINITopen D:myggradszlgxb.ctlenable print D:myggradszlgxb.pngset x 1 16set y 1 16set z 1set mproj offset grads offk=1while(k=6)set t kd etaset gxout vectorset arrscl 0.5 1.5d u;vdraw title t= kprintck=k+1endwhiledisable printreinit图图邦加莱波邦加莱波FortranFortran 程序程序Program my_002IMPLICIT NoneINTEGER,PARAMETER:M=16,n=2,Lx=16,Ly=16,T=6REAL,PARAMETER:pi=3.1415926REAL,PARAMETER:f=pi/6REAL x(M),y(M),sigmaREAL eta(M,M,6),u(M,M,6),v(M,M,6)INTEGER i,j,kdo i=1,My(i)=(i-1)*pi/(M-1)x(i)=(i-1)*pi*2/Lxenddosigma=2*pi/Tdo k=0,5do j=1,Mdo i=1,Meta(i,j,k+1)=cos(y(j)*cos(x(i)-sigma*k)u(i,j,k+1)=cos(y(j)*cos(x(i)-sigma*k)v(i,j,k+1)=-sin(y(j)*sin(x(i)-sigma*k)enddo;enddo;enddoopen(11,file=bjlb.grd,form=binary)do k=1,6write(11) (eta(i,j,k),i=1,M),j=1,M)write(11) (u(i,j,k),i=1,M),j=1,M)write(11) (v(i,j,k),i=1,M),j=1,M)enddoclose(11)endgsgs 文件文件和重力惯性波一样,此处略。图图开尔文波南边界开尔文波南边界FortranFortran 程序程序Program my_003IMPLICIT NoneINTEGER,PARAMETER:M=16,n=2,Lx=16,Ly=16,T=6REAL,PARAMETER:pi=3.1415926,e=2.7182818REAL,PARAMETER:f=pi/6REAL x(M),y(M),sigmaREAL eta(M,M,6),u(M,M,6),v(M,M,6)INTEGER i,j,kdo i=1,Mx(i)=(i-1)*pi*2/Lxy(i)=ienddosigma=2*pi/Tdo k=0,5do j=1,Mdo i=1,Meta(i,j,k+1)=exp(-y(j)*0.5)*cos(x(i)-sigma*k)u(i,j,k+1)=exp(-y(j)*cos(x(i)-sigma*k)*10v(i,j,k+1)=0enddo;enddo;enddoopen(11,file=krwb.grd,form=binary)do k=1,6write(11) (eta(i,j,k),i=1,M),j=1,M)write(11) (u(i,j,k),i=1,M),j=1,M)write(11) (v(i,j,k),i=1,M),j=1,M)enddoclose(11)end图图开尔文波北边界开尔文波北边界FortranFortran 程序程序Program my_005IMPLICIT NoneINTEGER,PARAMETER:M=16,n=2,Lx=16,Ly=16,T=6REAL,PARAMETER:pi=3.1415926,e=2.7182818REAL,PARAMETER:f=pi/6REAL x(M),y(M),sigmaREAL eta(M,M,6),u(M,M,6),v(M,M,6)INTEGER i,j,kdo i=1,Mx(i)=(i-1)*pi*2/Lxy(i)=ienddosigma=2*pi/Tdo k=0,5do j=1,Mdo i=1,Meta(i,j,k+1)=exp(y(j)*0.5)*cos(x(i)+sigma*k)u(i,j,k+1)=-exp(y(j)*0.5)*cos(x(i)+sigma*k)*0.001v(i,j,k+1)=0enddo;enddo;enddoopen(11,file=krwb.grd,form=binary)do k=1,6write(11) (eta(i,j,k),i=1,M),j=1,M)write(11) (u(i,j,k),i=1,M),j=1,M)write(11) (v(i,j,k),i=1,M),j=1,M)enddoclose(11)end图图罗斯贝波罗斯贝波FortranFortran 程序程序Program my_004IMPLICIT NoneINTEGER,PARAMETER:M=16,Lx=16,Ly=16,T=6REAL,PARAMETER:pi=3.1415926REAL,PARAMETER:f=pi/6REAL x(M),y(M),sigmaREAL eta(M,M,6),u(M,M,6),v(M,M,6)INTEGER i,j,kdo i=1,Mx(i)=(i-1)*pi*2/Lxy(i)=(i-1)*pi/(M-1)enddosigma=2*pi/Tdo k=0,5do j=1,Mdo i=1,Meta(i,j,k+1)=sin(y(j)*cos(x(i)+sigma*k)u(i,j,k+1)=-cos(y(j)*cos(x(i)+sigma*k)v(i,j,k+1)=-sin(y(j)*sin(x(i)+sigma*k)enddo;enddo;enddoopen(11,file=rossby.grd,form=binary)do k=1,6write(11) (eta(i,j,k),i=1,M),j=1,M)write(11) (u(i,j,k),i=1,M),j=1,M)write(11) (v(i,j,k),i=1,M),j=1,M)enddoclose(11)end图图