爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 12002|回复: 3

[脚本编辑] 求偏dp/偏t

[复制链接]

新浪微博达人勋

发表于 2021-4-16 19:42:10 | 显示全部楼层 |阅读模式

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

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

x
用grads对变量dp求局地变化率 偏dp/偏t ,用中央差分法计算,各位大神看看对不对

'set fwrite /sky3/zhangmz20/data/ddpt298.dr'
'set gxout fwrite'
t=2
'define ddpt=0'
while (t<=1580)
'set z 3'
'set lon 100 140'
'set lat 20 50'
'set t 't-1
'define dp1=dp'
'set t 't+1
'define dp2=dp'
'define ddpt=(dp2-dp1)/2'
'd ddpt'
t=t+1
endwhile
'disable fwrite'


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

新浪微博达人勋

 楼主| 发表于 2021-4-16 19:55:34 | 显示全部楼层
本帖最后由 ZMZ 于 2021-4-16 20:27 编辑

求各位大神帮帮忙&#129402;
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2021-4-16 22:24:35 | 显示全部楼层
给你个函数参考

cdiff
cdiff(expr,dim)

Performs a centered difference operation on expr in the direction specified by dim. The difference is done in the grid space, and no adjustment is performed for unequally spaced grids. The result value at each grid point is the value at the grid point plus one minus the value at the grid point minus one. The dim argument specifies the dimension over which the difference is to be taken, and is a single character: X, Y, Z, or T.

Result values at the grid boundaries are set to missing.

Usage Notes
Examples
The cdiff function may be used to duplicate the calculation done by the hcurl function:
define dv = cdiff(v,x)
define dx = cdiff(lon,x)*3.1416/180
define du = cdiff(u*cos(lat*3.1416/180),y)
define dy = cdiff(lat,y)*3.1416/180
display (dv/dx-du/dy)/(6.37e6*cos(lat*3.1416/180))
The above example assumes an X-Y varying dimension environment. Note that the intrinsic variables lat and lon give results in degrees and must be converted to radians in the calaculation. Also note the radius of the earth is assumed to be 6.37e6 meters thus the U and V winds are assumed to have units of m/sec.

Temperature advection can be calculated using the cdiff function as follows:
define dtx = cdiff(t,x)
define dty = cdiff(t,y)
define dx = cdiff(lon,x)*3.1416/180
define dy = cdiff(lat,y)*3.1416/180
display -1*( (u*dtx)/(cos(lat*3.1416/180)*dx) + v*dty/dy )/6.37e6
where the variable t is temperature, u is the U component of the wind, and v is the V component of the wind.
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2021-4-17 07:36:20 | 显示全部楼层
madvw(W,EXPR)
This function calculates

   -d(W*EXPR)/dp
using an upwind scheme.

W
Vertical wind speed (w component) (unit of vertical coordinate/s, such as hPa/s for the vertical coordinate in hPa)

EXPR
An expression.

Remarks
Note that no-slip boundary conditions are assumed. i.e.,

      w(lev=0)=0
      C(lev=0)=C(lev=1)
  
      concp, wp
           |---cn
      conc, w
           |---cnm
      concm, wm
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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