<div dir="ltr">Thanks Dennis. <div><br></div><div>I was able to patch together the GFS data from hours 0 to 384 (including an additional 6 hours from previous day run), and put cloud percentages into hourly values. For anyone that also might need this, here's my approach: </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:Menlo;font-size:9pt">cloud = new ( (/nHours, nLat, nLon /) , "float" )<br><br>cloud(0,:,:) = f[1]->TCDC_P8_L10_GLL0_avg(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(1:5,:,:) = f[1:5]->TCDC_P8_L10_GLL0_avg(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(6,:,:) = f[7]->TCDC_P8_L10_GLL0_avg(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(7:12,:,:) = f[7:12]->TCDC_P8_L10_GLL0_avg(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(13:121:6,:,:) = f[13:121:6]->TCDC_P8_L10_GLL0_avg1h(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(14:122:6,:,:) = f[14:122:6]->TCDC_P8_L10_GLL0_avg2h(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(15:123:6,:,:) = f[15:123:6]->TCDC_P8_L10_GLL0_avg3h(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(16:124:6,:,:) = f[16:124:6]->TCDC_P8_L10_GLL0_avg4h(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(17:125:6,:,:) = f[17:125:6]->TCDC_P8_L10_GLL0_avg5h(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(18:126:6,:,:) = f[18:126:6]->TCDC_P8_L10_GLL0_avg6h(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(127:213:2,:,:) = f[127:213:2]->TCDC_P8_L10_GLL0_avg3h(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br>cloud(128:214:2,:,:) = f[128:214:2]->TCDC_P8_L10_GLL0_avg6h(:,{latNGFS:latSGFS},{lonWGFS:lonEGFS})<br><br>do i=0,nHours-1<br>    if (i .eq. 0 .or. i .eq. 6) then<br>        cloud(i,:,:) = cloud(i,:,:)<br>    elseif (i .lt. 126) then<br>        if ( i % 6 .eq. 1) then<br>            cloud(i,:,:) = cloud(i,:,:)<br>        elseif (i % 6 .eq. 2) then<br>            c2 = 2 * cloud(i,:,:)<br>            cloud(i,:,:) = c2 - cloud(i-1,:,:)<br>        elseif (i % 6 .eq. 3) then<br>            c3 = 3 * cloud(i,:,:)<br>            cloud(i,:,:) = c3 - c2<br>        elseif (i % 6 .eq. 4) then<br>            c4 = 4 * cloud(i,:,:)<br>            cloud(i,:,:) = c4 - c3<br>        elseif (i % 6 .eq. 5) then<br>            c5 = 5 * cloud(i,:,:)<br>            cloud(i,:,:) = c5 - c4<br>        elseif (i % 6 .eq. 0) then<br>            c6 = 6 * cloud(i,:,:)<br>            cloud(i,:,:) = c6 - c5<br>        end if<br>    else<br>        if ( i % 6 .eq. 3) then<br>            cloud(i,:,:) = cloud(i,:,:)<br>        elseif ( i % 6 .eq. 0) then<br>            cloud(i,:,:) = 2 * cloud(i,:,:) - cloud(i-1,:,:)<br>        end if<br>    end if<br>end do</pre></blockquote><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 3, 2020 at 2:40 PM Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I am sure there is no 'handy-dandy' function to do this specific task.</div><div>I ould think it would 'easy' to create a function to do this</div><div><br></div><div>undef("gfs_micah")</div><div>function gfs_micha(x)</div><div>begin</div><div>   ...</div><div>   return(xhour)<br></div><div>end</div><div>;--------------------</div><div>;    MAIN</div><div>;--------------------</div><div>   dir_gfs = "./"<br></div><div>   pth_gfs  =  <strong>systemfunc</strong>("ls "+dir_gfs+"/gfs*")</div><div>   n_gfs   = <b>dimsizes(</b>pth_gfs)</div><div>   print("n_gfs="+n_gfs)<br></div><div><pre>  f_gfs = <b>addfiles</b>(pth_gfs, "r")<br>  cld = f_gfs[:]->...<br>  <b>printVarSummary</b>(cld)<br></pre><pre>  CLD = <span style="color:rgb(0,0,255)"><b>gfs_micah</b></span>(cld)<br>  printVarSummary(CLD)<br></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 3, 2020 at 11:45 AM Micah Sklut via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi, <div><br></div><div>I am looking at Cloud Cover values for GFS data. I download the GFS files for each individual hour, and for each hour the cloud cover represents a fraction of a 6 hour period, like this: </div><div><br></div><div>hour 1: 0-1 hour average</div><div>hour 2: 0-2 hour average</div><div>hour 3: 0-3 hour average</div><div>hour 4: 0-4 hour average</div><div>hour 5: 0-5 hour average</div><div>hour 6: 0-6 hour average</div><div><br></div><div>I would like to convert this to: </div><div><br></div><div><div>hour 1: 0-1 hour average</div><div>hour 2: 1-2 hour average</div><div>hour 3: 2-3 hour average</div><div>hour 4: 3-4 hour average</div><div>hour 5: 4-5 hour average</div><div>hour 6: 5-6 hour average</div></div><div><br></div><div>I understand it's just some simple arithmetic to get the averages of the values for each hour, but I was wondering if there are any handy NCL functions that can help me efficiently go through the global dataset for hours 0 - 384.  </div><div><br></div><div>I did notice there was a wgrib2 function to handle this problem but was hoping to handle this through NCL, where all my other files/variable modifications are happening. </div><div><br></div><div>Thanks, </div><div><div><br></div>-- <br><div dir="ltr">Micah Sklut<br><br></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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></blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Micah Sklut<br><br></div>