Re: netCDF Creation problem

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue, 18 Jul 2006 12:44:32 -0600

Hi Hee-Jeong,

One other thing, you need to set :
filevardef (fout,"sf" ,typeof(sf) ,getvardims(sf))

before you call

filevarattdef(fout,"sf",sf)
Adam

David Ian Brown wrote:
> This looks as if the problem is simply that the file
> stream.trunc.grid.1978.nc
> already exists. The "c" create mode of addfile fails if the file already
> exists.
> Adding
>
> system("rm stream.trunc.grid."+fyr+".nc")
>
> prior to the addfile call should take care of the problem.
> -dave
> On Jul 18, 2006, at 11:55 AM, Adam Phillips wrote:
>
>> Hi all,
>>
>> Here is Hee-Jeong's error message and version number:
>>
>> The error message was
>> fatal:Could not create (stream.trunc.grid.1978.nc)
>> warning:FileSetFileOption: invalid file or format
>> fatal:Execute: Error occurred at or near line 64 in file test.ncl
>>
>> And I use NCAR Command Language Version 4.2.0.a033
>> Adam
>>
>> Hee-Jeong Baek wrote:
>>
>>> Hi,
>>> I tried to create netCDF file as same procedure in Application
>>> example of NCL homepage as follows.
>>> But I had error message and I don't know the reason.
>>> output file is stream function and its dimension is (time,lat,lon).
>>> Thank you for help in advance!
>>> Sincerely!
>>> Hee-Jeong
>>> ;************************************************
>>> ; outfile = stream function
>>> ;************************************************
>>> fout = addfile("stream.trunc.grid."+fyr+".nc","c")
>>> setfileoption(fout,"DefineMode",True)
>>> fileAtt = True
>>> fileAtt_at_creation_date = systemfunc("date")
>>> fileattdef(fout,fileAtt)
>>> dimNames = (/"time","lat","lon"/)
>>> dimSizes = (/nt,nlat,nlon/)
>>> dimUnlim = (/False,False, False/)
>>> filedimdef(fout,dimNames,dimSizes,dimUnlim)
>>> filevarattdef(fout,"sf",sf)
>>> filevardef (fout,"time",typeof(time),getvardims(time))
>>> filevardef (fout,"lat" ,typeof(lat) ,getvardims(lat))
>>> filevardef (fout,"lon" ,typeof(lon) ,getvardims(lon))
>>> filevardef (fout,"sf" ,typeof(sf) ,getvardims(sf))
>>> fout->time = (/time/)
>>> fout->lat = (/lat/)
>>> fout->lon = (/lon/)
>>> fout->sf = (/sf/)
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk_at_ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>> --
>> --------------------------------------------------------------
>> Adam Phillips asphilli_at_ucar.edu
>> National Center for Atmospheric Research tel: (303) 497-1726
>> ESSL/CGD/CAS fax: (303) 497-1333
>> P.O. Box 3000
>> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 18 2006 - 12:44:32 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 19 2006 - 08:40:45 MDT