@ECHO OFF
CLS
GOTO START
REM  ******************** \PRZM3\PRZM3.BAT ***********************
REM  *       Author: D.W. Disney, Senior Systems Analyst         *
REM  *               OAO Corporation                             *
REM  *         Date: Thursday, 26 February 1998.  Time: 12:41:47.*
REM  *  Environment: Microway 486 B2T/66, DOS 6.00               *
REM  * Installation: OAO Corporation                             *
REM  *               U.S. Environmental Protection Agency        *
REM  *               NERL - Ecosystems Research Div., Athens, GA *
REM  *     Function: Execute PRZM3 model from DOS command line   *
REM  *     Calling                                               *
REM  *     Sequence: PRZM3                                       *
REM  *        Input: Command line: none                          *
REM  *                      Other: none                          *
REM  *************************************************************
REM  ----- Label START ------------------------------------------------------
:START
IF "%1"=="DEBUG" GOTO CHECKEXE
IF "%1"=="debug" GOTO CHECKEXE
IF EXIST C:\00\PRZM3\XPRZM3X.EXE GOTO RUNPRZM1
GOTO ERROR1
REM  ----- Label CHECKEXE ---------------------------------------------------
:CHECKEXE
IF EXIST \PRZM3NEW\XPRZM3X.EXE GOTO RUNPRZM1
REM  ----- Label ERROR1 -----------------------------------------------------
:ERROR1
ECHO #
ECHO # ----------------------------------------------------------------------
ECHO #
ECHO ##  ERROR:  BAD OR MISSING XPRZM3X.EXE FILE
ECHO #
ECHO #           The PRZM3 executable task image file XPRZM3X.EXE is
ECHO #           not located in DOS sub-directory C:\00\PRZM3.
ECHO #
ECHO #           Install and/or copy this file and all of its support
ECHO #           files to sub-directory C:\00\PRZM3 or contact
ECHO #           CEAM (ceam@epamail.epa.gov) for assistance.
ECHO #
ECHO #   Press "<Enter>" key to return to DOS command prompt.
PAUSE >NUL
GOTO STOP
REM  ----- Label RUNPRZM1 ---------------------------------------------------
:RUNPRZM1
IF "%1"=="DEBUG" TYPE \PRZM3NEW\PRZMOPEN.SCR
IF "%1"=="debug" TYPE \PRZM3NEW\PRZMOPEN.SCR
IF "%1"=="DEBUG" PAUSE >NUL
IF "%1"=="debug" PAUSE >NUL
IF "%1"=="DEBUG" GOTO TYPESCR
IF "%1"=="debug" GOTO TYPESCR
TYPE C:\00\PRZM3\PRZMOPEN.SCR
PAUSE >NUL
REM  ----- Label TYPESCR ----------------------------------------------------
:TYPESCR
CLS
ECHO #
ECHO #----------------------------------------------------------------------#
ECHO ##  Executing PRZM3 DOS command file.
ECHO #----------------------------------------------------------------------#
ECHO #
ECHO #
ECHO ##  Loading PRZM3 model task image file...wait.
REM
IF "%1"=="DEBUG" SET LFDIR=D:\F77L3\BIN\
IF "%1"=="debug" SET LFDIR=D:\F77L3\BIN\
IF "%1"=="DEBUG" GOTO RUNPRZM3
IF "%1"=="debug" GOTO RUNPRZM3
SET LFDIR=C:\00\PRZM3
REM  ----- Label RUNPRZM3 ---------------------------------------------------
:RUNPRZM3
IF "%1"=="DEBUG" \PRZM3NEW\XPRZM3X
IF "%1"=="debug" \PRZM3NEW\XPRZM3X
IF "%1"=="DEBUG" GOTO ENDRUN
IF "%1"=="debug" GOTO ENDRUN
ECHO #
ECHO #------------------------#
ECHO ##  PRZM3 run beginning.
ECHO #------------------------#
ECHO #
ECHO #                                    >>PRZM3RUN.LOG
ECHO # ----- RUN DATE/TIME STAMP ----- #  >>PRZM3RUN.LOG
ECHO # ----- Begin Execution     ----- #  >>PRZM3RUN.LOG
IF NOT "%1"=="" ECHO #                    >>PRZM3RUN.LOG
IF NOT "%1"=="" ECHO # ----- Data set: %1 >>PRZM3RUN.LOG
ECHO #                                    >>PRZM3RUN.LOG
DATE <C:\00\PRZM3\RETURN1.ANS | FIND "C" >>PRZM3RUN.LOG
TIME <C:\00\PRZM3\RETURN1.ANS | FIND "C" >>PRZM3RUN.LOG
ECHO #                                    >>PRZM3RUN.LOG
REM CLS
C:\00\PRZM3\XPRZM3X %1
ECHO #                                   >>PRZM3RUN.LOG
ECHO # ----- End Execution       ----- # >>PRZM3RUN.LOG
ECHO #                                   >>PRZM3RUN.LOG
DATE <C:\00\PRZM3\RETURN1.ANS | FIND "C" >>PRZM3RUN.LOG
TIME <C:\00\PRZM3\RETURN1.ANS | FIND "C" >>PRZM3RUN.LOG
ECHO #                                   >>PRZM3RUN.LOG
ECHO # --------------------------------------------------- # >>PRZM3RUN.LOG
REM
REM  ----- Label ENDRUN -----------------------------------------------------   
:ENDRUN
SET LFDIR=
ECHO.
ECHO ##  PRZM3 program execution complete.
IF "%1"=="DEBUG" ECHO #   Press "<Enter>" key to return to DOS command prompt.
IF "%1"=="debug" ECHO #   Press "<Enter>" key to return to DOS command prompt.
IF "%1"=="DEBUG" PAUSE >NUL
IF "%1"=="debug" PAUSE >NUL
GOTO FINISH
REM  ----- Label STOP -------------------------------------------------------   
:STOP
ECHO.
IF "%1"=="DEBUG" GOTO FINISH
IF "%1"=="debug" GOTO FINISH
CLS
REM  ----- Label FINISH -----------------------------------------------------   
:FINISH
