<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">That’s my bad. The counter is only incremented 2 spaces instead of 3. So in your example it is decoding “-0” as the hours. I possibly only tested with day as the last number so never picked up on this. <div class=""><br class=""></div><div class="">For your example you could add an extra hyphen (any character but % will do) in the format after %J to bump the counter back into the correct position. </div><div class=""><br class=""></div><div class="">e.g.<div class="">print(cd_calendar(cd_inv_string("1980-001-05", "%Y-%J--%H"), 0))</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">or edit <span style="font-family: courier; font-size: 13.333333015441895px;" class="">$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_inv_string.ncl</span></div><div class="">line 117 should be:</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>strm = strm+3</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> Apologies all. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Alan</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 8 Sep 2017, at 13:26, Sojin Lee <<a href="mailto:noitul7@gmail.com" class="">noitul7@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Please see the below results.</div><div class=""><br class=""></div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_inv_string.ncl"</div><div class=""><br class=""></div><div class="">print(cd_calendar(cd_inv_string("1980-001-05", "%Y-%J-%H"), 0)) <br class=""></div><div class=""><br class=""></div><div class=""><div class="">Variable: unnamed (return)</div><div class="">Type: float</div><div class="">Total Size: 24 bytes</div><div class=""> 6 values</div><div class="">Number of Dimensions: 2</div><div class="">Dimensions and sizes:<span style="white-space:pre" class=""> </span>[1] x [6]</div><div class="">Coordinates: </div><div class="">Number Of Attributes: 2</div><div class=""> _FillValue :<span style="white-space:pre" class=""> </span>9.96921e+36</div><div class=""> calendar :<span style="white-space:pre" class=""> </span>standard</div><div class="">(0,0)<span style="white-space:pre" class=""> </span>1980</div><div class="">(0,1)<span style="white-space:pre" class=""> </span> 1</div><div class="">(0,2)<span style="white-space:pre" class=""> </span> 1</div><div class="">(0,3)<span style="white-space:pre" class=""> </span> 0 <--- ???</div><div class="">(0,4)<span style="white-space:pre" class=""> </span> 0</div><div class="">(0,5)<span style="white-space:pre" class=""> </span> 0</div></div><div class=""><br class=""></div><div class="">print(cd_calendar(cd_inv_string("1980-01-01-05", "%Y-%N-%D-%H"), 0)) </div><div class=""><br class=""></div><div class=""><div class="">Variable: unnamed (return)</div><div class="">Type: float</div><div class="">Total Size: 24 bytes</div><div class=""> 6 values</div><div class="">Number of Dimensions: 2</div><div class="">Dimensions and sizes:<span style="white-space:pre" class=""> </span>[1] x [6]</div><div class="">Coordinates: </div><div class="">Number Of Attributes: 2</div><div class=""> _FillValue :<span style="white-space:pre" class=""> </span>9.96921e+36</div><div class=""> calendar :<span style="white-space:pre" class=""> </span>standard</div><div class="">(0,0)<span style="white-space:pre" class=""> </span>1980</div><div class="">(0,1)<span style="white-space:pre" class=""> </span> 1</div><div class="">(0,2)<span style="white-space:pre" class=""> </span> 1</div><div class="">(0,3)<span style="white-space:pre" class=""> </span> 5 <--- It is ok...</div><div class="">(0,4)<span style="white-space:pre" class=""> </span> 0</div><div class="">(0,5)<span style="white-space:pre" class=""> </span> 0</div></div><div class=""><br class=""></div><div class="">It seems that cd_inv_string has some problems with Julian format. </div><div class=""><br class=""></div><div class="">Thank you,</div><div class=""><br class=""></div><div class="">Sojin</div></div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></div></div></body></html>