[ncl-talk] writing new variable in NetCDF4 (ncl 6.3)

Hanna Ojrzyńska hanna.ojrzynska at uni.wroc.pl
Tue Feb 2 05:52:25 MST 2016


Dear all,
I wrote script to calculate new AQI index from data existing in wrfout file (NetCDF4). I want to write new variable (AQI) in those NetCDF4.

Below important parts of script:  


################################

a = addfile(FILES(ifil)+".nc","w")
...

T2=wrf_user_getvar(a,"T2",-1)

AQI at long_name="Air Quality Index"
AQI at short_name="AQI")
filevardef(a, "AQI",typeof(T2), getvardims(T2))


a->AQI(it,:,:) = (/AQI(it,:,:)/)

##################################

It runs in ncl 6.1.0 but in 6.3.0 I recived:

fatal:["NclNetCDF4.c":3073]:NclNetCDF4.c: Error in nc_def_var_chunking in file (/home/hano/Documents/scripts/wrfout_d03_2014-01-26_00:00:00.nc) for writing, at line: 3073

line 3074 of NclNetCDF4.c: NetCDF: Attempt to define var properties, like deflate, after enddef.

What is the reason?

-- 
Dr inż. Hanna Ojrzyńska

Uniwersytet Wrocławski
Instytut Geografii i Rozwoju Regionalnego
Zakład Klimatologii i Ochrony Atmosfery
www.meteo.uni.wroc.pl


More information about the ncl-talk mailing list