Hi all,
I am trying to get the Integrated Vapor Transport from NARR data. I am
using a function that was written by Benjamin Moore from the the university
of Albany. The function is below. When I call the function I keep getting
this error:*fatal:No coordinate variable exists for dimension (gridx_221)
in variable (dum)*
Would anyone happen to know why I am getting this error when the variable
"u" that I get from the NARR file already has its latitude and longitude
2-d arrays. The variable "dum" is created from "u". In NARR they are
gridlat_221 and gridlon_221. I printed the Variable Summary for "u"
Thank you very much!
-A.J.
The function can be found on this website:
http://www.atmos.albany.edu/student/bmoore/research/bmoore/NCL_IVT/IVT_util.ncl
The part of that function where the error occurs is when it is trying to
assign metadata on line 145. I bolded this line below. In this function
rank just refers to the dimension number.
---------------------------------------------------------------
;Assigning metadata here
IVT@units = "kg/m/s"
IVT@long_name = "u and v-component of IVT"
if(rank.eq.4) then
IVT!1 = "time"
IVT&time = dum&time
end if
IVT!(rank-2) = dum!(rank-3)
IVT!(rank-1) = dum!(rank-2)
*IVT&$IVT!(rank-2)$ = dum&$dum!(rank-3)$*
IVT&$IVT!(rank-1)$ = dum&$dum!(rank-2)$
IVT!0 = "component"
return( IVT )
end
-------------------------------------------------------------------------
Here is my ncl script up to where I call the function uvIVT I printed NCL's
output and error statement:
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"
load "~/ncl_lib/IVT_util.ncl"
begin
files=systemfunc("ls -1 ./data/*.grb")
a=addfiles(files,"r")
nfiles=ListCount(a)
;do t=0,nfiles-1 ; TIME LOOP
t=0
; p_sfc = a[t]->PRES_221_SFC(lat2d_inds,lon2d_inds) ;Pa
; date = u@initial_time
;get all pressure level variables
qv = a[t]->SPF_H_221_ISBL(:,:,:) ;water vapor mix. ratio
u = a[t]->U_GRD_221_ISBL(:,:,:) ; u-component wind
v = a[t]->V_GRD_221_ISBL(:,:,:) ; v-component
printVarSummary(u)
*IntVapTransp = uvIVT(u,v,qv)*
Variable: u
Type: float
Total Size: 11214068 bytes
2803517 values
Number of Dimensions: 3
Dimensions and sizes: [lv_ISBL3 | 29] x [gridx_221 | 277] x [gridy_221 |
349]
Coordinates:
lv_ISBL3: [100..1000]
Number Of Attributes: 14
sub_center : The North American Regional Reanalysis (NARR) Project
center : US National Weather Service - NCEP (WMC)
long_name : u-component of wind
units : m/s
_FillValue : 1e+20
coordinates : gridlat_221 gridlon_221
level_indicator : 100
grid_number : 221
parameter_table_version : 131
parameter_number : 33
model : North American Regional Reanalysis (NARR)
forecast_time : 0
forecast_time_units : hours
initial_time : 11/28/2012 (00:00)
*fatal:No coordinate variable exists for dimension (gridx_221) in variable
(dum)*
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 09 11:33:17 2014
This archive was generated by hypermail 2.1.8 : Wed Apr 16 2014 - 09:14:14 MDT