Re: Creating .nc files

From: Rosa Maria Nascimento dos Santos <rosasto_at_nyahnyahspammersnyahnyah>
Date: Wed, 18 Jul 2007 10:32:00 -0400 (AMT)

Hi Mary,

It's working! I'll just have to make some ajustments in "time" dimension
because it's showing only zeros, but the data are there!

Thanks again,

Rosa
P.S.: Can you tell me what is the dimension "tbnds" which appears when
using "ncdump" in .nc files?!

> Hi Rosa,
>
> Perhaps the files being written do are not being closed properly.
> Right before the very last "end do", try adding the line:
>
> delete(ncdf)
>
> Deleting the variable may force the file to close properly (Dave or
> Rick, let me know if I'm wrong on this). I can't imagine what
> else may be wrong.
>
> Also, you have some places in your script that you can clean up a
> little. It's not necessary to use ":" type syntax if you are using
> the whole variable. It is more expensive to use this syntax as well.
>
> Thus, lines like:
>
> latitude = f->lat(:)
> lon = f->lon(:)
> level=f->lev(:)
>
> Should be changed to:
>
> latitude = f->lat
> lon = f->lon
> level=f->lev
>
>
> Also:
>
> Q_sat(:,:,:,:) =
> 0.622*(sat_vap_pressure(:,:,:,:)/(pressure(:,:,:,:)-0.378*s\
> at_vap_pressure(:,:,:,:)))
>
> RH(:,:,:,:) = (spec_hum(:,:,:,:)/Q_sat(:,:,:,:))*100.0
>
> should be changed to:
>
> Q_sat = 0.622*(sat_vap_pressure/(pressure-0.378*sat_vap_pressure))
>
> RH = (spec_hum/Q_sat)*100.0
>
> Finally, the code:
>
> do j = 0, dimsizes(level)-1
> pressure(:,j,:,:) = level(j)
> end do
>
>
> can be rewritten using "conform":
>
> pressure = conform(pressure,level,1)
>
> Cheers,
>
> --Mary
>
>
> On Mon, 16 Jul 2007, Rosa Maria Nascimento dos Santos wrote:
>
>>
>> Hi,
>>
>> I'm still having problems creating .nc files with NCL! I've created the
>> file variables using "filevardef","filedimdef", and
>> "filevarattdef". The problem is that NCL is creating the file that I
>> want
>> but it isn't writing the variables into the file. That's weird! I'm
>> sending the script attached, if anyone could take a look at it?!
>>
>> Thanks,
>>
>> Rosa
>>
>> --
>> Rosa Maria Nascimento dos Santos
>> Doutora em Meteorologia
>> LBA/INPA
>> Tel: +55 92 36433623
>> e-mail: rosasto_at_inpa.gov.br
>> rosa_sto_at_yahoo.com
>>
>>
>>
>>
>>
>> --
>> Rosa Maria Nascimento dos Santos
>> Doutora em Meteorologia
>> LBA/INPA
>> Tel: +55 92 36433623
>> e-mail: rosasto_at_inpa.gov.br
>> rosa_sto_at_yahoo.com
>

-- 
Rosa Maria Nascimento dos Santos
Doutora em Meteorologia
LBA/INPA
Tel: +55 92 36433623
e-mail: rosasto_at_inpa.gov.br
        rosa_sto_at_yahoo.com
Received on Wed Jul 18 2007 - 08:32:00 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 18 2007 - 17:38:11 MDT