Re: Selective listing of netCDF files using systemfunc on bluefire

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed, 1 Jul 2009 13:05:59 -0600

Hi Yongxin,
Here is what I think is going on:
'systemfunc' creates a child process to run the specified command
using standard Unix system calls. This means that the child process
is executed using '/bin/sh' for the command shell. Traditionally and
on bluefire, which runs a version of AIX, this is the Bourne shell.
On the PC clusters, running Linux I assume, '/bin/sh' is actually a
version of 'bash', which is compatible with the Bourne shell but
which also has additional features. The original Bourne shell does
not support the {one,another} syntax, but 'bash' does.

You can get around the problem by explicitly invoking another shell
that does support the syntax you need. For instance, you could invoke
the C-shell:

files = systemfunc("csh -c 'ls /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/
DJF/*cam2.h0.{0072,0090,0094,0095,0098}*.nc'")

Note that you need to enclose the C-shell command you want to execute
in single quotes. See Example 5 of
http://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml
for more information.

  -dave

On Jul 1, 2009, at 11:25 AM, Yongxin Zhang wrote:

> I have a bunch of netCDF files in one directory on bluefire and I
> need to open some of them for processing. I got the problem of "not
> found" when I used "files11 = systemfunc("ls /ptmp/zhangyx/CCSM/
> aeropert1/Y71-Y100/DJF/*cam2.h0.{0072,0090,0094,0095,0098}*.nc")"
> in NCL. But after I exit from NCL and used the same command on the
> command line, I got what should be listed as shown below. Any
> suggestions on how to fix the problem in NCL? This problem seems to
> be specific on bluefire since I have no problems running the same
> thing on my PC clusters.
>
> be1005en% ls /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/*cam2.h0.
> {0072,0090,0094,0095,0098}*.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0072-01.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0072-02.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0072-12.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0090-01.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0090-02.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0090-12.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0094-01.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0094-02.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0094-12.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0095-01.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0095-02.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0095-12.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0098-01.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0098-02.nc
> /ptmp/zhangyx/CCSM/aeropert1/Y71-Y100/DJF/aeropert1.cam2.h0.0098-12.nc
> be1005en%
>
> Thanks,
> Yongxin
> _______________________________________________
> 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 Wed Jul 01 2009 - 13:05:59 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 02 2009 - 11:39:38 MDT