Re: write_matrix file name

From: Isabella Bovolo <Isabella.Bovolo_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 12 2009 - 12:01:48 MST

Hi Dennis,

thanks for the answer. I should have specified that "dir" is the directory
location and "cell" is just a string (in this case to identify the
grid-cell I am working on).

Variable: cell
Type: string Total
Size: 4 bytes
             1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) c72267

In any case, neither of the following options work:
         opt@fout = dirobs+cell+"yearly_statsall.txt"
nor
         opt@fout = dirobs+"yearly_statsall.txt"

Either option appears to give the correctly intended output name, but
neither works:

open: No such file or directory
apparent state: unit 31 named
~/ERA40/MODA/rain.grb.avg.dir/region/obs-yearly-1958-2001/c72267yearly_statsall.txt
lately writing direct unformatted external IO
Aborted (core dumped)

open: No such file or directory
apparent state: unit 31 named
~/ERA40/MODA/rain.grb.avg.dir/region/obs-yearly-1958-2001/yearly_statsall.txt
lately writing direct unformatted external IO
Aborted (core dumped)

Many thanks,

isabella

-------
Dr. C. Isabella Bovolo

Email: Isabella.Bovolo@ncl.ac.uk
Tel: +44 191 222 8599
Fax: +44 191 222 6669
School of Civil Engineering and Geosciences,
Newcastle University, NE1 7RU, England, UK

On Thu, 12 Nov 2009, Dennis Shea wrote:

> I assume "cell" is a directory???
>
> How about?
>
> opt@fout = dir+cell+"/"+"yearly_statsall.txt"
>
> Good luck
>
> sabella Bovolo wrote:
>> Dear all,
>>
>> I am trying to print an array to a file using write_matrix by giving the
>> file name a named directory and prefix however, I am getting an error.
>>
>> The following works fine:
>> opt = True
>> opt@fout = "yearly_statsall.txt"
>> write_matrix(matrixall,"4f15.3,opt)
>>
>> but this:
>> dirobs = "~/ERA40/MODA/rain.grb.avg.dir/region/obs-yearly-1958-2001/"
>> cell = "c72267"
>> opt = True
>> opt@fout = dir+cell+"yearly_statsall.txt"
>> write_matrix(matrixall,"4f15.3,opt)
>>
>> results in the following error:
>> open: No such file or directory
>> apparent state: unit 31 named
>> ~/ERA40/MODA/rain.grb.avg.dir/region/obs-yearly-1958-2001/yearly_statsall.txt
>> lately writing direct unformatted external IO
>> Aborted (core dumped)
>>
>> the "dir" and "cell" variables work fine elsewhere in the program.
>>
>> I could specify the directory name within the quotes (which also works) but
>> I would like the cell name to be able to change.
>>
>> Is this possible and am I doing something wrong?
>>
>>
>> Many thanks,
>>
>> Isabella
>>
>> -------
>> Dr. C. Isabella Bovolo
>>
>> Email: Isabella.Bovolo@ncl.ac.uk
>> Tel: +44 191 222 8599
>> Fax: +44 191 222 6669
>> School of Civil Engineering and Geosciences, Newcastle University, NE1 7RU,
>> England, UK
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> --
> ======================================================
> Dennis J. Shea tel: 303-497-1361 |
> P.O. Box 3000 fax: 303-497-1333 |
> Climate Analysis Section |
> Climate & Global Dynamics Div. |
> National Center for Atmospheric Research |
> Boulder, CO 80307 |
> USA email: shea 'at' ucar.edu |
> ======================================================
>
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 12 12:01:58 2009

This archive was generated by hypermail 2.1.8 : Sat Nov 14 2009 - 12:49:36 MST