Table of contents Previous: XCD Configuring Additional GRIB2 ADDE Datasets Next: XCD Starting the Status Display Window

Running XCD with the LDM

As noted Configuring McIDAS-XCD, configuring McIDAS-XCD is a multistep process that has been simplified in Unidata McIDAS-X by the inclusion of the configuration script mcxconfig. mcxconfig leads the user through the steps that are need to configure McIDAS-XCD by asking questions about what the user intends to process with McIDAS-XCD decoders, and by advising what needs to be done to complete the configuration of both McIDAS-X and McIDAS-XCD. A number of the steps taken by mcxconfig are aimed at configuring McIDAS-XCD to work with the LDM.

After logging onto the workstation as the user mcidas do the following:

Answer the questions asked by mcxconfig and complete the instructions listed at the end of mcxconfig to configure XCD.

 


The remainder of this section gives an overview of the steps that mcxconfig leads the user through.
This information can be useful for sites that want to configure their LDM setup for running XCD manually.


Use the steps below to setup Unidata McIDAS-XCD software to work with the Unidata LDM.

The McIDAS-XCD command, STARTXCD, is responsible for running the XCD data monitors. The data monitors are, in turn, responsible for running data decoders.

In Unidata McIDAS-XCD, the LDM is responsible for starting STARTXCD along with the other processes that form its suite of applications: pqact, rtstats, etc. This is done through the LDM startup configuration file ldmd.conf.

Since it is only necessary for data ingesters to run when data is being received, the LDM is setup to run the ingesters from a pattern-action file (e.g., pqact.conf).

