爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3860|回复: 3

ncl求整层大气势函数和流函数

[复制链接]

新浪微博达人勋

发表于 2015-3-28 15:06:57 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
求助,很多研究水汽输送文章里面都用了整层大气势函数和流函数,ncl中虽然有对应的函数,但是求出的是(t,z,y,x)也就是单个时次单个层次固定点的值,请问如何求整层大气中的势函数和流函数呢,如何积分?

PS:我之前认为把所有层次结果都加起来,以下是错误的程序,运行时还有错误提示,劳烦高手看下哪里错了,不胜感激

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
  a=addfile("/home/Administrator/uwnd.2015.nc","r")
  b=addfile("/home/Administrator/vwnd.2015.nc","r")
  
  
  sf=new((/73,144/),float)
  vp=new((/73,144/),float)
  sfall=new((/17,73,144/),float);定义流函数势函数对应的三维数组,时次为304
  vpall=new((/17,73,144/),float)

  do z=0,16
  u=a->uwnd(304,z,:,:)
  v=b->vwnd(304,z,:,:)
  
  ;计算势函数,流函数
  uv2sfvpf(u,v,sf,vp)
  sfall(z,:,:)=sf(:,:)   ;将所有层次流函数值放入sfall
  vpall(z,:,:)=vp(:,:)
  end do
  
  ;对所有层次求和
ssf=new((/73,144/),float)
  vvp=new((/73,144/),float)
  do z=0,16
  ssf(:,:)=ssf(:,:)+sfall(z,:,:)
  vvp(:,:)=vvp(:,:)+vpall(z,:,:)
  end do
  ;画图
  wks = gsn_open_wks("ps","sfs")                  
  res                         = True               ; plot mods desired
    res@mpOutlineOn             = True               ; turn on map outline
  res@tiMainString            = "stream function" ; title
  plot=gsn_csm_contour_map_ce(wks,ssf,res)          ; create plot
; plot=gsn_csm_contour_map_ce(wks,,res)          ; create plot
  end

错误显示
0)     check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.
(0)     A valid latitude coordinate array should have a 'units' attribute equal to one of the following values:
(0)         'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
(0)     check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.
(0)     A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:
(0)         'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'


密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-7-9 20:46:26 | 显示全部楼层
要对新定义的变量 进行维数说明。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-5-3 17:06:00 | 显示全部楼层
请问楼主解决了么?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-5-3 17:06:19 | 显示全部楼层
请问楼主解决了么?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表