<div dir="ltr"><div>Sorry for the very tardy reply on <b>360_day conversion to 365_day calendars</b>. <br></div><div><br></div><div>---<br></div><div>Another post on this same issue was sent to ncl-talk in <i>Feb 2019.</i></div><div>My recollection is that ncl-talk has previously had calendar 360-day to 365_day conversion questions. Also, the GrADS , NCO and CDO mail lists have had similar requests. <br></div><div><br></div><div><i></i></div><div>--- <br></div><div><i></i></div><div>The attached function [ "<b>calendar_convert_360_to_365_date</b>" ] works on <span style="color:rgb(0,0,255)"><b>daily data.</b></span> It has <span style="color:rgb(255,0,0)"><b>not</b></span> been extensively tested. There is no online NCL documentation with examples. Please read the documentation within the function. Note that <b>'linmsg_n</b>' is used rather that <b>'linint1_n</b>'</div><div><br></div><div><b>%></b> ncl GeethaR.360_to_365.ncl</div><div><br></div><div>I have placed a <b>source</b> 360-day file and the <b>derived</b> 365_day file at:</div><div><br></div><div>ftp <a href="http://ftp.cgd.ucar.edu" target="_blank">ftp.cgd.ucar.edu</a></div><div>anonymous</div><div>your_email</div><div>cd pub/shea</div><div>mget *nc</div><div>quit</div><div>---</div><div><br></div><div>The files are ~ 37.5 MB<br></div><div><br></div><div> 37629272 zg700_day_HadGEM2-ES_rcp85_r1i1p1_19800101-20131231_365day.nc<br> 37314184 zg700_day_HadGEM2-ES_rcp85_r1i1p1_19810101-20141231_360day.nc</div><div><br></div><div>---</div><div>I have also attached a test code to make sure it work s for 4D/3D/2D/1D variables.</div><div><br></div><div><b>%></b> ncl tst.360_to_365.ncl</div><div><br></div><div>I think it works! :-)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 20, 2019 at 5:25 AM Geetha R 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">Dear NCLers,<div> I am working on converting 360 days calendar to 365 days calendar. I have seen a discussion on the same topic with the title "<b>converting 360 day calendar to 365 day (standard) calendar</b>". The script shared in the topic is :</div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0)">f = addfile("zg700_day_HadGEM2-ES_rcp85_r1i1p1_19800101-20131231.nc","r")
var = f->zg
time_360 = var&time
lat = f->lat
lon = f->lon
plev = f->plev
printVarSummary(var)
time_steps = 34*365 ;1980 to 2013
time_365 = fspan(1,time_steps,time_steps)
time_365!0 = "time"
time_365&time = time_365
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">time_365 at standard_name</a> = "time"
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">time_365 at units</a> = "days since 1980-01-01 12:00:00"
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">time_365 at calendar</a> = "365_day"
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">time_365 at long_name</a> = "time"
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">time_365 at axis</a> = "T"
zg_new =linint1_n( time_360,rm_single_dims(var), False, time_365, 0,0)<br> zg_new!0 = "time"
zg_new&time = time_365
zg_new!1 = "lat"
zg_new&lat = lat
zg_new!2 = "lon"
zg_new&lon = lon
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">zg_new at _FillValue</a> = 1.0e+20
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">zg_new at missing_value</a> = 1.0e+20
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">zg_new at standard_name</a> = "geopotential_height"
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">zg_new at long_name</a> = "Geopotential Height"
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">zg_new at units</a> = "m"
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">zg_new at coordinates</a> = "lon lat plev"
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">zg_new at cell_methods</a> = "time: mean"
printVarSummary(zg_new)
outf = addfile("zg700_day_HadGEM2-ES_rcp85_r1i1p1_19800101-20131231_cal.nc","c")
outf->lat = lat
outf->lon = lon
outf->plev = plev
outf->zg = zg_new
</pre><div><div class="gmail-m_-8050821667012185561gmail-m_-1310243992043627965gmail-m_-5922341700169756340gmail-m_6978050108993212336gmail-m_-1131265100197371778gmail-message" style="color:rgb(51,51,51);font-family:Verdana,sans-serif;font-size:12px"><div class="gmail-m_-8050821667012185561gmail-m_-1310243992043627965gmail-m_-5922341700169756340gmail-m_6978050108993212336gmail-m_-1131265100197371778gmail-wiki"><p>In this code, the interpolation is done from the first day of the data that the netcdf with 365 days differs much when compared with the 360 days data. So, I thought that 5 days can be included at the end of each year. So, the interpolation can be started at 360th day and end at 361th day. I am new to ncl and may I know how to do this in ncl.</p></div></div><br class="gmail-m_-8050821667012185561gmail-m_-1310243992043627965gmail-m_-5922341700169756340gmail-m_6978050108993212336gmail-m_-1131265100197371778gmail-Apple-interchange-newline"></div><div>-- <br></div><div><div dir="ltr" class="gmail-m_-8050821667012185561gmail-m_-1310243992043627965gmail-m_-5922341700169756340gmail-m_6978050108993212336gmail-m_-1131265100197371778gmail_signature"><div dir="ltr">With Regards,<br><br><img src="http://reddodo.com/cellphones/wateroflife/?sesid=N0xOOTdjODNWUjlFdWdFWk9GV3VGZllGYlgvZnJXME1nUHFha0szbUVVR0JyQmRnWGhLdWVMR3ZsNFU4S3B4TA=="><br></div></div><br></div></div><img class="gmail-m_-8050821667012185561gmail-m_-1310243992043627965gmail-m_-5922341700169756340gmail-m_6978050108993212336gmail-m_-1131265100197371778mailtrack-img" alt="" style="display: flex;" src="https://mailtrack.io/trace/mail/c8fac399c453347e06f630723f99e441fda14d25.png?u=3398768" width="0" height="0"></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><br>
</blockquote></div>