[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20020508: cronjob and RTPTSRC data



>From: Owen Cooper <address@hidden>
>Organization: NOAA Aeronomy Laboratory
>Keywords: 200205082229.g48MTKa18194 McIDAS

Owen,

>Greetings from Monterey.

The weather must be nice :-)

>I'm in the field trying to produce SKEW-T
>diagrams with a cronjob.  Should be straight-forward as I have cronjobs
>running around the clock producing satellite and Grid products.
>
>I am using a shell script that inlcudes the following commands (among
>others) and the shell script is called SKEWT.sh:
>
>
>cd $MCDATA
>mcenv << EOF
>  redirect.k REST ITCT.NAM
>  mcenv -f 1@648x748 batch.k $1 CONTINUE=YES
>  redirect.k REST DEFAULT.NAM
>  exit
>
>the shell script is invoked with the simple command:
>SKEWT.sh SKEWT.BAT
>
>If I run the shell from the unix prompt, everything works fine.
>But when I run it form a cronjob I get the following error message in the
>log file:
>
>SF 1; ERASE; UAPLOT KSLE PRANGE=200 1050 CENTER=YES WIN=BARB MPS .6
>Erased image frame(s) 1-1
>Erased graphic frame(s) 1-1
>ERASE: Done
>No observations found for selection conditions
>SNDSKEWT: A sounding is not available in the dataset
>UAPLOT:  Done
>
>I don't understand how mcidas can find the data when I run the shell from
>the unix prompt, but not when I run it from a cronjob.
>Any ideas?

When the job is run from cron, the McIDAS commands most likely don't
have enough information to know what ADDE server/dataset to get the
data from.  When you run from the command line, you most likely have
environment definitions for MCTABLE_READ and MCTABLE_WRITE.

I suggest that you either modify your script to parallel the example I
include in my McIDAS distribution, ~mcidas/data/mcbatch.sh, or use a
copy of the script itself.  mcbatch.sh is designed to be copied by end
users and edited to setup needed McIDAS environment variable
definitions.  mcbatch.sh is invoked as follows:

mcbatch.sh batch_file_name

Take a look at mcbatch.sh and see if it can't be pressed into service
with very little work.  Since you are changing file REDIRECTions in
your script, you will need to do the same in your copy of mcbatch.sh.

That portion of the copy of mcbatch.sh should end up looking something
like:

export MCHOME MCDATA MCLOG MCPATH MCTABLE_READ PATH LD_LIBRARY_PATH
#
# Now run 'mcenv' to create a McIDAS-X environment in which the McIDAS
# binary batch.k will run.
#

cd $MCDATA
mcenv -f 1@648x748 << EOF

  redirect.k REST ITCT.NAM
  batch.k $1 CONTINUE=YES
  wait.k 3
  redirect.k REST DEFAULT.NAM
  exit

EOF

I added the 'wait.k 3' just to make sure that all McIDAS invocations
in your BATCH file have completed.

>The contents of the redirection file (ITCT.NAM) are:
>REDIRECT LIST
>Number of active redirection entries=22
>AREA0* /wrk/dk5/ocooper/ITCT/AREA_GW1KVIS
>AREA1* /wrk/dk5/ocooper/ITCT/AREA_GW1KVIS
>AREA2* /wrk/dk6/ocooper/ITCT/GMS5_IR
>AREA3* /wrk/dk6/ocooper/ITCT/GMS5_IR
>AREA4* /wrk/dk6/ocooper/ITCT/GMS5_WV
>AREA5* /wrk/dk6/ocooper/ITCT/GMS5_WV
>AREA9* /home/ocooper/mcidas/data
>ASUS1* /wrk/data/mcidas
>FSUS2* /wrk/data/mcidas
>GRID7* /wrk/data5/ocooper/ITCT/AVN_GRID
>GRID8* /wrk/data5/ocooper/ITCT/ETA_GRID
>GRID9* /wrk/dk6/ocooper/ITCT/GRID
>MDXX* /wrk/data/mcidas
>RAOB.RAP /wrk/data/mcidas
>RAOB.RAT /wrk/data/mcidas
>ROUTE.SYS /wrk/data/mcidas
>SKEDFILE /home/mcidas/solaris/workdata
>STRTABLE /home/ocooper/mcidas/data
>SYSKEY.TAB /wrk/data/mcidas
>VIRT9300 /home/mcidas/solaris/workdata
>*.BAT /home/ocooper/ITCT/Mcidas
>*.GIF /home/ocooper/ITCT/Mcidas
>REDIRECT: Done

The REDIRECTions are probably fine.  What is missing is what ADDE server
is to be contacted for the data.  This is true even if the dataset
is LOCAL-DATA.

Please let me know if you have any questions or problems.

Tom