ncks -l option bug?

  • Stubaan

    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

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


  • Charlie Zender
    Charlie Zender

    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 ${output_destination}/

    and example of when to use -l:

    ncra -D 2 -O -l dot -R

    this stores in the dot directory on the local disk.
    it's the input file, unmodified, after copying from the remote location.
    the output file,, 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.