如何在grads中对格点数据四点求平均

如何在grads中对格点数据四点求平均,第1张

reset是一个命令啊,怎么能说函数。oacres是站点插值函数。我说的是可以改变格点资料分辨率的re()函数。它的具体解释在grads安装完的OpenGrADS\Contents\Resources\Documentation\opengrads\doc\udxt文件夹里
NAME
regex - A 2D regridding function for GrADS
SYNOPSIS
Short-hand
re(expr,dlon), while dlon=dlat
re(expr,dlon,dlat,['ig',nyig],['ba'|'bl'|'bs'|'vt',vtmax,vtmin|'ma',min]
re(expr,dlon,gYY,['ig',nyig],['ba'|'bl'|'bs'|'vt',vtmax,vtmin|'ma',min]
Linear Y-mapping
re(expr,nx,'linear',lon,dlon,ny,'linear',lat,dlat, ['ig',nyig],['ba'|'bl'|'bs'|'vt',vtmax,vtmin|'ma',min]
Gaussian Y-mapping
re(expr,nx,'linear',lon,dlon,ny,'gaus',gstart,njog, ['ig',nyig],['ba'|'bl'|'bs'|'vt',vtmax,vtmin|'ma',min]
DESCRIPTION
The regrid function re solves a common problem of transforming horizontal 2-D gridded fields from/to different resolutions/grid types for quantitative intercomparison For example, a model monthly mean precipitation field on a T126 gaussian grid can be compared to an observed climatology on a 25x25 grid using re The function re offers many transform options ranging from simple bilinear interpolation to box averaging with voting Additional methods can be added to re as needed
re transforms two-dimensional (2-D) lat/lon GrADS grids from one grid type/resolution to another The input is any 2-D lat/lon grid defined by the current GrADS lat/lon dimension environment re handles input grids which are cyclically continuous in longitude and excludes undefined input grid values from participation in the transform If a valid transform cannot be made (ie, insufficient defined data points), the output grid is set to undefined re supports two output grid types: 1) lat/lon with fixed increments; and 2) gaussian Four transforms are available: 1) box averaging for regridding fine to coarse grids; 2) box averaging with ``voting'' for noncontinuous/index data such, as soil type; 3) bilinear interpolation; and 4) 4-point bessel interpolation
REQUIRED PARAMETERS
expr:
Any valid GrADS grid expression (eg, z or ave(z3(t+0,t=120,1yr)), real number, 'undef' or '-u'
nx:
The number of points in longitude (integer)
lon:
Beginning longitude (center of the lower left hand corner grid or the grid (1,1)) of the output domain (float)
dlon:
Delta longitude (dlon) or number of gaussian longitudes on the GLOBE (float)
ny:
The number of points in latitude (integer)
lat:
Beginning latitude (center of the lower left hand corner grid or the grid (1,1)) of the output domain (float)
dlat:
Delta latitude (dlat) or the number of gaussian latitudes on the GLOBE (float)
gstart:
The first gaussian grid number If the data span all latitudes, start would be 1, indicating the southernmost gaussian grid latitude (integer)
njog:
The number of GLOBAL gaussian latitudes on the output grid (integer)
'linear':
Linear mapping (string)
'gaus':
Gaussian latitide mapping (string)
Note:
All strings are CASE INSENSITIVE
OPTIONAL PARAMETERS
Input Gaussian Grid:
'ig', nyig:
Input grid is gaussian with nyig being the number of gaussian latitudes (eg, ig92 for the NMC T62 grid) nyig must be >= 8 and a multiple of four This parameter is used to invoke a more precise calculation of the boundary between gaussian grid boxes
Interpolation Method:
'ba'
Box averaging (the default, while regrids to coarse resoultion)
'bl':
Bi-linear interpolation (the default, when regridding to a finer resolution)
'bs':
3rd order Bessel interpolation
'vt', vtmax, vtmin:
Vote interpolation or box averaging with voting The parameters (vtmax,vtmin) (range: [0-1]) set the fraction of an output grid box that must be covered by defined input grid data for a ``winner'' to be chosen in the election The default is vtmax=vtmin=1/2
The parameter vtmin must be the same as vtmax except for three or more candidates The fraction for two candidates is midway between vtmax and vtmin
When there is only one candidate, vtmax is the minimum fraction of an output grid point hat must be covered by defined input grid data for a ``winner'' to be chosen in the election
Specifying vtmax = vtmin = 1 would require that 100% of the output grid box must be covered by a single, unique value from the input grid whereas vtmax = vtmin = 0 would allow a winner to be chosen if ANY candidates where running The default value of 05 means that a simple majority is required to have a winner
'ma', fraction:
This option applies ONLY to box averaging without voting when the input grid has undefined points The parameter fraction (range: [0-1]) specifies the minimum area which must be covered with DEFINED data boxes to be considered a valid interpolation The old regrid v10 assumed fraction was 0 or that if ANY input grid boxes contained defined data which intersected the output grid produced a box average This was clearly too liberal and fraction is now set by default to 50% or that half the output grid box must be covered with defined data to produced a defined output grid point
EXAMPLES
)
Regrid a global T62 gaussian grid (192x94) to a 25 deg lat/lon by box averaging,
open /reanl1/pilot20/fluxgrb8508ctl
set x 1 192
set y 1 94
define p25=re(p,144,linear,0,25,72,linear,-8875,25,ba)
or set lon 0 360 set lat -90 90 define p25=re(p,25,25,ba)
or more simply,
define p25=re(p,25)
Note: The lat/lon dimension environment is set using grid coordinates (x,y) to make the input and output grids global To minimize future graphics/analysis calculations with the regridded field, we use the GrADS define function to store the grid in memory where it can be referenced as any other GrADS grid
)
Regrid a 4x5 SiB vegetation type to a R15 (48x40) gaussian grid using box averaging with ``voting'' Require that at least 60% of the output grid box must be covered with a single candidate value from the input grid for an election to occur Otherwise the output grid box is set to undefined Relax the one-candidate election requirement to 20% when there are three or more candidates,
open /export/sgi18/fiorino/data/sib/sibparamannualctl
set lon 0 360
set lat -90 90
define i21=re(index,48,linear,0,75,40,gaus,1,40,vt,060,020)
set gxout grfill
d index
d i21
Note : During candidate selection, undefined input grid points do not contribute to the fraction of the output grid box covered with input grid boxes The best way to display index type data in GrADS is to use the ``grid fill'' display option (set gxout grfill) GrADS will draw the grid box and color it according to the grid value
)
Regrid 1x1 Aviation run 500 mb z to 25x25 grid for the region (-140, 20) to (-40, 70) using bessel interpolation,
open /export/sgi39/wd22sl/grads/avn/avn93092800fcstctl
set lev 500
set lat -180 180
set lon -90 90
d re(z,40,linear,-13875,25,20,linear,2125,25,bs)
or
set lat 20 70
set lon -140 -40
d re(z,40,linear,-13875,25,20,linear,2125,25,bs)
or
d re(z,25,25,bs)
Note: The above three regrid commands produce exactly the same results Box averaging would be more appropriate when regridding to a coarser grid
)
Regrid 1x1 Aviation run 500 mb z to 25x25 grid using box averaging and setting the grid to start at a specific lat/lon,
open /export/sgi39/wd22sl/grads/avn/avn93092800fcstctl
set lev 500
set lat -20 70
set lon -140 -40
d re(z,40,linear,-13875,25,20,linear,2125,25,ba)
set lat 30 50
set lon -50 50
d re(z,40,linear,-13875,25,20,linear,2125,25,ba)
Note: The above two regrids produce DIFFERENT results since the input domain does not cover the entire output domain Missing values will be filled for the uncovered regions

