- 积分
- 8736
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-5-4
- 最后登录
- 1970-1-1
|
发表于 2016-4-28 16:26:26
|
显示全部楼层
! Copyright (c) 2006 Yongjun ZHENG
! Author : Yongjun ZHENG
! Date : 5/9/2006
module wind_utils
real(kind=8),parameter :: PI=3.14159265358979323846
contains
subroutine uv2wind(u,v,spd,dir)
implicit none
! arguments
real,intent(in) :: u,v
real,intent(out) :: spd,dir
real :: tmp
spd=sqrt(u*u+v*v)
tmp=270.0-atan2(v,u)*180.0/PI
dir=mod(tmp,360.0)
end subroutine uv2wind
subroutine wind2uv(spd,dir,u,v)
implicit none
! arguments
real,intent(in) :: spd,dir
real,intent(out) :: u,v
! local variables
real :: tmp
tmp=(270.0-dir)*PI/180.0
u=spd*cos(tmp)
v=spd*sin(tmp)
end subroutine wind2uv
end module wind_utils
来自:http://blog.chinaunix.net/uid-523040-id-2388503.html?/1799.html |
|