Re: write_matrix.f Fortran runtime error: No such file or directory

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 16 2012 - 11:23:12 MDT

[1] You can read binary files in NCL. NCL does not require nc.

[2] When reading binary in NCL, you can preset how NCL handles binary.

http://www.ncl.ucar.edu/Document/Functions/Built-in/setfileoption.shtml

  setfileoption("bin","ReadByteOrder","LittleEndian")

[3] The Examples URL has a section on reading/converting "GrADS files"
     (a binary file with a text file describing how the file
      was written.)

      http://www.ncl.ucar.edu/Applications/
      See Miscellaneous at bottom

      If you insall the Climate Data Operators, their
      command line utilitry is the way to go.

    cdo -f nc import_binary file.ctl ofile.nc

+++++++++++++++++++++++++++++++++++++++++++++++++++++
On 04/16/2012 11:00 AM, David Adams wrote:
> Hi Mary,
> yes, that worked. I downloaded
> ncl_ncarg-6.0.0.Linux_Debian_x86_64_nodap_gcc445.tar
> and I was able to use write_matrix.
>
> On a related issue, I am trying to create netcdf files (so that I can
> use NCL)
> from a GrADS ctl file of binary GOES 12 Channel 4 data.
> It seems to be a 64-bit problem, because the data values are fine when I
> process them in GrADS on my 32-bit machine. I tried their byteswapped
> and non-byteswapped option, but I just get two different strange
> values. I know the 64-bit value are "correct" in that the patterns of
> the brightness temperature are identical to the patterns of the correct
> brightness temperature with my 32-bit machine.
>
> For example, one particular value at a point is
> 112
> for byteswapped
> It becomes
> 65458
> for non-byteswapped. The correct value on my 32-bit machine is
> 28850 (i.e., 288.5 K)
>
> any ideas?
>
> thanks in advance,
> Dave
>
>
>
>
>
>
>
>
>
> On Mon, Apr 16, 2012 at 7:06 AM, Mary Haley <haley@ucar.edu
> <mailto:haley@ucar.edu>> wrote:
>
> Dave,
>
> I would recommend downloading an NCL binary that was compiled with
> the highest version of gcc possible, which I believe is 4.4.5 for
> NCL V6.0.0.
>
> --Mary
>
> On Apr 13, 2012, at 9:49 PM, David Adams wrote:
>
> > Hi Mary et al.
> > I have the following version of gcc
> >
> > gcc version 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC)
> >
> > Which binaries should I download given this version of gcc?
> >
> > thanks,
> > Dave
> >
> >
> >
> > On Fri, Apr 13, 2012 at 7:14 AM, Mary Haley <haley@ucar.edu
> <mailto:haley@ucar.edu>> wrote:
> > Hi Dave,
> >
> > This is a very strange error indeed. "writematrix.f" is the
> underlying Fortran code for the "write_matrix"
> > procedure. Both this code and the C wrapper are "built into" the
> "ncl" executable, so there shouldn't
> > be any issue with using it.
> >
> > I wonder if maybe it's a compatibility issue with the version of
> NCL you downloaded for your system.
> >
> > I would recommend upgrading to NCL V6.0.0, and trying one of
> those binaries instead.
> >
> > What version of gcc are you running? This might affect which
> binary you download.
> >
> > gcc --version
> >
> > For NCL V6.0.0, we offer binaries that were compiled with gcc
> 4.3.2, gcc 4.4.5, and gcc 4.1.2.
> > I tend to like the Debian binaries, as they seem to work well
> across many flavors of Linux.
> > I've had trouble with using the RedHat binaries on other
> non-RedHat systems.
> >
> > --Mary
> >
> >
> > On Apr 12, 2012, at 11:24 PM, David Adams wrote:
> >
> > > Hi All,
> > > I have recently upgraded to a 64-bit machine running
> > > Fedora Core 16. I've installed the following
> > > ncl_ncarg-5.2.1.Linux_RedHat_x86_64_nodap_gcc412.tar
> > >
> > > All of my old ncl programs have been working fine, but today
> > > I have a strange error.
> > > I get the following error message
> > > .
> > > At line 172 of file writematrix.f
> > > Fortran runtime error: No such file or directory
> > >
> > > Where should write writematrix.f be? I have used locate, but
> can't find the file.
> > > The script that worked fine
> > > on my on Linux 32-bit machine is here
> > > Any ideas?
> > > thanks,
> > > Dave
> > >
> > >
> > > ; SAME as average_CTT_per_file.ncl, but read into
> ave_subset_CTT_ncl_script.F90
> > > load "/usr/local/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> > > load "/usr/local/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> > > load "/usr/local/lib/ncarg/nclscripts/csm/contributed.ncl"
> > > load "/usr/local/lib/ncarg/nclscripts/csm/shea_util.ncl"
> > > begin
> > > files = systemfunc("ls 2011_01_3*.nc")
> > > file_list = asciiread("file_list",-1,"string")
> > > setfileoption("nc","SuppressClose",False)
> > > f = addfiles(files,"r")
> > > ListSetType (f, "join")
> > > out_file = str_get_cols(file_list(0),0,14)
> > > output_file = out_file + ".dat"
> > > diri = "/home/dadams/Desktop/CPTEC_data/"
> > > year = stringtofloat(str_get_cols(file_list,0,3))
> > > month = stringtofloat(str_get_cols(file_list,5,6))
> > > day = stringtofloat(str_get_cols(file_list,8,9))
> > > hour = stringtofloat(str_get_cols(file_list,11,12))
> > > minute = stringtofloat(str_get_cols(file_list,13,14))
> > > new_temp = f[:]->new_temp
> > > lat = f[0]->lat
> > > lon = f[0]->lon
> > > time_dimension = dimsizes(new_temp(:,0,0)); number of time
> steps (files)
> > > new_temp@_FillValue = 32767
> > > new_temp = new_temp/100.0
> > > CTT_average =
> new((/1,dimsizes(new_temp(:,0,0))/),typeof(new_temp))
> > > do n = 0, time_dimension-1
> > > average = avg(new_temp(n,122:126,126:129))
> > > non_missing = num(.not.ismissing(new_temp(n,122:126,126:129)))
> > > CTT_average(0,n) = average
> > > end do
> > > m = dimsizes(CTT_average(0,:))
> > > data = new ( (/m,6/), typeof(CTT_average) )
> > > data(:,0) = year(:)
> > > data(:,1) = month(:)
> > > data(:,2) = day(:)
> > > data(:,3) = hour(:)
> > > data(:,4) = minute(:)
> > > data(:,5) = CTT_average(0,:)
> > > fmtx = "f5.0,2x,f3.0,2x,f3.0,2x,f3.0,2x,f3.0,2x,f9.3"
> > > opt = True
> > > opt@fout = diri + output_file
> > > write_matrix (data, fmtx, opt)
> > > end
> > >
> > > _______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 16 11:23:23 2012

This archive was generated by hypermail 2.1.8 : Fri Apr 20 2012 - 16:21:18 MDT