流线的疏密表示流速的大小,流线越密,表示流速越大;流线越疏,表示流速越校。
打开需分析零件的后处理窗口,然后将坯料单独显示(不显示模具),点击 FLOW NET图标,选择你需要查看流线的起始步,如用鼠标在step 10上面点击一下,然后点选右边蓝色的箭头,同样,选择一个终点步(如选择70)。这里需要说明的是,这里选择的步
当气流迎面流过机翼的时候,机翼同气流方向平行,原来是一股气流,由于机翼的插入,被分成上下两股。在翼剖面前缘附近,气流开始分为上、下两股的那一点的气流速度为零,其静压值达到最大。这个点在空气动力学上称为驻点。对于上下弧面不对称的
1GRADS有关的文件类型和维数环境 可以认为和GRADS有关的文件类型有:十进制的原始数据文件(*TXT)、二进制的数据文件(*DAT)、数据描述文件(*CTL)、批处理文件(*GS)和图形文件(*GMF)。 气象业务中使用的站点资料或格点资料都
流线是某一相同时刻在流场中画出的一条空间曲线,在该时刻,曲线上的所有质点的速度矢量均与这条曲线相切。它是欧拉法描述流动的一种方法。 流线表示的是某一瞬时流场中许多处于这一流线上的流体质点的运动情况,而不是某一个流体质点的运动轨迹
流线是某一相同时刻在流场中画出的一条空间曲线,在该时刻,曲线上的所有质点的速度矢量均与这条曲线相切。它是欧拉法描述流动的一种方法。 流线表示的是某一瞬时流场中许多处于这一流线上的流体质点的运动情况,而不是某一个流体质点的运动轨迹

