Re: creating .nc file variables

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 12 Jul 2007 18:33:04 -0600 (MDT)

Ola Rosa,

[1] Please see "Methgod 2 (efficient method)" at
    http://www.ncl.ucar.edu/Applications/o-netcdf.shtml

    If you use the efficeient approach to write netCDF,
    Then use the (/ ... /) when writing the values
    to netCSF.

[2] I *speculate* that you defined a variable to be of type
    float yet the variable is double.

[3] Do not use (:), (:,:,:), (:,:,:,:) just use the
    variable name. It is more efficient.

[4] I will send u script is a separate email.

Good luck
D
 

On Thu, 12 Jul 2007, Rosa Maria Nascimento dos Santos wrote:

> Hi Mary,
>
> Thanks a lot for your help!
>
> I did what you told me and it worked. It's accepting and creating the new
> file, but it's not writing the variables into it! Now it's giving the
> following message:
>
> ncvarput: ncid 12: Not a netCDF data type or _FillValue type mismatch
> fatal:NetCdf: An error occurred while attempting to write variable (psnm)
> to file (GBRAMS-6-hourly_1980-02_all-var-old_00.nc)
> fatal:Execute: Error occurred at or near line 143 in file read_brams.ncl
>
> PROGRAM LINES:
> 142;**** Writing in "nc" files
> 143 ncdf->psnm = pnmm
> 144 ncdf->uvel = uu
> 145 ncdf->vvel = vv
> 146 ncdf->zgeo = ageo
> 147 ncdf->temp = temp
> 148 ncdf->umrl = RH
>
>
> I've tryed to change the way of calling the variables but it didn't work
> either!
>
> Thanks again!
>
> Rosa
> P.S.: The program file is attached!
>
>
> >
> > Hi Rosa,
> >
> > You will get the "Could not create..." fatal message from NCL if you are
> trying to create a netCDF file that already exists in your
> > directory.
> >
> > If you are okay with removing the file before you create it, then you
> can do something like:
> >
> > ncdf_filename = "GBRAMS-"+files_in(i)
> > if(isfilepresent(ncdf_filename)) then
> > system("/bin/rm " + ncdf_filename)
> > end if
> > ncdf = addfile(ncdf_filename,"c")
> >
> > --Mary
> >
> >
> >> On Jul 12, 2007, at 3:05 PM, Rosa Maria Nascimento dos Santos wrote:
> >>
> >>> Hi,
> >>> I'm begginnig to use NCL, trying to create a .nc file and when I try to
> > write the new variables to the file it's showing an error message (see
> > the
> >>> message in the end of this e-mail and the .ncl file attached). I don't
> > know what am I doing wrong?!
> >>> Could someone help me with it?!
> >>> Thanks,
> >>> Rosa
> >>> ERROR MESSAGE:
> >>> fatal:Could not create (GBRAMS-6-hourly_1980-02_all-var-old_00.nc)
> > fatal:Execute: Error occurred at or near line 117 in file
> >>> read_brams.ncl
> >>> PROGRAM LINES:
> >>> ;**** Creating output file
> >>> ncdf=addfile("GBRAMS-"+files_in(i),"c")
> >>> var4D_names=(/"uvel","vvel","zgeo","temp","umrl"/)
> >>> var4D_dims=(/"time","lev","lat","lon"/)
> >>> var4D_types=(/"float","float","float","float","float"/)
> >>> vardims=dimsizes(temp)
> >>> filedimdef(ncdf,var4D_dims,vardims,(/True,False,False,False/))
> > filevardef(ncdf,var4D_names,var4D_types,var4D_dims)
> >>> filevardef(ncdf,"psnm",typeof(pnmm),(/"time","lat","lon"/))
> >>> filevarattdef(ncdf,"psnm",pnmm)
> >>> filevarattdef(ncdf,"uvel",uu)
> >>> filevarattdef(ncdf,"vvel",vv)
> >>> filevarattdef(ncdf,"zgeo",ageo)
> >>> filevarattdef(ncdf,"temp",temp)
> >>> filevarattdef(ncdf,"umrl",RH)
> >>> --
> >>> 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
> >>> <read_brams.ncl>_______________________________________________
> > ncl-talk mailing list
> >>> ncl-talk_at_ucar.edu
> >>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>
> >>
> >
> >
> > --
> > 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
> >
> >
> >
> >
> >
>
>
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 12 2007 - 18:33:04 MDT

This archive was generated by hypermail 2.2.0 : Tue Jul 17 2007 - 06:52:01 MDT