- 积分
- 1831
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-5-6
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我从fnl中提取u,v风的数据,计算散度,涡度:提取u场的gs:
'reinit'
'open d:\zssdata\1100.ctl'
'open d:\zssdata\1106.ctl'
'open d:\zssdata\1112.ctl'
'open d:\zssdata\1118.ctl'
'open d:\zssdata\1200.ctl'
'open d:\zssdata\1206.ctl'
'open d:\zssdata\1212.ctl'
'open d:\zssdata\1218.ctl'
'open d:\zssdata\1300.ctl'
'open d:\zssdata\1306.ctl'
'open d:\zssdata\1312.ctl'
'open d:\zssdata\1318.ctl'
'open d:\zssdata\1400.ctl'
'set fwrite d:\u.grd'
'set gxout fwrite'
i=1
while(i<=13)
'set dfile 'i''
z1=1
while(z1<=26)
'set z 'z1''
'set lon 110 130'
'set lat 40 50'
'd UGRDprs'
z1=z1+1
endwhile
i=i+1
endwhile
'disable fwrite'
fortran:
program main
parameter(nx=21,ny=11,nz=26,nt=13,delta_lamda=3.14/180,delta_phi=3.14/180)
real u(nx,ny,nz,nt),v(nx,ny,nz,nt),vor2(nx,ny,nz,nt),div(nx,ny,nz,nt)
real f(ny)
a=6371000.0 !radiu of earth
open(21,file='d:\zssdata\u.dat',form='binary')
do k=1,nt
do s=1,nz
do j=1,ny
read(21,rec=21)(u(i,j,s,k),i=1,nx)
enddo
end do
end do
close(21)
open(22,file='d:\zssdata\v.dat',form='binary')
do k=1,nt
do s=1,nz
do j=1,ny
read(22,rec=22)(v(i,j,s,k),i=1,nx)
enddo
end do
end do
close(22)
write(*,*) 'ok input'
do k=1,nt
do s=1,nz
do j=2,ny-1
do i=2,nx-1
vor2(i,j,s,k)=(((v(i+1,j,s,k)-v(i-1,j,s,k))/(delta_lamda)/(cos((j+14)*3.14/180)))-((u(i,j+1,s,k)-u(i,j-1,s,k)))/(delta_phi)+(2*u(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
div(i,j,s,k)=(((u(i+1,j,s,k)-u(i-1,j,s,k))/(delta_lamda)/(cos((j+14)*3.14/180)))+((v(i,j+1,s,k)-v(i,j-1,s,k)))/(delta_phi)-(2*v(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
enddo
enddo
enddo
!边界
do s=1,nz
do j=2,ny-1
i=1
vor2(i,j,s,k)=(((v(i+1,j,s,k)-v(i,j,s,k))/(delta_lamda)/(cos((j+14)*3.14/180)))-((u(i,j+1,s,k)-u(i,j-1,s,k))/2)/(delta_phi)+(u(i,j,s,k)*tan((j+14)*3.14/180)))/(a)
div(i,j,s,k)=(((u(i+1,j,s,k)-u(i,j,s,k))/(delta_lamda)/(cos((j+14)*3.14/180)))+((v(i,j+1,s,k)-v(i,j-1,s,k))/2)/(delta_phi)-(v(i,j,s,k)*tan((j+14)*3.14/180)))/(a)
i=nx
vor2(i,j,s,k)=(((v(i,j,s,k)-v(i-1,j,s,k))/(delta_lamda)/(cos((j+14)*3.14/180)))-((u(i,j+1,s,k)-u(i,j-1,s,k))/2)/(delta_phi)+(u(i,j,s,k)*tan((j+14)*3.14/180)))/(a)
div(i,j,s,k)=(((u(i,j,s,k)-u(i-1,j,s,k))/(delta_lamda)/(cos((j+14)*3.14/180)))+((v(i,j+1,s,k)-v(i,j-1,s,k))/2)/(delta_phi)-(v(i,j,s,k)*tan((j+14)*3.14/180)))/(a)
enddo
enddo
do s=1,nz
do i=2,nx-1
j=1
vor2(i,j,s,k)=(((v(i+1,j,s,k)-v(i-1,j,s,k))/2/(delta_lamda)/(cos((j+14)*3.14/180)))-((u(i,j+1,s,k)-u(i,j,s,k)))/(delta_phi)+(u(i,j,s,k)*tan((j+14)*3.14/180)))/(a)
div(i,j,s,k)=(((u(i+1,j,s,k)-u(i-1,j,s,k))/2/(delta_lamda)/(cos((j+14)*3.14/180)))+((v(i,j+1,s,k)-v(i,j,s,k)))/(delta_phi)-(v(i,j,s,k)*tan((j+14)*3.14/180)))/(a)
j=ny
vor2(i,j,s,k)=(((v(i+1,j,s,k)-v(i-1,j,s,k))/2/(delta_lamda)/(cos((j+14)*3.14/180)))-((u(i,j,s,k)-u(i,j-1,s,k)))/(delta_phi)+(u(i,j,s,k)*tan((j+14)*3.14/180)))/(a)
div(i,j,s,k)=(((u(i+1,j,s,k)-u(i-1,j,s,k))/2/(delta_lamda)/(cos((j+14)*3.14/180)))+((v(i,j,s,k)-v(i,j-1,s,k)))/(delta_phi)-(v(i,j,s,k)*tan((j+14)*3.14/180)))/(a)
enddo
enddo
! 边界四点
i=1
j=1
do s=1,nz
vor2(1,1,s,k)=(((v(2,j,s,k)-v(1,j,s,k))*2/(delta_lamda)/(cos((j+14)*3.14/180)))-((u(i,2,s,k)-u(i,1,s,k))*2)/(delta_phi)+(2*u(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
div(1,1,s,k)=(((u(2,j,s,k)-u(1,j,s,k))*2/(delta_lamda)/(cos((j+14)*3.14/180)))+((v(i,2,s,k)-v(i,1,s,k))*2)/(delta_phi)-(2*v(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
enddo
i=1
j=ny
do s=1,nz
vor2(1,ny,s,k)=(((v(2,j,s,k)-v(1,j,s,k))*2/(delta_lamda)/(cos((j+14)*3.14/180)))-((u(i,ny,s,k)-u(i,ny-1,s,k))*2)/(delta_phi)+(2*u(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
div(1,ny,s,k)=(((u(2,j,s,k)-u(1,j,s,k))*2/(delta_lamda)/(cos((j+14)*3.14/180)))+((v(i,ny,s,k)-v(i,ny-1,s,k))*2)/(delta_phi)-(2*v(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
enddo
i=nx
j=1
do s=1,nz
vor2(nx,1,s,k)=(((v(nx,j,s,k)-v(nx-1,j,s,k))*2/(delta_lamda)/(cos((j+14)*3.14/180)))-((u(i,2,s,k)-u(i,1,s,k))*2)/(delta_phi)+(2*u(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
div(nx,1,s,k)=(((u(nx,j,s,k)-u(nx-1,j,s,k))*2/(delta_lamda)/(cos((j+14)*3.14/180)))+((v(i,2,s,k)-v(i,1,s,k))*2)/(delta_phi)-(2*v(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
enddo
i=nx
j=ny
do s=1,nz
vor2(nx,ny,s,k)=(((v(nx,j,s,k)-v(nx-1,j,s,k))*2/(delta_lamda)/(cos((j+14)*3.14/180)))-((u(i,ny,s,k)-u(i,ny-1,s,k))*2)/(delta_phi)+(2*u(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
div(nx,ny,s,k)=(((u(nx,j,s,k)-u(nx-1,j,s,k))*2/(delta_lamda)/(cos((j+14)*3.14/180)))+((v(i,ny,s,k)-v(i,ny-1,s,k))*2)/(delta_phi)-(2*v(i,j,s,k)*tan((j+14)*3.14/180)))/(2*a)
enddo
enddo
open(6,file='d:\zssdata\vor.grd',form='binary')
do k=1,nt
do s=1,nz
write(6,rec=6)((vor2(i,j,s,k),i=1,nx),j=1,ny)
enddo
enddo
close(6)
end
u,v风数据为300多k,但得出的vor.grd只有6kb,并且出图不显示图像。
这会是什么原因?
|
|