@echo off
if exist f01 goto err1
if exist f25 goto err2
if exist f05 goto err3
if exist c04d goto err4
%dvdir%\object\ionn.exe
if exist ION.ERR goto err9
type C04D00.TXT
copy %dvdir%\data\atomf f25
call %dvdir%\exec\makef05
goto scatrun
:scatrun
call %dvdir%\exec\dvscat
if exist converge.bat goto del1
goto cont1
:del1
del converge.bat
goto cont1
:cont1
if exist convd.txt goto del2
goto cont2
:del2
del convd.txt
goto cont2
:cont2
if exist notconv.txt goto del3
goto cont3
:del3
del notconv.txt
goto cont3
:cont3
call %dvdir%\exec\cnvchk100
call converge.bat
if exist convd.txt goto cont4
if exist notconv.txt goto cont4
del converge.bat
goto scatrun
:cont4
del converge.bat
call C04D00.BAT
call %dvdir%\exec\basef
call %dvdir%\exec\makel04 <%dvdir%\data\three
call %dvdir%\exec\lvlshm
call %dvdir%\exec\popanl
call %dvdir%\exec\netc
call %dvdir%\exec\wavnum <%dvdir%\data\zero
type f08e
del C04D00.BAT
del C04D01
del C04D02
type C04D00.TXT
del C04D00.TXT
dir *.scat
if exist notconv.txt goto notconv
del convd.txt
goto end
:notconv
echo;
echo ***********************************************************
echo *** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ***
echo ***********************************************************
echo ***  SCAT (NonSpin version) has not been converged yet. ***
echo ***********************************************************
echo *** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ***
echo ***********************************************************
del notconv.txt
goto end
:err1
echo ***ERROR*** f01 already exist
goto end
:err2
echo ***ERROR*** f25 already exist
goto end
:err3
echo ***ERROR*** f05 already exist
goto end
:err4
echo ***ERROR*** c04d already exist
goto end
:err9
del F*
del C*
del ION.ERR
goto end
:end
