Re: creating the nc file

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 13 2012 - 14:41:03 MDT

Alexander,

First, change your code of the following:

    ;===================================================================
    ; predefine the coordinate variables and their dimensionality
    ; Note: to get an UNLIMITED record dimension, we set the dimensionality
    ; to -1 (or the actual size) and set the dimension name to True.
    ;===================================================================
        dimNames = (/"time", "lat", "lon", "zlev"/)
        dimSizes = (/ -1 , nlat, nlon, nlev /)
        dimUnlim = (/ True , False, False, False/)
        filedimdef(fout,dimNames,dimSizes,dimUnlim)

to

;===================================================================
; predefine the coordinate variables and their dimensionality
; Note: to get an UNLIMITED record dimension, we set the dimensionality
; to -1 (or the actual size) and set the dimension name to True.
;===================================================================
 dimNames = (/"time", "zlev", "lat", "lon"/)
 dimSizes = (/ ntim , nlev, nlat, nlon /)
 dimUnlim = (/ True , False, False, False/)
 filedimdef(fo, dimNames, dimSizes, dimUnlim)

If it still did not work, please the full output message of this code to us.

Wei

huangwei@ucar.edu
VETS/CISL
National Center for Atmospheric Research
P.O. Box 3000 (1850 Table Mesa Dr.)
Boulder, CO 80307-3000 USA
(303) 497-8924

On Mar 13, 2012, at 2:18 PM, Alexander Semenov wrote:

> Hi!
>
> I have a problem with writing out the results of averaging in netCDF file. I was hoping you could tell me where i had an error.
>
> For some reason. My output variables S_avg and I_avg have weird dimensions:
>
> float S_avg(zlev, zlev, lat, lon) ;
> S_avg:long_name = "Daily sea surface temperature" ;
> S_avg:units = "degrees C" ;
> S_avg:_FillValue_original = -999s ;
> S_avg:valid_min = -300s ;
> S_avg:valid_max = 4500s ;
> S_avg:_FillValue = -999.f ;
> S_avg:average_op_ncl = "dim_avg_n over dimension(s): time" ;
> float I_avg(zlev, zlev, lat, lon) ;
> I_avg:long_name = "Sea ice concentration" ;
> I_avg:units = "percentage" ;
> I_avg:_FillValue_original = -999s ;
> I_avg:valid_min = 0s ;
> I_avg:valid_max = 100s ;
> I_avg:_FillValue = -999.f ;
> I_avg:average_op_ncl = "dim_avg_n over dimension(s): time" ;
>
>
> I need 1st dimension to be time. How come it puts zlev and then lev again? I didn't ask for that.
>
> In my opinion, the error has to be in arrays or in averaging.
>
> My code is attached.
>
> --
> regards
>
> *******************************************************
> Alexander Semenov
>
> PhD Student - Research Assistant
> International Arctic Research Center
> Department of atmospheric sciences
> University of Alaska Fairbanks
>
> 930 Koyukuk dr, 408c3
> Fairbanks, AK, USA, 99775
> work phone +19074742672
>
> <code.txt>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 13 14:41:20 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 20 2012 - 15:27:15 MDT