1、题目二:1、开始欧拉向后差分格式:即用初始的值zuv得到第一个时间步长的z1,u1,v12、然后即可用蛙跃差分来计算以后时刻的 z,u,v 蛙跃差分格式:A 由稳定性条件: ,取c=300m/s,不妨取步长为dl=300s计算n=24*3600/300B 计算 *U:差分格式如下:u2(i,j)=u0(i,j)+dl*(-u0(i,j)*(u0(i+1,j)-u0(i-1,j)/(2*dx)-v0(i,j)*(u0(i,j+1)-u0(i,j-1)/(2*dy)-g*(z0(i+1,j)-z0(i-1,j)/(2*dx)+f*v0(i,j) v2(i,j)=v0(i,j)+dl*(-u0(i,
2、j)*(v0(i+1,j)-v0(i-1,j)/(2*dx)-v0(i,j)*(v0(i,j+1)-v0(i,j-1)/(2*dy)-g*(z0(i,j+1)-z0(i,j-1)/(2*dy)-f*u0(i,j) z2(i,j)=z0(i,j)+dl*(-u0(i,j)*(z0(i+1,j)-z0(i-1,j)/(2*dx)-v0(i,j)*(z0(i,j+1)-z0(i,j-1)/(2*dy)-H*(u0(i+1,j)-u0(i-1,j)/(2*dx)+(v0(i,j+1)-v0(i,j-1)/(2*dy)C 由U0以及上面的计算的 *U计算U1:差分格式如下:u1(i,j)=u0(i,j)
3、+dl*(-u2(i,j)*(u2(i+1,j)-u2(i-1,j)/(2*dx)-v2(i,j)*(u2(i,j+1)-u2(i,j-1)/(2*dy)-g*(z2(i+1,j)-z2(i-1,j)/(2*dx)+f*v2(i,j)v1(i,j)=v0(i,j)+dl*(-u2(i,j)*(v2(i+1,j)-v2(i-1,j)/(2*dx)-v2(i,j)*(v2(i,j+1)-v2(i,j-1)/(2*dy)-g*(z2(i,j+1)-z2(i,j-1)/(2*dy)-f*u2(i,j)z1(i,j)=z0(i,j)+dl*(-u2(i,j)*(z2(i+1,j)-z2(i-1,j)/(
4、2*dx)-v2(i,j)*(z2(i,j+1)-z2(i,j-1)/(2*dy)-H*(u2(i+1,j)-u2(i-1,j)/(2*dx)+(v2(i,j+1)-v2(i,j-1)/(2*dy)D 计算n步以后的 ZUV:u2(i,j)=u0(i,j)+2*dl*(-u1(i,j)*(u1(i+1,j)-u1(i-1,j)/(2*dx)-v1(i,j)*(u1(i,j+1)-u1(i,j-1)/(2*dy)-g*(z1(i+1,j)-z1(i-1,j)/(2*dx)+f*v1(i,j)v2(i,j)=v0(i,j)+2*dl*(-u1(i,j)*(v1(i+1,j)-v1(i-1,j)/(
5、2*dx)-v1(i,j)*(v1(i,j+1)-v1(i,j-1)/(2*dy)-g*(z1(i,j+1)-z1(i,j-1)/(2*dy)-f*u1(i,j)z2(i,j)=z0(i,j)+2*dl*(-u1(i,j)*(z1(i+1,j)-z1(i-1,j)/(2*dx)-v1(i,j)*(z1(i,j+1)-z1(i,j-1)/(2*dy)-H*(u1(i+1,j)-u1(i-1,j)/(2*dx)+(v1(i,j+1)-v1(i,j-1)/(2*dy)结果如下:文件说明:蛙跃差分.f90 是蛙跃差分的fortran程序zuv00.dat 是原始数据zuv-out.txt 是每个步长积分后的结果zuv-end.txt 是最后一步的输出结果pot.ncl 是ncl作图脚本zuv.png 是作图结果(剪头的颜色是表示高度z)