GrADS 的函数分两类, 一类是对格点/站点数据执行运算的,这一类我们姑且称之为分析函数; 另一类是脚本编程(gs)时使用的, 这后一类我们姑且称之为脚本函数 第一类分析函数又分为格点分析和站点分析两个子类: 1) 格点分析 绝对值

匿名登录以下ftp站点ftpcdcnoaagov
路径
/pub/Datasets/根据自己需要查看相关文件夹,下载数据即可。数据格式为nc有很多工具可以打开兼绘图:grads、ncl、matlab

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
typedef struct
{
double a,b;
char c;
}standard;
class Student
{
string name;
int id;
public:
Student(string n, int i) : name(n), id(i) {}
virtual void print() = 0;
virtual void judge(standard s) = 0;
protected:
void print_info()
{
cout << id << " " << name << " ";
}
};
class HighStu : public Student
{
double score[11];
public:
HighStu(string n, int i) : Student(n,i)
{
for(int i=0;i<11;i++)
cin >> score[i];
}
double TotalScore() const
{
double sum = 0;
for(int i=0;i<11;i++)
sum += score[i];
return sum;
}
void print()
{
print_info();
cout << "A HighSchool Student with All Score " << fixed << setprecision(2) << TotalScore() << endl;
}
void judge(standard s)
{
if(TotalScore() >= sa)
print();
}
};
class UnderGStu : public Student
{
double score[40];
public:
UnderGStu(string n, int i) : Student(n,i)
{
for(int i=0;i<40;i++)
cin >> score[i];
}
double GPA() const
{
double sum = 0;
for(int i=0;i<40;i++)
if(score[i] >= 60 && score[i] <= 100)
sum += (score[i] - 50) / 10;
return sum / 40;
}
void print()
{
print_info();
cout << "A UnderGraduate Student with GPA " << fixed << setprecision(2) << GPA() << endl;
}
void judge(standard s)
{
if(GPA() >= sb)
print();
}
};
class GradStu : public Student
{
double score[15];
public:
GradStu(string n, int i) : Student(n,i)
{
for(int i=0;i<15;i++)
cin >> score[i];
}
char rank() const
{
double sum = 0;
for(int i=0;i<15;i++)
{
sum += score[i];
}
sum /= 15;
if(sum < 60) return 'E';
else if(sum < 70) return 'D';
else if(sum < 80) return 'C';
else if(sum < 90) return 'B';
else return 'A';
}
void print()
{
print_info();
cout << "A Graduated Student with rank " << rank() << endl;
}
void judge(standard s)
{
if(rank() <= sc)
print();
}
};
int main()
{
int n,i;
cin >> n;
Student pt2stu = new Student[n];
for(i=0;i<n;i++)
{
int id;
string name;
string type;
cin >> id >> name >> type;
if(type == "HighSchool")
pt2stu[i] = new HighStu(name,id);
else if(type == "UnderGraduate")
pt2stu[i] = new UnderGStu(name,id);
else if(type == "Graduated")
pt2stu[i] = new GradStu(name,id);
}
standard s;
cin >> sa >> sb >> sc;
for(i=0;i<n;i++)
{
pt2stu[i]->judge(s);
}
// system("pause");
return 0;
}

这是一个正常功能。
是为了方便用户计时,提醒用户时间。
GrADS(Grid Analysis and Display System)是当今气象界广泛使用的一种数据处理和显示软件系统。该软件系统通过其集成环境,可以对气象数据进行读取、加工、图形显示和打印输出。它在进行数据处理时,所有数据在GrADS中均被视为纬度、经度、层次和时间的4维场,而数据可以是格点资料,也可以是站点资料;数据格式可以是二进制,也可以是GRIB码,还可以是NetCDF,从而具有 *** 作简单、功能强大、显示快速、出图类型多样化、图形美观等特点。正因为如此,GrADS已迅速成为国内外气象界通用的标准图形环境之一。

我也遇到过这样的问题,grads自带有个卸载工具可以卸载一些个环境变量,卸载了之后就可以用了,原因可能是重复安装后环境变量的问题,具体原理我也不是很清楚。你可以试试,我就是这样弄好的


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12712939.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-27
下一篇 2023-05-27

发表评论

登录后才能评论

评论列表(0条)

保存