undef("Ridge_Line")
function Ridge_Line(u_LL[*][*]:numeric) ; {
local u_LL,R_LL,nlat,nlon,dims,ix,lat,dy
begin
dims = dimsizes(u_LL)
nlat = dims(0)
nlon = dims(1)
R_LL = new((/nlon/),typeof(u_LL))
lat = u_LL&$u_LL!0$
dy = lat(1)-lat(0)
do ix=0,nlon-1
R_LL(ix)= tofloat(minind(abs(u_LL({0:40},ix)))*dy*1.0+lat(0)) ; min value
end do
R_LL!0 = u_LL!1
R_LL&$u_LL!1$= u_LL&$u_LL!1$
copy_VarAtts(u_LL,R_LL)
return R_LL
end
根據(jù)HGT最高留攒,并南北調(diào)整計算脊線
undef("Ridge_Line")
function Ridge_Line(hgt_LL[*][*]:numeric) ; {
local hgt_LL,R_LL,nlat,nlon,dims,ix,lat,dy
begin
dims = dimsizes(hgt_LL)
nlat = dims(0)
nlon = dims(1)
R_LL = new((/nlon/),typeof(hgt_LL))
R_LL = hgt_LL@_FillValue
R_LL_1 = new((/nlon/),typeof(hgt_LL))
lat = hgt_LL&$hgt_LL!0$
dy = lat(1)-lat(0)
do ix=0,nlon-1
R_LL_1(ix)= tofloat(maxind(abs(hgt_LL({0:40},ix)))*dy*1.0+lat(0)) ; min value
if (R_LL_1(ix).gt.2.and.hgt_LL({R_LL_1(ix)-dy},ix).gt.hgt_LL({R_LL_1(ix)+dy},ix)) then
R_LL(ix)=R_LL_1(ix)-1+0.5*((hgt_LL({R_LL_1(ix)},ix)-hgt_LL({R_LL_1(ix)-dy},ix))/(hgt_LL({R_LL_1(ix)},ix)-hgt_LL({R_LL_1(ix)+dy},ix)))
else if(R_LL_1(ix).gt.2) then
R_LL(ix)=R_LL_1(ix)+1-0.5*((hgt_LL({R_LL_1(ix)},ix)-hgt_LL({R_LL_1(ix)+dy},ix))/(hgt_LL({R_LL_1(ix)},ix)-hgt_LL({R_LL_1(ix)-dy},ix)))
else
dy=dy
end if
end if
end do
R_LL!0 = hgt_LL!1
R_LL&$hgt_LL!1$= hgt_LL&$hgt_LL!1$
copy_VarAtts(hgt_LL,R_LL)
return R_LL
end