[ncl-talk] plotting monthly climatology form hourly data

Dennis Shea shea at ucar.edu
Fri Nov 8 13:24:53 MST 2019


I do not understand.

The patterns for the months are similar but the values are different.

If I made a mistake, you should debug.

D

On Fri, Nov 8, 2019 at 6:05 AM Setareh Rahimi <setareh.rahimi at gmail.com>
wrote:

> Dear Dennis,
> Thank you so much for your explanations and guidance. However, I noticed
> that the results for every year are similar to each other. Please have look
> at the attached files. This is not reasonable.  I see no problems in the
> script, so why this happened?
> Best wishes,
>
> On Fri, Nov 8, 2019 at 4:36 AM Dennis Shea <shea at ucar.edu> wrote:
>
>> The issue is the variable "time". This a subtle issue.
>>
>>   f        = *addfile*("khuzetan_DUST04.2000010100.nc", "r")
>>   time  = f->time
>>   timeb = f->time_bnds
>>
>>   ymdh_tag = *cd_calendar*
>> <http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml>(time
>>      ,-3)
>>   ymdh_Strt= *cd_calendar*
>> <http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml>(timeb(:,0),-3)
>> ; beginning time 'bound'
>>   ymdh_Last= *cd_calendar*
>> <http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml>(timeb(:,1),-3)
>> ; ending time 'bound'
>>
>>   print(timeb(:,0)+"  "+timeb(:,1)+"  "+time+"  " \
>>        +ymdh_Strt +"  "+ymdh_Last +"  "+ymdh_tag)
>> =============
>> One month of time values. Here 124 (31*4) January hours.
>>
>> (0)     timeb_0  timeb_1   time       ymdh_Strt    ymdh_Last
>> ymdh_tag
>>           439032  439038  439038  2000*010100*  2000*010106*  2000
>> *010106*
>> *                :            :             :
>> :                     :                    :*
>> (123) 439770  439776  439776  2000*013118*  2000*020100*  2000
>> *020100*
>> ===============
>>
>> *The last tag value [timeb(:,1)] for the month of JANUARY is FEBRUARY
>> !!!  *
>>
>> *My personal view is that this is not the appropriate time tag. *
>>
>> *Rather, the timeb(:,0)]  should be used. *
>> ================
>>
>> In a nutshell, the work-around is to reassign the time coordinate
>> associated with each variable.
>>
>>   timebnd = a[:]->time_bnds
>>   time0   = timebnd(:,0)                        ; extract the start bound
>>   [SNIP]
>>   x  = a[:]->emflx                     ; read emission flux from all files
>>   x&time = time0                     ; reassign original 'tag' time
>> [SNIP]
>>   u = b[:]->uas(:,0,:,:)              ; read U from all files
>>   u&time = time0                     ; reassign original 'tag' time
>>
>>   v = b[:]->vas(:,0,:,:)              ; read V from all files
>>   v&time = time0                     ; reassign original 'tag' time
>>
>> =========
>> Comments:
>> [0] You MUST examine the time variable more carefully.
>>       Using yyyymmdd start/stop dates is not appropriate for yyyymmddhh.
>> [1] You do *not *have to compute the daily mean values
>> [2] *calculate_monthly_values*
>> <http://www.ncl.ucar.edu/Document/Functions/Contributed/calculate_monthly_values.shtml>
>> will accept 6-hrly data
>> [3] *http://www.ncl.ucar.edu/Applications/rcm.shtml*
>> <http://www.ncl.ucar.edu/Applications/rcm.shtml>
>> Examples 5,6,7: illustrate how to plot variables for the Regional Climate
>> Model (RCM).
>> =========
>> See Attached
>>
>>
>> On Thu, Nov 7, 2019 at 6:10 AM Setareh Rahimi via ncl-talk <
>> ncl-talk at ucar.edu> wrote:
>>
>>> Dear all,
>>>
>>> I need to plot the monthly average from a model output, which gives me
>>> 4times data per day( at 00, 06,12,18). So I first need to convert hourly
>>> data tp daily data and then convert to monthly. And finally calculates the
>>> climatology average of those monthly data from 2000-2014.
>>> However, once I ran my script I faced some error:
>>> 1. I did not have data for 2015, but when using print (yyyymmdd)   year
>>> 2015 printed. ( please have a look at the attachment number 1)
>>> 2. After reading variable x this warning comes up: Aggregated dimension
>>> coordinate values are non-monotonic; check aggregated file ordering
>>> (warning attached)
>>> 3. Once using clmMonTLL function ( available on :
>>> https://www.ncl.ucar.edu/Applications/Scripts/climo_3.ncl), NCL tells
>>> that :  clmMonTLL: dimension must be a multiple of 12 . I just wonder
>>> why this happened. I used 15 years with 12 months for each year!! (
>>> attached)
>>> I attached the script and data for the year 2000. Could you please
>>> kindly guide me what are my mistakes?
>>> Best wishes,
>>>  str.zip
>>> <https://drive.google.com/file/d/12-n6pQ4JF6nwIRBVW4iaTKaznfP1FGet/view?usp=drive_web>
>>>
>>> --
>>> S.Rahimi
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> --
> S.Rahimi
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191108/4eb75c3c/attachment.html>


More information about the ncl-talk mailing list