@echo off
if exist f01 goto err1
if exist f25 goto err2
if exist f05 goto err3
if exist c04d goto err4
%dvdir%\object\atomn.exe <%dvdir%\data\atom_%1.txt
if exist ATOM.ERR goto err9
type C04D00.TXT
copy %dvdir%\data\atomf f25
call %dvdir%\exec\makef05
echo ***********************************************************
echo            d         DDDD   V   V
echo            d         D   D  V   V
echo  eee    dddd   u  u  D   D  V   V
echo e   e  d   d   u  u  D   D  V   V
echo eeee   d   d   u  u  D   D  V   V
echo e      d   d   u  u  D   D   V V
echo  eeee   dddd    uuu  DDDD     V
echo ***********************************************************
echo   A    TTTTT   OOO   M   M
echo  A A     T    O   O  MM MM
echo A   A    T    O   O  M M M
echo A   A    T    O   O  M M M
echo AAAAA    T    O   O  M   M
echo A   A    T    O   O  M   M
echo A   A    T     OOO   M   M
echo ***********************************************************
echo NN  N                 SSS            i
echo NN  N   ooo   nnnn   S   S  pppp          nnnn
echo N N N  o   o  n   n   S     p   p   ii    n   n
echo N N N  o   o  n   n    S    p   p    i    n   n
echo N  NN  o   o  n   n     S   pppp     i    n   n
echo N  NN  o   o  n   n  S   S  p        i    n   n
echo N   N   ooo   n   n   SSS   p       iii   n   n
echo ***********************************************************
echo  SSS    CCC     A    TTTTT
echo S   S  C   C   A A     T    sss     t    aaaa   r rr    t
echo  S     C      A   A    T   s   s  ttttt      a  rr  r ttttt
echo   S    C      A   A    T    s       t     aaaa  r       t
echo    S   C   C  AAAAA    T      s     t    a   a  r       t
echo S   S  C   C  A   A    T   s   s    t t  a  aa  r       t t
echo  SSS    CCC   A   A    T    sss      t    aa a  r        t
echo ***********************************************************
echo [atomn_%1 DV-Xalpha(SCAT) start] > atomn_%1_time.txt
time < %dvdir%\data\return.key | find "." >> atomn_%1_time.txt
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
echo [atomn_%1 DV-Xalpha(SCAT) end] >> atomn_%1_time.txt
time < %dvdir%\data\return.key | find "." >> atomn_%1_time.txt
echo ***********************************************************
echo  SSS    CCC     A    TTTTT                          d
echo S   S  C   C   A A     T                 nnnn       d
echo  S     C      A   A    T           eee   n   n   dddd
echo   S    C      A   A    T          e   e  n   n  d   d
echo    S   C   C  AAAAA    T          eeee   n   n  d   d
echo S   S  C   C  A   A    T          e      n   n  d   d
echo  SSS    CCC   A   A    T           eeee  n   n   dddd
echo ***********************************************************
del converge.bat
call C04D00.BAT
echo ***********************************************************
echo BBBB     A     SSS   EEEEE  FFFFF
echo B   B   A A   S   S  E      F
echo B   B  A   A   S     E      FFFF
echo BBBB   A   A    S    EEEE   F
echo B   B  AAAAA     S   E      F
echo B   B  A   A  S   S  E      F
echo BBBB   A   A   SSS   EEEEE  F
echo ***********************************************************
call %dvdir%\exec\basef
echo ***********************************************************
echo M   M    A    K   K  EEEEE  L       000      4
echo MM MM   A A   K  K   E      L      0   0    44
echo M M M  A   A  K K    E      L      0  00   4 4
echo M M M  A   A  KK     EEEE   L      0 0 0  4  4
echo M   M  AAAAA  K K    E      L      00  0  44444
echo M   M  A   A  K  K   E      L      0   0     4
echo M   M  A   A  K   K  EEEEE  LLLLL   000      4
echo ***********************************************************
call %dvdir%\exec\makel04 <%dvdir%\data\three
echo ***********************************************************
echo L      V   V  L       SSS   H   H  M   M
echo L      V   V  L      S   S  H   H  MM MM
echo L      V   V  L       S     H   H  M M M
echo L      V   V  L        S    HHHHH  M M M
echo L      V   V  L         S   H   H  M   M
echo L       V V   L      S   S  H   H  M   M
echo LLLLL    V    LLLLL   SSS   H   H  M   M
echo ***********************************************************
call %dvdir%\exec\lvlshm
echo ***********************************************************
echo PPPP    OOO   PPPP     A    NN  N  L
echo P   P  O   O  P   P   A A   NN  N  L
echo P   P  O   O  P   P  A   A  N N N  L
echo PPPP   O   O  PPPP   A   A  N N N  L
echo P      O   O  P      AAAAA  N  NN  L
echo P      O   O  P      A   A  N  NN  L
echo P       OOO   P      A   A  N   N  LLLLL
echo ***********************************************************
call %dvdir%\exec\popanl
echo ***********************************************************
echo NN  N  EEEEE  TTTTT   CCC
echo NN  N  E        T    C   C
echo N N N  E        T    C
echo N N N  EEEE     T    C
echo N  NN  E        T    C   C
echo N  NN  E        T    C   C
echo N   N  EEEEE    T     CCC
echo ***********************************************************
call %dvdir%\exec\netc
echo ***********************************************************
echo W   W    A    V   V  NN  N  U   U  M   M
echo W   W   A A   V   V  NN  N  U   U  MM MM
echo W   W  A   A  V   V  N N N  U   U  M M M
echo W W W  A   A  V   V  N N N  U   U  M M M
echo W W W  AAAAA  V   V  N  NN  U   U  M   M
echo WW WW  A   A   V V   N  NN  U   U  M   M
echo W   W  A   A    V    N   N   UUU   M   M
echo ***********************************************************
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 ATOM.ERR
goto end
:end
