[ncl-talk] vinth2p help
sidong
sidong at cma.gov.cn
Fri Mar 24 23:11:03 MDT 2017
Hi all,
I am trying to interpolate CCSM4 Decadal prediction dataset from hybrid coordinates to pressure coordinates.
I used the vinth2p function and downloaded the PS file separately. However, I got the following error.
Any suggestions will be highly appreciated.
Thank you
Dong
———————————ERROR———————————————————
fatal:Number of dimensions in parameter (1) of (vinth2p) is (2), (1) dimensions were expected
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 34 in file
——————————— Script——————————————————————————————
;************************************
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/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;************************************
begin
;-------------------------------------
diri1 = "//Volumes/Seagate/Z3/" ; input directory
fils = systemfunc ("ls "+diri1+"b40.dp.hd-1955.20C.1d.*.cam2.h0.Z3.195501-196412.nc") ; file paths
f = addfiles (fils, "r") ; note the "s" of addfile
ListSetType (f, "join")
Z3 = f[:]->Z3 ; read T from all files
printVarSummary (Z3)
;-------------------------------------
diri2 = "//Volumes/Seagate/PS/" ; input directory
fils2 = systemfunc ("ls "+diri2+"b40.dp.hd-1955.20C.1d.*.cam2.h0.PS.195501-196412.nc") ; file paths
f2 = addfiles (fils2, "r") ; note the "s" of addfile
ListSetType (f2, "join")
PS = f2[:]->PS ; read T from all files
printVarSummary (PS)
;-------------------------------------
Z3_ens = dim_avg_n_Wrap(Z3,0)
PS_ens = dim_avg_n_Wrap(PS,0)
printVarSummary (Z3_ens)
printVarSummary (PS_ens)
;-------------------------------------
pnew = (/950.0, 500.0, 300/)
hyam = f2[:]->hyam
hybm = f2[:]->hybm
p0mb = 1000.0
Z3new =vinth2p (Z3_ens, hyam,hybm, pnew, PS_ens, 1, p0mb, 1, True)
printVarSummary (Z3new)
———————————VarSummary——————————————————————
Variable: Z3
Type: float
Total Size: 6900940800 bytes
1725235200 values
Number of Dimensions: 5
Dimensions and sizes: [ncl_join | 10] x [time | 120] x [lev | 26] x [lat | 192] x [lon | 288]
Coordinates:
time: [ 31..3650]
lev: [3.54463800000001..992.5560999999998]
lat: [ -90.. 90]
lon: [ 0..358.75]
Number Of Attributes: 4
mdims : 1
units : m
long_name : Geopotential Height (above sea level)
cell_methods : time: mean
Variable: PS
Type: float
Total Size: 265420800 bytes
66355200 values
Number of Dimensions: 4
Dimensions and sizes: [ncl_join | 10] x [time | 120] x [lat | 192] x [lon | 288]
Coordinates:
time: [ 31..3650]
lat: [ -90.. 90]
lon: [ 0..358.75]
Number Of Attributes: 3
units : Pa
long_name : Surface pressure
cell_methods : time: mean
Variable: Z3_ens
Type: float
Total Size: 690094080 bytes
172523520 values
Number of Dimensions: 4
Dimensions and sizes: [time | 120] x [lev | 26] x [lat | 192] x [lon | 288]
Coordinates:
time: [ 31..3650]
lev: [3.54463800000001..992.5560999999998]
lat: [ -90.. 90]
lon: [ 0..358.75]
Number Of Attributes: 5
cell_methods : time: mean
long_name : Geopotential Height (above sea level)
units : m
mdims : 1
average_op_ncl : dim_avg_n over dimension(s): ncl_join
Variable: PS_ens
Type: float
Total Size: 26542080 bytes
6635520 values
Number of Dimensions: 3
Dimensions and sizes: [time | 120] x [lat | 192] x [lon | 288]
Coordinates:
time: [ 31..3650]
lat: [ -90.. 90]
lon: [ 0..358.75]
Number Of Attributes: 4
cell_methods : time: mean
long_name : Surface pressure
units : Pa
average_op_ncl : dim_avg_n over dimension(s): ncl_join
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170325/4cdb4ee8/attachment.html
More information about the ncl-talk
mailing list