Setting up the LDM is accomplished through the following steps:

  1. Logon to the workstation as the user running the LDM (most typically user ldm).

  2. Copy the Bourne shell script xcd_run from the McIDAS-X installation bin directory, ~mcidas/bin, to a directory in ldm's PATH and make sure that it is executable.

    NOTE: Since the ~ldm/bin directory is a link to a directory that will change with each new LDM installation (if the LDM was installed following Unidata recommendations), one should copy xcd_run to a directory like ~ldm/decoders or ~ldm/util:

  3. The commands that run XCD data monitors and ingest data into spool files used by data monitors and decoding subroutines are startxcd.k, ingetext.k, and ingebin.k. Like all other McIDAS routines, they must run in a McIDAS environment defined by a set of Unix/Linux envionment variables..

    We adopted the approach of running these routines from the shell script xcd_run in which required McIDAS environment variables are defined. Since your setup may not match what has been recommended here, you may be required to edit xcd_run and adjust environment variables to reflect your installation.

    Edit the copy of xcd_run you just made and set the McIDAS environment variables MCHOME, MCDATA, MCLOG, and MCPATH along with PATH and possibly LD_LIBRARY_PATH to match your Unidata McIDAS-X installation.

    The following is the portion of xcd_run in which the needed environment variables are defined:

    # Define macros needed for McIDAS-200x environment
    #
    # Set MCHOME to be the home directory of your 'mcidas' installation.
    
    # Set MCDATA to be the working directory of your 'mcidas' installation.
    # For this example, I will assume that this is /home/mcidas/workdata
    #
    # Set MCPATH to include MCDATA as its first directory.  I assume
    # in this example that McIDAS-X was installed in /home/mcidas.
    
    MCHOME=/home/mcidas
    MCDATA=$MCHOME/workdata
    MCLOG=/usr/local/ldm/logs/XCD_START.LOG
    MCPATH=${MCDATA}:$MCHOME/data:$MCHOME/help
    
    # Setup PATH so that the McIDAS-X executables can be found
    
    PATH=$PATH:$MCHOME/bin
    
    # Set LD_LIBRARY_PATH to include all directories (other than those searched
    # by default) that are needed to be searched to find shared libraries.
    
    LD_LIBRARY_PATH=$MCHOME/lib:/usr/lib:/usr/ucblib
    

    You may need to adjust some entries like PATH and LD_LIBRARY_PATH to match your workstation's operating system. Please review the informational header portion of xcd_run for details.

  4. Next, make needed changes in the LDM startup configuration file, ldmd.conf.

    If this is your first installation of Unidata McIAS-XCD, or if you found that you had multiple invocations of startxcd.k running (see Building and Installing McIDAS-XCD), then make sure that the exec entries in ldmd.conf look like (the order is not critical, but it is recommended:

    This will cause xcd_run to be run at LDM startup.

  5. Next, make needed changes in the LDM pattern-action file, pqact.conf. For convenience, the following action files are available in the distribution: ~mcidas/etc/pqact.conf_xcd_model and ~mcidas/etc/pqact.conf_xcd_point.

    If this is your first installation of Unidata McIDAS-XCD, copy the actions from ~mcidas/etc/pqact.conf_point and ~mcidas/etc/pqact.conf_model to the end of the LDM pattern-action file that you will use (e.g., ~ldm/etc/pqact.conf):

    Add:

    If you were running Unidata McIDAS-XCD previously, you should have disabled the running of xcd_run during Building and Installing McIDAS-XCD. You can undo those changes as follows:

    change:

    back to:

    After editing, you can make the changes active by:

    NOTE: pqact.conf requires use of tabs in many locations. In the examples above, the white spaces just after IDS and HRS, and before PIPE and xcd_run, etc. are actually tabs. Also, there should never be leading spaces in pqact.conf lines.

  6. Next, verify that ldm has execute privilege for McIDAS-X commands. If you followed all of the the installation instructions for Unidata McIDAS-X, at this point the users mcidas and ldm will be in the same group. The installation for McIDAS-X commands sets world execute privilege to all McIDAS commands. McIDAS-XCD commands, on the other hand only have user and group execute privilege.

    Verify that ldm has read and write privilege in the directories owned by mcidas and that mcidas has read and write privilege in directories owned by ldm. If either of these is not met, then mcidas, ldm, or root should change the directory permissions to allow this. Again, if the umask was set to 002 for both mcidas and ldm before directories and files were created, then both users should be able to read and write files in each other's directories.

  7. At this point, you should be ready to start/restart the LDM which will, in turn, start the XCD ingestion and decoding processes.

  8. After you have verified that the LDM invocation started up startxcd.k and that data is being received by the LDM and fed to the XCD ingesters (ingetext for textual data and ingebin for binary data), you should setup scouring for the XCD-produced data files.

    Included in the Unidata McIDAS-X distribution is a Bourne shell script, mcscour.sh, that is designed to be executed by cron to scour McIDAS data files. After McIDAS-X installation, mcscour.sh will be found in the ~mcidas/bin directory. mcscour.sh is best run by the user ldm who should copy it to a directory in ldm's PATH and edit it to set needed McIDAS environment variables like was done for xcd_run:

    Set the EDITOR environment variable in your Unix session to be the name of your favorite text editor. For example, using C Shell syntax:

    Then, edit your crontab file:

    and add an entry like (yours may be slightly different!) the following:

    The variables mm and hh represent the minute and hour of the day to run mcscour.sh.

    If you had problems setting up a cron entry, contact your system administrator. This is very important for ldm as a number of LDM activities are initiated by cron.

    Now, edit the copy of mcscour.sh:

    and set its internal McIDAS environment variables.

    The invocations of doqtl.k in mcscour.sh are setup to scour McIDAS MD files so that only the two most recent days are left on disk. McIDAS MD files must be scoured before they get to be 10 days old. If they are not, then new data will be written to the end of existing files up until the file fills. After that, the data will be lost.

    The invocation qrtmdg.k GRID in the example is configured to keep only one day of XCD-decoded McIDAS GRID files on disk at one time.

    The delwxt.k invocation in the example is configured to keep one day of data on disk at one time and to search backwards ten days for data files to scour.

    More information on QRTMDG and DELWXT may be found in McIDAS-XCD Administrative Commands. More information on DOQTL, IGU, and LWU may be found in the Unidata McIDAS Users Guide.

  9. Removing GRIB and BUFR Files

    If you have setup GRIB filing for NOAAPORT model data for, you will need to scour the GRIB and BUFR files that are being saved. If you did not setup GRIB filing, proceed to the next step.

    First, copy the xcdscour script from the McIDAS distribution to a directory in the PATH of the user ldm. We recommend that the directory used be ~ldm/util:

    Next, add the following two entries to your ldm user's cron file.

    The variables mm and hh represent the minute and hour of the day to run the xcdscour command. The variable nn represents the number of days of data to keep online. path_to_grib_files represents the fully qualified pathname of the directory where GRIB files are being filed; path_to_bufr_files represents the fully qualified pathname of the directory where BUFR files are being filed.

    xcdscour deletes old GRIB1, GRIB2 and BUFR files written by DMBIN. If DMBIN is configured to use a MySQL database the corresponding GRIB1 and GRIB2 database entries will be removed.

  10. At this point your are finished configuring the LDM to run McIDAS-XCD, so you can log off:


Table of contents Previous: XCD Configuring Additional GRIB2 ADDE Datasets Next: XCD Starting the Status Display Window