[ncl-talk] Time coordinate

Guilherme Martins jgmsantos at gmail.com
Sun Jun 19 22:30:19 MDT 2016


Hi Mary,

The code is right, the problem is I want to create the four variables ( "hus",
"water", "va", "ps" ) in a single file for each model. In my loop is being
written only the last variable ("ps"). The variables are being overwritten.
My final file contains only the last variable, ie, ps (my list of variables
=> var = (/ "hus", "water", "va", "ps" /)). I hope you understand me.

Thanks,

Guilherme.

Em seg, 20 de jun de 2016 às 01:19, Mary Haley <haley at ucar.edu> escreveu:

> Hi Guilherme,
>
> 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:
>
>          time := f->$nome_var(0)$
>          printVarSummary(time)         ; Check for valid "units" attribute
>          YYYYMM := cd_calendar(time,-1)
>
> You have this code in both the "if" and "else" parts of an "if" statement,
> so you must do this in both locations.
>
> 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.
>
> --Mary
>
>
>
> On Sat, Jun 18, 2016 at 1:15 PM, Guilherme Martins <jgmsantos at gmail.com>
> wrote:
>
>> Hi users,
>>
>> 1) I'm reading some netCDF files to interpolate and to fill missing
>> values.
>>
>> 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:
>>
>>
>> *fatal:cd_calendar: no 'units' attribute provided*
>> *fatal:["Execute.c":8575]:Execute: Error occurred at or near line 25 in
>> file 01limpa.CMIP5.ncl*
>>
>> I tried to use the time at units = "day since ..." but it doesn't work.
>>
>> 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.
>>
>> My script is in attachment.
>>
>> Any help is very apreciated.
>>
>> Cheers,
>>
>> Guilherme Martins.
>> --
>>
>> ------------------------------------------------------------------------------------------
>> Dr. Guilherme Martins
>> Instituto Nacional de Pesquisas Espaciais (INPE)
>> Centro de Previsão de Tempo e Estudos Climáticos (CPTEC)
>> Grupo de Desenvolvimento em Assimilação de Dados (GDAD)
>> Telefone (INPE/CP): +55 12 3186-8551 || Celular (TIM): +55 12 98152-8580
>> E-mail: guilherme.martins at inpe.br || jgmsantos at gmail.com
>> Skype: guilherme.martins.
>> Homepage: https://sites.google.com/site/jgmsantos
>> Currículo Lattes: http://lattes.cnpq.br/5997657584785803
>>
>> ------------------------------------------------------------------------------------------
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
> --
------------------------------------------------------------------------------------------
Dr. Guilherme Martins
Instituto Nacional de Pesquisas Espaciais (INPE)
Centro de Previsão de Tempo e Estudos Climáticos (CPTEC)
Grupo de Desenvolvimento em Assimilação de Dados (GDAD)
Telefone (INPE/CP): +55 12 3186-8551 || Celular (TIM): +55 12 98152-8580
E-mail: guilherme.martins at inpe.br || jgmsantos at gmail.com
Skype: guilherme.martins.
Homepage: https://sites.google.com/site/jgmsantos
Currículo Lattes: http://lattes.cnpq.br/5997657584785803
------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160620/0ab47938/attachment.html 


More information about the ncl-talk mailing list