[ncl-talk] create netcdf file containing daily climatology

Dennis Shea shea at ucar.edu
Tue Feb 21 08:20:17 MST 2017


You must look at the variable you wish to write to the netCDF file.
Always use printVarSummary(...)

;***********************************************************
; Compute daily climatology: raw and then 'smoothed'
;***********************************************************
   xClmDay = clmDayTLL(x, yyyyddd)     ; daily climatology at each grid
point
   printVarSummary(xClmDay)

Variable: xClmDay
Type: float
Total Size: 15389568 bytes
            3847392 values
Number of Dimensions: 3
Dimensions and sizes:    [year_day | 366] x [lat | 73] x [lon | 144]
Coordinates:
            year_day: [1..366]
            lat: [90..-90]
            lon: [ 0..357.5]
Number Of Attributes: 4
  long_name :    Daily Climatology: mean Daily U-wind
  units :    m/s
  information :    Raw daily averages across all years
  smoothing :    None
======================================================

Note: there is *no* time dimension. Rather than

        dimNames = (/"time", "lat", "lon"/)
use
        dimNames = (/"year_day", "lat", "lon"/)

---
Change:
           filevardef(fnc, "time"  ,typeof(time),getvardims(time))
To
           filevardef(fnc, "year_day"
,typeof(year_day),getvardims(year_day))

---
Change
          filevardef(fnc, "time"  ,typeof(time),getvardims(time))
To
          filevardef(fnc, "year_day"
,typeof(year_day),getvardims(year_day))
---


Change
        filevardef(fnc, varNC   ,typeof(xAnom)   ,getvardims(xAnom))
To
        filevardef(fnc, xClmDay   ,typeof(xClmDay)   ,getvardims(xClmDay))

---
etc








On Tue, Feb 21, 2017 at 2:45 AM, Sujata Mandke <amin at tropmet.res.in> wrote:

> Dear NCL community,
> Greetings!
>
>    I am using NCL script  ”mjo_clivar_2.ncl” from application examples
> on NCL website. In this example script,  netcdf file containing
> anomalies is created. Instead of anomalies, i wish to create netcdf file
> containing climatology. I had modified the script accordingly.
> The error message is as follows:
> ----------
> FileAddVar, in file: NclFile.c, line: 454
> fatal:FileAddVar: Dimension (year_day) is not currently defined, can't add
> variable
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 125 in
> file mjo_clivar_2.dlclm.ncl
> --------------
> I understand that the error is resulting because leftmost dimension
> of daily climatology is “year_day” (=366).  While, the leftmost dimension
> of anomaly is time (which is same as in input file).
> However, I do not know how to modify the script. I have searched the
> “NCL-talk archives” extensively, but found none for this error.
> I am attaching my script with this mail.
> As the error is not caused by the data, the script can be
> tested with any data. So, i am not attaching the data file.
>
> I am using NCL version 6.1.2 on linux machine.
>
> Please help in this regard.
> Any suggestion would be of great help.
> Many thanks.
> With regards
> Sujata Mandke
>
> --
> Dr. Sujata Mandke
> scientist,Indian Institute of Tropical Meteorology
> PUNE,INDIA
>
> _______________________________________________
> 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/20170221/51751569/attachment.html 


More information about the ncl-talk mailing list