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

Guido Cioni guidocioni at gmail.com
Tue Feb 2 06:04:54 MST 2016


I don’t know if it helps but using the “w” option in addfile function was giving me a lot of errors in NCL 6.3.0, while the older version was working well. Unfortunately I didn’t had time to investigate the error: having both versions I just needed to load and unload the module when I needed to write on a netcdf file. 
Maybe someone can give you more useful informations. 

Guido Cioni
http://guidocioni.altervista.org <http://guidocioni.altervista.org/> 

> On 02 Feb 2016, at 13:52, Hanna Ojrzyńska <hanna.ojrzynska at uni.wroc.pl> wrote:
> 
> 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
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160202/185dc646/attachment.html 


More information about the ncl-talk mailing list