[ncl-talk] Averaging over time dimension

Soma Roy somaroy892 at gmail.com
Thu Mar 8 08:35:49 MST 2018


Hi,

I am trying to access multiple variables from a file and need to average
over time for each variables.

I am running the following codes:

   fn  = "ERA_Plev.nc"                      ; define filename
   in  = addfile(fn,"r")                         ; open netcdf file
   printVarSummary(in)

T=in->t       ; temperature
U=in->u      ; U wind
V=in->v      ; V wind

printVarSummary(T)
printVarSummary(U)
printVarSummary(V)

;T1 = dim_avg_n(T,0)
;T at units = "K"
end

Summary of the file is like below;

Variable: in
Type: file
File path: ERA_Plev.nc
Number of global attributes:     2
Number of dimensions:    4
Number of variables:     18
fatal:NclMalloc Failed:[errno=12]
Segmentation fault (core dumped)

When I am calling only Temperature using the codes below;

fn  = "ERA_Plev.nc"               ; define filename
in  = addfile(fn,"r")                         ; open netcdf file
   printVarSummary(in)

T=in->t     ; temperature
;U=in->u     ; U wind
;V=in->v     ; V wind

printVarSummary(T)
;printVarSummary(U)
;printVarSummary(V)

;T1 = dim_avg_n(T,0)
;T at units = "K"
end

It shows

Variable: T
Type: short
Total Size: 1042566000 bytes
            521283000 values
Number of Dimensions: 4
Dimensions and sizes:   [time | 120] x [level | 25] x [latitude | 721] x
[longitude | 241]
Coordinates:
            time: [994176..994890]
            level: [50..125]
            latitude: [90..-90]
            longitude: [60..120]
Number Of Attributes: 7
  scale_factor :        0.00218919045579553
  add_offset :  252.4797479951041
  _FillValue :  -32767
  missing_value :       -32767
  units :       K
  long_name :   Temperature
  standard_name :       air_temperature


I have to call several other variables from this file (14 GB) and I need to
average over time such that 'Dimensions' of each variables will be like
below;

[time | 1]* [level | 25] x [latitude | 721] x [longitude | 241]

Which function I have to use in this case?


When I am trying to call  other variables from the file I am getting the
error message as;

Variable: in
Type: file
File path: ERA_Plev.nc
Number of global attributes:     2
Number of dimensions:    4
Number of variables:     18
fatal:NclMalloc Failed:[errno=12]
Segmentation fault (core dumped)

Please kindly inform me how to resolve this issue.


Thank you,
Soma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180308/52bd6928/attachment.html>


More information about the ncl-talk mailing list