Opened 18 years ago

Closed 18 years ago

Last modified 16 years ago

#116 closed enhancement (fixed)

Request for ropp2ropp -t to send to stdout — at Version 3

Reported by: Dave Offiler Owned by: Dave Offiler
Priority: minor Milestone: 3.0
Component: ropp_io Version: 1.0
Keywords: ropp2ropp stdout Cc:

Description (last modified by Huw Lewis)

dave.offiler@metoffice.gov.uk wrote: 
Santi,
> 
>   
> how can I read a ropp.nc file and get via stdout the ASCII version directly?
> > I've tried ropp2ropp file_ropp.nc -t -o /dev/stdout
> > 
> > and it takes the next error:
> > ropp2ropp: posixio.c:396: px_get: Assertion `extent != 0' failed.
> > forrtl: info: Fortran error message number is 76.
> > forrtl: warning: Could not open message catalog: ifcore_msg.cat.
> > forrtl: info: Check environment variable NLSPATH and protection of 
> > /usr/lib/ifcore_msg.cat.
> > Abort
> > 
> > options -d, and - l only write to stdout the header or id/lat/lon 
> > information.
> > 
> > I'm using version:
> > ropp2ropp: Version V1.0-1  26-Sep-2005
> > 
> > Current version has this option?
> >     
> > 
> No, it can't directly (> /dev/null doesn't work either). This appears
> to be a limitation of Fortran (or the compiler - are you using
> Intel 'ifort'?). The indirection doesn't get passed to the program
> as a command line argument, so it can't take action on it to 
> open the file as '*' (or perhaps stream 6). With a separate command
> line switch (-s ?) instead of -t, it might be possible to OPEN the
> output file to UNIT=6 (and no file name, which I think should be
> equivalent to C's stdout) instead of OPEN with the current UNIT=
> <whatever> and the named file.
> 
> A work around could be to use a temporary file:
> 
>  > ropp2ropp ropp.nc -t -o tmp; cat tmp; rm tmp
> 
> What is the purpose of wanting stdout - is it really the screen, or
> do you want to pipe it into another program? 
> 
>  > ropp2ropp ropp.nc -t -o tmp; cat tmp | myprog; rm tmp
> 
> should work.
> 
> Shall I take this as a 'wish' for future development and log it in our
> Trac system?
> 
> Dave
>   
> Hi Dave,
Ok, I understand now, that there's no possibility to get the ASCII conversion into the stdout. I think that this could be logged into your track system, because it's very usual do redirections or pipes. And I think that it's very easy to implement this option. In fact, the typical behaviour is that if you don't put any output file, the output of the program goes to the stdout.

well, it's only a suggestion.
Ok, I'll use now a temporary file.

I'm adapting my PHP code related to occultations profiles, and as it hasn't developed and interface between PHP and netcdf, I'll use ropp2ropp and read the ASCII conversion to print the profiles.
Well, If you have other ideas to be more efficient, perfect. If you have a method or tool from the command line to read your ropp.nc files and get an x,y ASCII columns with the selected parameters (altitude vs temperature, etc...). This could be useful for me.

regards,
Santi


Change history (3)

comment:1 by Dave Offiler, 18 years ago

Resolution: fixed
Status: newclosed

Santi's application (extracting GRAS profiles for diplay on the GARF web server) now uses ncdump tool to output in XML format, which the display interface can read via a pipe - which is a more efficient solution than dumping and parsing ropp2ropp output.

Clsoing this ticket as a 'wontfix' as it is now redundant.

comment:2 by (none), 16 years ago

Milestone: 3.0

Milestone 3.0 deleted

comment:3 by Huw Lewis, 16 years ago

Description: modified (diff)
Milestone: 3.0
Note: See TracTickets for help on using tickets.