[ncl-talk] Daily averages from 6 hourly data

Nkese Mc Shine Nkese.McShine at sta.uwi.edu
Fri Apr 26 06:50:09 MDT 2019


Good morning,

Thanks a lot. It works well now.

Regards,
Nkese.
________________________________
From: Dennis Shea [shea at ucar.edu]
Sent: 18 April 2019 23:55
To: Barry Lynn
Cc: Nkese Mc Shine; ncl-talk at ucar.edu
Subject: Re: [ncl-talk] Daily averages from 6 hourly data

This is a subtle error which I can not seem to isolate. The issue is tha

dimensions:
        lon = 192 ;
        lat = 94 ;
        level = 1 ;
        time = UNLIMITED ; // (1460 currently)
variables:

        short uwnd(time, level, lat, lon) ;

===
It works fine on variable with multiple level.
I speculate that NCL's dimension reduction that leads to the error.
===

Fortunately, there is a work-around:

Change:
   uwnd_practice  = short2flt(fil1->uwnd)              ; [time | 1460] x [level | 1] x [lat | 94] x [lon | 192]
to
   uwnd_practice  = short2flt(fil1->uwnd(:,0,:,:))   ; [time | 1460] x [lat | 94] x [lon | 192]

The result will be:

   uwnd_daily:       [time | 365] x [lat | 94] x [lon | 192]

On Thu, Apr 18, 2019 at 6:42 AM Barry Lynn <barry.h.lynn at gmail.com<mailto:barry.h.lynn at gmail.com>> wrote:
Hi:

Please see here -- the explanation of the error message might be of help.

https://www.ncl.ucar.edu/Document/Language/error_messages.shtml#AssignMismatch

On Thu, Apr 18, 2019 at 3:18 PM Nkese Mc Shine <Nkese.McShine at sta.uwi.edu<mailto:Nkese.McShine at sta.uwi.edu>> wrote:
Hi,
This line causes the error.

uwnd_daily    = calculate_daily_values(uwnd_practice, "avg", 0, opt)

Regards,
Nkese.

From: Barry Lynn <barry.h.lynn at gmail.com<mailto:barry.h.lynn at gmail.com>>
Sent: Thursday, April 18, 2019 8:16 AM
To: Nkese Mc Shine <Nkese.McShine at sta.uwi.edu<mailto:Nkese.McShine at sta.uwi.edu>>
Cc: ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
Subject: Re: [ncl-talk] Daily averages from 6 hourly data

Hello:

What line causes your error?

On Thu, Apr 18, 2019 at 2:52 PM Nkese Mc Shine <Nkese.McShine at sta.uwi.edu<mailto:Nkese.McShine at sta.uwi.edu>> wrote:
Good morning,

I have 6 hourly wind data and I am trying to get the daily averages however I am getting and error when I use calculate_daily_values. I have ncl 6.6.2 installed, can anyone help me? Below is the script used and the output.

Script:
fil1           = addfile("/media/wind/NCEP-DOE_Reanalysis_2/uwnd.10m.gauss.1979.nc<http://uwnd.10m.gauss.1979.nc>","r")
uwnd_practice  = short2flt(fil1->uwnd)


printVarSummary(uwnd_practice)
printMinMax(uwnd_practice, True)

opt           = True
opt at nval_crit = 4

uwnd_daily    = calculate_daily_values(uwnd_practice, "avg", 0, opt)
printVarSummary(uwnd_daily)
printMinMax(uwnd_daily, True)


Output:
Variable: uwnd_practice
Type: float
Total Size: 105400320 bytes
            26350080 values
Number of Dimensions: 4
Dimensions and sizes:    [time | 1460] x [level | 1] x [lat | 94] x [lon | 192]
Coordinates:
            time: [1569072..1577826]
            level: [10..10]
            lat: [88.542..-88.542]
            lon: [ 0..358.125]
Number Of Attributes: 19
  long_name :    6-Hourly Forecast of U-wind at 10 m
  unpacked_valid_range :    ( -120, 120 )
  actual_range :    ( -38.15, 46.84 )
  units :    m/s
  precision :    2
  least_significant_digit :    1
  GRIB_id :    33
  GRIB_name :    U GRD
  var_desc :    u-wind
  dataset :    NCEP/DOE AMIP-II Reanalysis (Reanalysis-2)
  level_desc :    10 m
  statistic :    Individual Obs
  parent_stat :    Other
  standard_name :    eastward_wind
  _FillValue_original :    -32767
  _FillValue :    -32767
  missing_value_original :    32766
  valid_range :    ( -120, 120 )
  missing_value :    -32767
(0)
(0)    6-Hourly Forecast of U-wind at 10 m (m/s) : min=-38.15   max=46.84

fatal:["NclVar.c":1390]:Assignment type mismatch, right hand side can't be coerced to type of left hand side
fatal:["NclAtt.c":262]:Attribute assignment type mismatch.

fatal:["Execute.c":8637]:Execute: Error occurred at or near line 19034 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl

fatal:["Execute.c":8637]:Execute: Error occurred at or near line 35 in file dailyaverages2.ncl


Regards,
Nkese.
CONFIDENTIALITY: This email (including any attachments) may contain confidential, proprietary and/or privileged information. Any duplication, copying, distribution, dissemination, transmission, disclosure or use in any manner of this email (including any attachments) without the authorisation of the sender is strictly prohibited. If you receive this email (including any attachments) in error, please notify the sender and delete this email (including any attachments) from your system. Thank you.
_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk


--
Barry H. Lynn, Ph.D
Senior Associate Scientist, Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
CONFIDENTIALITY: This email (including any attachments) may contain confidential, proprietary and/or privileged information. Any duplication, copying, distribution, dissemination, transmission, disclosure or use in any manner of this email (including any attachments) without the authorisation of the sender is strictly prohibited. If you receive this email (including any attachments) in error, please notify the sender and delete this email (including any attachments) from your system. Thank you.


--
Barry H. Lynn, Ph.D
Senior Associate Scientist, Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525

_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
CONFIDENTIALITY: This email (including any attachments) may contain confidential, proprietary and/or privileged information. Any duplication, copying, distribution, dissemination, transmission, disclosure or use in any manner of this email (including any attachments) without the authorisation of the sender is strictly prohibited. If you receive this email (including any attachments) in error, please notify the sender and delete this email (including any attachments) from your system. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190426/fdd62102/attachment.html>


More information about the ncl-talk mailing list