<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Guilherme,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The error message is indicating that that units of "time" are not set right before you call cd_calendar. You said that you did explicitly set this, but I can't tell from looking at the code how you did this. You need to look at your "time" array every time in the loop, using "printVarSummary" to verify whether or not you have the expected "units" attribute:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"> time := f->$nome_var(0)$</div><div class="gmail_default"> printVarSummary(time) ; Check for valid "units" attribute</div><div class="gmail_default"> YYYYMM := cd_calendar(time,-1)</div><div class="gmail_default"><br></div><div class="gmail_default">You have this code in both the "if" and "else" parts of an "if" statement, so you must do this in both locations.</div><div class="gmail_default"><br></div><div class="gmail_default">For your second question, you didn't indicate exactly what the problem is. Are you getting an error of any kind? Does the file simply not exist after you run the script? Please be explicit. Your code looks correct to me, but without being able to run it, or knowing if there are any errors, it's hard to help.</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 18, 2016 at 1:15 PM, Guilherme Martins <span dir="ltr"><<a href="mailto:jgmsantos@gmail.com" target="_blank">jgmsantos@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi users,<div><br></div><div><div><div>1) I'm reading some netCDF files to interpolate and to fill missing values.</div><div><br></div><div>The first model it's ok, but the others I don't know why the reason it don't work. I get the following message error:</div></div></div><div><br></div><div><b><span style="line-height:1.5">fatal:cd_calendar: no 'units' attribute provided</span><br></b></div><div><div><b>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 25 in file 01limpa.CMIP5.ncl</b></div></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">I tried to use the time@units = "day since ..." but it doesn't work.</span><br></div><div><br></div><div>2) Other question, I want to write the four variables ("hus","ua","va","ps") in same netCDF file for each model, but I'm not capable to do that.<br></div><div><br></div><div>My script is in attachment.</div><div><br></div><div>Any help is very apreciated.</div><div><br></div><div>Cheers,</div><div><br></div><div>Guilherme Martins.</div></div><span class="HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><div><font size="2"><div>------------------------------------------------------------------------------------------</div><div>Dr. Guilherme Martins</div><div>Instituto Nacional de Pesquisas Espaciais (INPE)<br></div></font></div><div><font size="2">Centro de Previsão de Tempo e Estudos Climáticos (CPTEC)<br></font>Grupo de Desenvolvimento em Assimilação de Dados (GDAD)<font size="2"><br></font></div><div>Telefone (INPE/CP): <a href="tel:%2B55%2012%203186-8551" value="+551231868551" target="_blank">+55 12 3186-8551</a> || Celular (TIM): <a href="tel:%2B55%2012%2098152-8580" value="+5512981528580" target="_blank">+55 12 98152-8580</a><br>E-mail: <a href="mailto:guilherme.martins@inpe.br" target="_blank">guilherme.martins@inpe.br</a> || <a href="mailto:jgmsantos@gmail.com" target="_blank">jgmsantos@gmail.com</a><br>Skype: guilherme.martins.<br>Homepage: <a href="https://sites.google.com/site/jgmsantos" target="_blank">https://sites.google.com/site/jgmsantos</a><br>Currículo Lattes: <a href="http://lattes.cnpq.br/5997657584785803" target="_blank">http://lattes.cnpq.br/5997657584785803</a><span><br></span>------------------------------------------------------------------------------------------</div></div></div>
</font></span><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></blockquote></div><br></div>