# DART software - Copyright UCAR. This open source software is provided
# by UCAR, "as is", without charge, subject to all terms of use at
# http://www.image.ucar.edu/DAReS/DART/DART_download
#
# DART $Id$

This file explains how to compile and run the NCEP cwordsh utility,
which is described in detail at
http://www.nco.ncep.noaa.gov/sib/decoders/BUFRLIB/cwordsh/,
and whose usage is governed by the terms and conditions of the disclaimer
http://www.nws.noaa.gov/disclaimer.html

1.  If you haven't already done so, download, compile, and build the NCEP
    BUFRLIB software on the same system upon which you plan to run cwordsh.
    The BUFRLIB software is available via the web page
    http://www.nco.ncep.noaa.gov/sib/decoders/BUFRLIB/
    
2.  Set the environment variable BUFRLIB to point to the location of the
    compiled BUFRLIB archive library from step #1.

3.  Compile the source file "cwordsh.f" and link it to BUFRLIB in order
    to create the executable file "cwordsh.x".  In general, no special
    compiler flags are required, so something similar to the following:

    $FC -o cwordsh.x cwordsh.f $BUFRLIB

    where $FC points to the local FORTRAN 77 compiler, should suffice for
    most systems.
    
4.  Set the environment variable CWRD to point to the directory containing
    the compiled "cwordsh.x" executable from step #3.

5.  The script "cwordsh" will now run the "cwordsh.x" executable that was
    created in step #3.  The script reads three strings from standard input; 
    the first is the string "block" or "unblk" to block or unblock a file, 
    respectively.  The second string is the input filename and the third
    string is the output filename.  e.g:

    echo 'block' > in
    echo 'prepqm.in' >> in
    echo 'prepqm.out' >> in
    ./cwordsh.x < in

    this also works (but it's important that the last EOF start in
    column 1 - no whitespace is allowed in front of it):

    ./cwordsh.x <<EOF
    block
    prepqm.in
    prepqm.out
    EOF

    NOTE: in spite of the wording of the original documentation, this
    program does not take command line arguments (e.g. this does not work:
    'cwordsh.x block in out')  plus, each string must be on a separate line.
    this does *not* work either:  echo 'block in out' | ./cwordsh.x


# <next few lines under version control, do not edit>
# $URL$
# $Revision$
# $Date$
