Re: file error from write_matrix

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Thu, 03 Jan 2008 11:01:29 -0700

Bryan,

I think it might be the tilde at the start of your filename. The
Unix command interpreter knows what to do with it; IIRC, in general
NCL and other languages do not. I have fallen into this trap myself
at times. ;-)

Other possibilities are misspelling in path (check carefully);
missing lower level directory; missing write permission for
directory; previous file with same name exists. HTH.

Dave Allured
CU/CIRES Climate Diagnostics Center (CDC)
http://cires.colorado.edu/science/centers/cdc/
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
http://www.cdc.noaa.gov/

Bryan K Woods wrote:
> Hi everyone,
>
> I am trying to write a 2D matrix to an ASCII file but am encountering
> some sort of file related error. When I print the matrix to the screen,
> it seems to work as expected. However, I get an error when I try to
> print to file.
>
> Here is a snippet of my code:
>
> print("Compiling summary...")
>
> ;put data into object to be written to ASCII file
> data = transpose((/ fltnum, st, et, et-st, av_palt, av_p, av_ws, av_wd,
> av_trk, av_wi, av_xo3, av_galt, \
> av_T, av_rho, mx_wi, mn_wi, mx_theta, mn_theta, mx_palt,
> mn_palt, MFx, MFy, \
> EF, av_Bern, Kh, Kz, O3flux, mx_pdEta, mn_pdEta, PE, KEhp,
> av_uA, av_vA /))
> datadim = dimsizes(data) print("Saving data info summary...")
> printVarSummary(data)
>
> fmtx = datadim(0)+"f12.4"
> opt = True
> opt_at_title = "fltnum, st, et, et-st, av_palt, av_p, av_ws, av_wd,
> av_trk, av_wi, av_xo3, av_galt, av_T, av_rho, mx_wi, mn_wi, mx_theta,
> mn_theta, mx_palt, mn_palt, MFx, MFy, EF, av_Bern, Kh, Kz, O3flux,
> mx_pdEta, mn_pdEta, PE, KEhp, av_uA, av_vA"
> opt_at_fout = dirt+"summary.table"
> write_matrix (data, fmtx,opt)
> delete(data)
> print("done matrix write")
>
> And this is the error I get back:
>
> (0) Compiling summary...
> (0) Saving data info summary...
>
>
> Variable: data
> Type: double
> Total Size: 83952 bytes
> 10494 values
> Number of Dimensions: 2
> Dimensions and sizes: [dim1 | 318] x [dim0 | 33]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : -999
> open: No such file or directory
> apparent state: unit 31 named ~/trex/charts/gv_stats/summary.table
> lately writing direct unformatted external IO
> Abort
>
>
> Does this indicate that it has a problem because the file does not
> already exist? I tried a system call to touch the file first and later
> tried one to likewise delete it, but neither seem to help. Thanks for
> your help!
>
> Bryan
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jan 03 2008 - 11:01:29 MST

This archive was generated by hypermail 2.2.0 : Mon Jan 07 2008 - 11:19:46 MST