rem runharpa.bat 
rem 17 Mar 2009 - f90 version
rem 17 Mar 2009 - General version for any directory
rem 11 Mar 2009 - Moved CONBLK out of S2 to separate file CONBLK2.FOR
rem  3 May 2006 - Copied doutp, tape1, and rysfil to samples subdirectory
rem 25 Mar 2006 - Moved S5 and S6 to G subdirectory
@ECHO OFF
rem  2 Mar 2006 - Added S5 and S6 to loader list
rem 16 Feb 2006 - Uses formateig
rem  2 Feb 2006 - Using general version of FNDMODLH
rem 30 Jan 2006 - Version for directory \raytracing\samples\
rem 20 Sep 2004 - Copied PUNCH to TP1 & RY in eigen directory
rem 18 Sep 2004 - Added copy of PUNCH to eigen directory
rem 17 Sep 2004 - Added copy of TAPE5 to profile directory
if %1. == .  GOTO NLNK
if %1. == l. GOTO FIND
if %1. == L. GOTO FIND
GOTO NLNK
:FIND
rem   Run FNDMODLH to determine which models will be linked.
rem
rem cd ..\pcharpo
rem ..\pcharpo\FNDMODLH %2
..\fndmodlh\FNDMODLH %2
rem
if NOT errorlevel 1 GOTO LNK
     @ECHO ON
     rem   There are errors while running FNDMODLH.
     PAUSE 'Press Ctrl-Break to Quit'
     @ECHO OFF
rem
:LNK
rem
copy linkmodl.dat ..\pcharpo/y
copy return.bat ..\pcharpo/y
cd ..\pcharpo
rem For the f90 version, uncomment the following line
DF /LINK /STACK:4096 /DEBUG:all S0 S1 S2 CONBLK2 S3 ATMOSHD S4 ..\G\S5 ..\G\S6 ..\EIGEN\CEA @linkmodl.dat /out:pcharpo.exe
rem The following line is for the Intel 9.0 version
rem DF /stand:f90 /Qsave /quiet /LINK /STACK:4096 /DEBUG:all S0 S1 S2 CONBLK2 S3 ATMOSHD S4 ..\G\S5 ..\G\S6 ..\EIGEN\CEA @linkmodl.dat /exe:pcharpo.exe
rem
rem   If there are errors, go to EXIT.
if errorlevel 1 GOTO EXIT
rem
return %1 %2 runharpa
rem   Go here if no LINK is desired, i.e. no models were changed.
:NLNK
rem   Run PC-HARPO to produce TAPE5 file.
rem
cls
..\pcharpo\pcharpo < fname.out
rem
rem   If there are errors, go to EXIT.
if errorlevel 1 GOTO EXIT
rem
copy PUNCH TEMPTAPE1
copy PUNCH TEMPRYSFIL
copy PUNCH RYSFIL
copy tape5 H%2
copy doutp D%2
rem cd ..\psgraph
..\pcharpo\formateig
copy tape1 T%2
copy rysfil R%2
:EXIT
