[ncl-talk] read and write netcdf-4 compressed files

Dan Chen dchen at ucar.edu
Thu Feb 4 20:16:35 MST 2016


Hi,

My name is Dan Chen working at MMM, NCAR.  I'm using ncl to read a 
variable and write into the netcdf-4 compressed file on Yellowstone, but 
failed.

The script is as blow:
========================================
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/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"

     begin

      fils = "*/glade/scratch/dchen/ncl_netcdf4/analysis.ensmean*"
       in = addfile(fils,"w")
       bb = wrf_user_getvar(in,"PM2_5_DRY",0)
       bb = bb*10
     fils->PM2_5_DRY = (/bb/)

     end
==========================================


The error is as below
=========================
Copyright (C) 1995-2015 - All Rights Reserved
  University Corporation for Atmospheric Research
  NCAR Command Language Version 6.3.0
  The use of this software is governed by a License Agreement.
  See http://www.ncl.ucar.edu/ for more details.
fatal:["NclNetCDF4.c":3073]:NclNetCDF4.c: Error in nc_def_var_chunking 
in file (/glade/scratch/dchen/ncl_netcdf4/analysis.ensmean) for writing, 
at line: 3073

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


If I change the input file to a normal netcdf file without the 
compression option, it works fine. But I do need to process those 
netcdf-4 compressed files.  Can you let me know if there is anything I 
can try?

Many thanks,
Dan





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160204/7bf21919/attachment.html 


More information about the ncl-talk mailing list