ncks -l option bug?

Developers
Stubaan
2012-01-30
2013-10-17
  • Stubaan
    Stubaan
    2012-01-30

    Hey folks

    Have the -p and -l options become obsolete in more recent releases?

    I see that they are seemingly no longer needed for specifying a local path to input file locations and output file destinations (haven't tested remote locations), but in trying to resolve a script bug I was using them and have found that the -l option is not performing as I expected (caveat: novice NCO user so this could well be a problem with my expectations).

    I have the following:

    ncks -O -p $input_location -l $output_destination -d time, idx_start, idx_end input_file.nc output_file.nc

    From this I would expect output_file.nc to be place in the directory $output_destination - it is instead placed in the local directory from which the script is being run.

    Thanks

     
  • Charlie Zender
    Charlie Zender
    2012-01-31

    thanks for this report. the -p option appears to work fine. the -l option appears to work
    but the docs may be misleading on what it should do. -l specifies the local output directory
    where input files are (temporarily, unless -R is used) stored after they are retrieved
    from remote locations (e.g., with FTP/SCP protocol). -l does nothing for input files that
    are purely local. output directories for those files simply put the directory name straight
    into the output file name.

    i.e., what you want is accomplished by getting rid of -l and rearranging like

    ncks -O -p $input_location -d time, idx_start, idx_end input_file.nc ${output_destination}/output_file.nc

    and example of when to use -l:

    ncra -D 2 -O -l dot -R dust.ess.uci.edu:/var/www/html/tmp/in.nc foo.nc

    this stores in.nc in the dot directory on the local disk.
    it's the input file, unmodified, after copying from the remote location.
    the output file, foo.nc, is placed in the current directory.

    using -l when retrieving from remote locations is helpful because otherwise
    NCO has to decide where to put the input file before it analyzes it and
    sometimes you don't want NCO creating weird directories on your disks.

    hth,
    cz