[ncl-talk] NetCDF: Operation not allowed in define mode

David Brown dbrown at ucar.edu
Fri Jul 21 17:38:39 MDT 2017


HI Laura,
I don't think you would ever get the message: "NetCDF: One or more
variable sizes violate
format constraints" if the file you are writing is actually NetCDF4.

The problem is that your setfileoption call follows the addfile call.
It should precede it  -- the only time you can set the NetCDF format
is when opening the file. It is too late after the file has been
opened.

So I think you will be fine if you just move the setfileoption call
ahead of the addfile call.
 -dave

On Fri, Jul 21, 2017 at 5:18 PM, Laura Fowler <laura at ucar.edu> wrote:
> Hello:
>
> I am trying to write out a netcdf file and I get the error message:
>
> Variable: diag_rect
> Type: float
> Total Size: 11151360000 bytes
>             2787840000 values
>
> Number of Dimensions: 4
> Dimensions and sizes: [Time | 121] x [lat | 600] x [lon | 1200] x [pFixed | 32]
>
> Coordinates:
>             lat: [ -90..90.00000312924385]
>             lon: [   0..359.7000142931938]
>             pFixed: [1000..10]
> Number Of Attributes: 3
>
>   remap : remapped via ESMF_regrid_with_weights: Bilinear
>   missing_value : 9.96921e+36
>   _FillValue : 9.96921e+36
>
>
>
> ncendef: ncid 262144: NetCDF: One or more variable sizes violate
> format constraints
>
> fatal:NetCDF: Operation not allowed in define mode: error attempting
> to write variable (lat) to file
> (655362.rthcuten_rectangular.cu_ntiedtke.2016-05-04_00-2016-05-09_00.nc)
>
> warning:FileWriteVarVar: Could not write coordinate variable (lat) to
> file (655362.rthcuten_rectangular.cu_ntiedtke.2016-05-04_00-2016-05-09_00),
> continuing anyway
>
>
> Looking at ncl archives, it looks like it may be because of the large
> size of the array? However, I did specify:
> setfileoption("nc","Format","NetCDF4") thinking that it would help?
> Any other suggestions?
>
> The ncl script is in
> /glade2/scratch2/laura/MPAS.cu_grell_freitas_updates.rebased_develop/2016050400.ntiedtke.mp_tendencies/3Dfields/
> write.rectangular.toNETCDFs.ncl
>
> Thanks,
> Laura
>
>
>
>
>
> --
> !-------------------------------------------------------------------------------------------------------------
> Laura D. Fowler
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura at ucar.edu
> phone: 303-497-1628
>
> !-------------------------------------------------------------------------------------------------------------
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk


More information about the ncl-talk mailing list