<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">Hi Dennis Shea, Mr. Ndiaye and all,<br><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">That helped to compute daily mean, but I till have have two more issues.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">1. From that daily mean, I tried to compute the annual mean [T=new((/365,ncell/), float)], but the problem is that all years don't have the same number of days, some have 365 days and other have 366 days. How to solve this issue from daily data "xStat"?<br><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">2. I want to get indexes of the variations within 24 hours, but not for all 24h. I wrote like this:<br> <span style="color:rgb(0,0,255)"> time@units = "seconds since 1970-01-01 00:00:00"<br> dates = cd_calendar(time, 0)<br><br>index=ind(dates(:,3) .ge. 8 .and. dates(:,3) .le. 12 .and. dates(:,3) .ge. 18 .and. dates(:,3) .le. 23 .and. T(:) .ne. T@_FillValue)<br><br> if (.not.any(ismissing(index)) .and. dimsizes(index) .ge. 2) then<br> <br> T0=T(index)<br></span></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><span style="color:rgb(0,0,255)"> end if<br></span></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><span style="color:rgb(0,0,255)"><span style="color:rgb(0,0,0)"><br></span></span></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><span style="color:rgb(0,0,255)"><span style="color:rgb(0,0,0)">Or </span><br></span><br><span style="color:rgb(0,0,255)"><span style="color:rgb(0,0,255)">index1=ind(dates(:,3) .ge. 8 .and.
dates(:,3) .le. 12
.and. T(:) .ne. T@_FillValue)</span><br></span><br><span style="color:rgb(0,0,255)">index2=ind(dates(:,3) .ge. 18 .and. dates(:,3) .le. 23
.and. T(:) .ne. T@_FillValue)<br><br> </span><span style="color:rgb(0,0,255)"> if (.not.any(ismissing(index1)) .and. .not.any(ismissing(index2))) then <br><br> </span><span style="color:rgb(0,0,255)">T0=T<br><br></span></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><span style="color:rgb(0,0,255)"> end if <br><br></span></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><span style="color:rgb(0,0,255)"><font color="#000000">What is the best way to get the indexes of [8-12h] and [18-23] </font></span><span style="color:rgb(0,0,255)"><font color="#000000">within 24h?<br><br></font></span></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><span style="color:rgb(0,0,255)"><font color="#000000">Best<br></font></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 August 2015 at 13:52, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You do not need to get data into a (time, lev, lat, lon) array.<br>
Also, your data are not in a 'rectangular' structure. The 'cells' are<br>
station data. The array is 'unstructured'<br>
<br>
===<br>
UNTESTED ... That is *your* responsibility. Please think about each step.<br>
===<br>
x = f->air_temperature<br>
printVarSummary(x)<br>
<br>
dimx = dimsizes(x)<br>
ntim = dimx(0)<br>
ncell = dimx(1)<br>
<br>
nstep = 24 ; # of time steps/day<br>
ndim = 0 ; 'time' is the 0-th dimension<br>
<br>
NTIM = ntim/nstep ; # of days<br>
xStat = new ( (/NTIM,ncell/), typeof(x), getFillValue(x))<br>
<br>
do n=0,ntim-1,nstep<br>
xStat(n/nstep,:) = dim_avg_n( x(n:n+nstep-1,:), ndim)<br>
end do<br>
<br>
xStat!0 = "time"<br>
xStat&time = time(::nstep)<br>
xStat!1 = "ncells"<br>
xStat@long_name = "daily mean temperature"<br>
xStat@units = x@units<br>
<br>
printVarSummary(xStat)<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Aug 12, 2015 at 6:23 AM, ousmane ndiaye <<a href="mailto:ondiaye70@gmail.com">ondiaye70@gmail.com</a>> wrote:<br>
> use reshape function<br>
> <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/reshape.shtml" rel="noreferrer" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/reshape.shtml</a><br>
> ousmane<br>
><br>
> On Wed, Aug 12, 2015 at 11:51 AM, Amadou Coulibaly <<a href="mailto:mpapin24@gmail.com">mpapin24@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi NCL users,<br>
>><br>
>> I have hourly data for 10 years. I want to compute long term daily mean<br>
>> (daily climatology) of the variable "temp=air_temperature". But my variable<br>
>> "temp" is in form:<br>
>><br>
>> Variable: temp<br>
>> Type: float<br>
>> Total Size: 48390528 bytes<br>
>> 12097632 values<br>
>> Number of Dimensions: 2<br>
>> Dimensions and sizes: [time | 262992] x [ncells | 46]<br>
>> Coordinates:<br>
>> time: [410227200..1356994800]<br>
>> Number Of Attributes: 7<br>
>> _FillValue : 9.96921e+36<br>
>> units : K<br>
>> code : 11<br>
>> shortname : ta<br>
>> comment : Air temperature is the bulk temperature of the air, not the<br>
>> surface (skin) temperature.<br>
>> grid_type : unstructured<br>
>> coordinates : lon lat<br>
>><br>
>> How to change "temp" into temp(time,lev,lat,lon)? So that I can get daily<br>
>> mean.<br>
>><br>
>> Or is there any other ways to do it?<br>
>><br>
>> Variable is from:<br>
>><br>
>> Variable: infile<br>
>> Type: file<br>
>> filename: fil<br>
>> path: /home/amadou/NCL/<a href="http://fil.nc" rel="noreferrer" target="_blank">fil.nc</a><br>
>> file global attributes:<br>
>> dimensions:<br>
>> ncells = 46<br>
>> nchar = 20<br>
>> time = 262992<br>
>> variables:<br>
>> double time ( time )<br>
>> units : seconds since 1970-01-01 00:00:00<br>
>> standard_name : time<br>
>><br>
>> float lat ( ncells )<br>
>> units : degrees_north<br>
>> standard_name : latitude<br>
>> long_name : latitude<br>
>><br>
>> float lon ( ncells )<br>
>> units : degrees_east<br>
>> standard_name : longitude<br>
>> long_name : longitude<br>
>><br>
>> character station_id ( ncells, nchar )<br>
>> comment : WMO or GHCN number of the station<br>
>><br>
>> float air_temperature ( time, ncells )<br>
>> _FillValue : 9.96921e+36<br>
>> units : K<br>
>> code : 11<br>
>> shortname : ta<br>
>> comment : Air temperature is the bulk temperature of the air,<br>
>> not the surface (skin) temperature.<br>
>> grid_type : unstructured<br>
>> coordinates : lon lat<br>
>><br>
>> Is there anyone who can help me?<br>
>> Best regards<br>
>><br>
>> --<br>
>> COULIBALY AMADOU<br>
>> PhD Student on West African Climate System (WACS)<br>
>> FUTA - Federal University of Technology of Akure, Nigeria<br>
>><br>
>> Visiting Student - University of Cologne, Germany<br>
>> Institute of Geophysics and Meteorology<br>
>> Pohligstr. 3 / Office 3.102<br>
>> D-50969 Köln<br>
>><br>
>> Project: WASCAL (West African Science Service Centre on Climate Change and<br>
>> Adapted Land Use)<br>
>> Phone:(+234) 810 795 2836 /(+223) 65 67 27 57 /(+226) 64 57 37 27 /+49<br>
>> 15218352574<br>
>><br>
>> E-mail: <a href="mailto:mpapin24@gmail.com">mpapin24@gmail.com</a> / <a href="mailto:coulibalya68@yahoo.com">coulibalya68@yahoo.com</a><br>
>><br>
>> "The time is always right to do right": Nelson Mandela<br>
>><br>
>> "Character is like a tree and reputation like a shadow. The shadow is<br>
>> what we think of it; the tree is the real thing" : Abraham Lincoln<br>
>><br>
>> "Do what you can, with what you have, where you are" Theodore Roosevelt<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> ncl-talk mailing list<br>
>> <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
>> List instructions, subscriber options, unsubscribe:<br>
>> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> ncl-talk mailing list<br>
> <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
> List instructions, subscriber options, unsubscribe:<br>
> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><b style="font-size:small;font-family:tahoma,sans-serif"><font color="#000066"> </font><font color="#000066">COULIBALY </font><font color="#000066">AMADOU </font></b><br><span style="color:rgb(0,0,102);font-family:tahoma,sans-serif;font-size:small">PhD Student on West African Climate System (WACS)</span><br><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">FUTA</font><font style="font-size:small;font-family:tahoma,sans-serif" color="#000066"> - </font><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">F</font><font style="font-size:small;font-family:tahoma,sans-serif" color="#000066">ederal </font><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">U</font><font style="font-size:small;font-family:tahoma,sans-serif" color="#000066">niversity of </font><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">T</font><font style="font-size:small;font-family:tahoma,sans-serif" color="#000066">echnology of </font><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">A</font><font style="font-size:small;font-family:tahoma,sans-serif" color="#000066">kure, Nigeria</font><div><font color="#000066" face="tahoma, sans-serif" size="2"><br></font><div><span style="color:rgb(76,17,48)"><span style="font-family:arial,helvetica,sans-serif"><i style="font-weight:bold">Visiting Student - </i></span><i style="font-weight:bold"><span style="font-family:arial,helvetica,sans-serif"><i><font size="1"><span style="font-size:13px">University of Cologne, Germany</span></font></i></span><br></i><i><span style="font-family:arial,helvetica,sans-serif">Institute of Geophysics and Meteorology</span></i><span style="font-family:arial,helvetica,sans-serif"><br></span></span><div style="letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:rgb(76,17,48)"><span style="font-family:arial,helvetica,sans-serif"><font size="1">Pohligstr. 3 / Office 3.102</font></span></span></div><div style="letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:rgb(76,17,48)"><span style="font-family:arial,helvetica,sans-serif"><font size="1">D-50969 Köln</font></span></span></div></div></div><div style="color:rgb(80,0,80)"><i style="color:rgb(34,34,34);font-family:'bookman old style','new york',times,serif"><font size="1"><span style="color:rgb(0,0,127)"><span style="font-size:13px"><br></span></span></font></i></div><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)"><u>Project</u>: </span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">WASCAL</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)"> (</span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">W</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)">est </span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">A</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)">frican </span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">S</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)">cience </span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">S</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)">ervice </span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">C</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)">entre on </span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">C</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)">limate </span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">C</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)">hange and </span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">A</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)">dapted </span><font style="font-size:small;font-family:tahoma,sans-serif" color="#0000ff">L</font><span style="font-size:small;font-family:tahoma,sans-serif;color:rgb(0,0,102)">and Use) </span><br><font style="font-family:tahoma,sans-serif;font-size:small;color:rgb(0,0,102)" color="#000066">Phone:(+234) 810 795 2836 </font><font style="font-family:tahoma,sans-serif;font-size:small" color="#ff0000">/</font><font style="font-family:tahoma,sans-serif;font-size:small;color:rgb(0,0,102)" color="#000066">(+223) 65 67 27 57 </font><font style="font-family:tahoma,sans-serif;font-size:small" color="#ff0000">/</font><font style="font-family:tahoma,sans-serif;font-size:small;color:rgb(0,0,102)" color="#000066">(+226) 64 57 37 27 </font><font style="font-size:small;font-family:tahoma,sans-serif" color="#000066"><span style="color:rgb(34,34,34)"></span><font color="#ff0000">/</font></font><font style="font-family:tahoma,sans-serif;font-size:small;color:rgb(0,0,102)" color="#000066">+49 15218352574<br></font><div><p><font style="font-size:small;font-family:tahoma,sans-serif" color="#000066"></font></p><div style="text-align:left"><font style="font-size:small;font-family:tahoma,sans-serif" color="#000066"><font color="#000066">E-mail: </font><a href="mailto:mpapin24@gmail.com" style="color:rgb(0,0,255)" target="_blank">mpapin24@gmail.com</a><span style="color:rgb(34,34,34)"> </span><font color="#ff0000">/ </font><span style="color:rgb(0,0,255)"><a href="mailto:coulibalya68@yahoo.com" target="_blank">coulibalya68@yahoo.com</a> </span></font></div><p></p></div><div><font face="verdana,sans-serif" size="2"><p><font color="#ff9900">"<i>The time is always right to do right": <b>Nelson Mandela</b></i></font></p><p><i><font color="#ff9900">"Character is like a tree and reputation like a shadow. The shadow is what we think of it; the tree is the real thing" : <b>Abraham Lincoln</b></font></i></p><p><i><font color="#ff9900">"Do what you can, with what you have, where you are" <b>Theodore Roosevelt</b></font></i></p></font><p><b><font color="#000066" size="2"><i> </i></font></b></p><p><b><font color="#000066" size="4"> </font></b></p><div> </div></div></div></div>
</div>