Monday, December 1, 2008

vertical distribution of vorticity using fortran

c program to find vertical distribution of vorticity
integer n,p(10)
real lat1,lat2,lon1,lon2,lat,dx,dy,tem,vort(10)
real omega,w
dimension ddd(4),ff(4)
print*,'enter the no of pressure levels'
read(*,*)n
print*,'enter the latitudes of south'
read(*,*)lat1
print*,'enter the latitudes of north'
read(*,*)lat2
print*,'enter the longitude of west'
read(*,*)lon1
print*,'enter the longitude of east'
read(*,*)lon2
lat=(lat1+lat2)/2
dx=(lon2-lon1)*cos(lat)*110*1000
dy=(lat2-lat1)*110*1000

open(1,file='vert.dat')
do i=1,n
read(1,*)p(i)
write(*,*)p(i)
do j=1,4
read(1,*)ddd(j),ff(j)
write(*,*)ddd(j),ff(j)
enddo
un=0.5148*(-1)*ff(1)*sin(ddd(1)*3.14/180)
us=0.5148*(-1)*ff(3)*sin(ddd(3)*3.14/180)
ve=0.5148*(-1)*ff(2)*cos(ddd(2)*3.14/180)
vw=0.5148*(-1)*ff(4)*cos(ddd(4)*3.14/180)
vort(i)=(ve-vw)/dx-(un-us)/dy
write(*,2)p(i),vort(i)
write(*,2)p(i),vort(i)*dx*dy
enddo
close(1)
2 format('Vorticity at level ',i7,' is ',f10.6)
3 format('Circulation at level ',i7,' is ',f10.6)
stop
end

No comments: