- 积分
- 36
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-12-5
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 dongjunhui11 于 2019-12-17 10:04 编辑
因写论文需要自学用ncl绘图
我想画一个位势高度的图
这个脚本运行后报变量截取超出范围(也就是这一行 u = f->hgt(79634,1000,:,:) )
可我实在不知道哪里超出了
望各位大神帮忙看看 感谢!
以下是我的脚本:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
f = addfile("hgt.2018.nc","r")
u = f->hgt(79634,1000,:,:)
wks = gsn_open_wks("png","hgtmap")
plot = gsn_csm_contour(wks,u,False)
res = True
res@cnMonoLineColor = False
res@cnLineColors = span_color_rgba ("NCV_jet",11)
res@cnLineThicknessF = 5.0
plot = gsn_csm_contour(wks,u,res)
end
以下是报错:
fatal:Subscript out of range, error in subscript #0
fatal:Execute: Error occurred at or near line 7 in file hgtmap.nc
以下是nc数据:
filename: hgt.2018
path: hgt.2018.nc
file global attributes:
title : Once daily NCEP geopotential height data
delta_time : once daily
supplier : NCEP
producer : NCEP
history : created 2017/12 by Hoop (netCDF3)
description : Data is from NCEP initialized analysis
(2x/day). It consists of most variables interpolated to
pressure surfaces from model (sigma) surfaces. Data
is averged from 2x daily
platform : Model
Conventions : CF-1.2
dataset_title : NCEP Global Data Assimilation System GDAS
dimensions:
lon = 144
lat = 73
level = 12
time = 365 // unlimited
variables:
float hgt ( time, level, lat, lon )
long_name : Geopotential height
actual_range : ( -606.6207, 21200.11 )
valid_range : ( -700, 29000 )
units : m
missing_value : -9.96921e+36
var_desc : Geopotential height
precision : 2
dataset : NCEP
level_desc : Multiple levels
statistic : Mean
parent_stat : Individual Obs
_FillValue : -999
float lon ( lon )
units : degrees_east
long_name : Longitude
actual_range : ( 0, 357.5 )
standard_name : longitude
axis : X
float lat ( lat )
units : degrees_north
actual_range : ( 90, -90 )
long_name : Latitude
standard_name : latitude
axis : Y
float level ( level )
units : mb
long_name : Level
actual_range : ( 50, 1000 )
positive : down
axis : Z
double time ( time )
units : days since 1800-1-1 00:00:0.0
long_name : Time
actual_range : ( 79623, 79987 )
delta_t : 0000-00-01 00:00:00
avg_period : 0000-00-01 00:00:00
prev_avg_period : 0000-00-00 06:00:00
standard_name : time
axis : T
short head ( time, level )
valid_range : ( 0, 3 )
long_name : Missing
|
|