<div dir="ltr">Hi:<div><br></div><div>I have a student who must use python.</div><div><br></div><div>I've been trying to find out how to extract WRF times in a way that can be used in python. In the end, we need to format the dates like I already did (and did for years) in NCL.</div><div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(243,243,243)">times</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>= wrf_user_getvar(a,"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)">times</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><span style="background-color:rgb(255,255,255)">"</span>,-1)</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font:18px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>new_time_units = "hours since 1800-01-01 00:00"</span></p><p class="gmail-p1" style="margin:0px;font:18px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>new_time_units = new_time_units</span></p><p class="gmail-p1" style="margin:0px;font:18px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>new_time_array = cd_inv_calendar( </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(255,255,255)">year</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">(it_val),<span class="gmail-Apple-converted-space">  </span>month(it_val), day(it_val), \</span></p><p class="gmail-p1" style="margin:0px;font:18px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>hour(it_val), minute(it_val), 0, new_time_units,0)</span></p><p class="gmail-p2" style="margin:0px;font:18px Menlo;color:rgb(0,0,0);min-height:21px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p><p class="gmail-p1" style="margin:0px;font:18px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">; print("new_time_array = " + new_time_array)</span></p><p class="gmail-p1" style="margin:0px;font:18px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">; format = "" ;; defaults to "%H%M IST %d %c %Y"</span></p><p class="gmail-p1" style="margin:0px;font:18px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>format = "%H%M UTC %d %c %Y"</span></p><p class="gmail-p1" style="margin:0px;font:18px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">; format = "%d %c %Y"</span></p><p class="gmail-p1" style="margin:0px;font:18px Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>new_time_array = new_time_array<span class="gmail-Apple-converted-space">  </span>+ 0.01</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures">















</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>time_var=cd_string(new_time_array,format)</span></p><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br></div><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior <font color="#000000">Scientist, Lecturer,</font></div><div><div><font color="#000000">The Institute of Earth Sciences, <br>The Hebrew University of Jerusalem, <br>Givat Ram, Jerusalem 91904, Israel <br></font></div><font color="#000000">Tel: 972 547 231 170<br>Fax: (972)-25662581</font></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">https://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br><br></div></div></div></div></div></div></div>