@echo off
if exist f01 goto err1
if exist f25 goto err2
%dvdir%\object\td144n.exe <%dvdir%\data\td144_%1.txt
copy %dvdir%\data\td144 f25
call %dvdir%\exec\makef05scfs
call %dvdir%\exec\existf05
if exist F05exist.txt goto fexist
goto err3
:fexist
del F05exist.txt
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 TTTTT      d   11       4      4
echo   T        d  111      44     44
echo   T     dddd    1     4 4    4 4
echo   T    d   d    1    4  4   4  4
echo   T    d   d    1    44444  44444
echo   T    d   d    1       4      4
echo   T     dddd  11111     4      4
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 [td144n_%1 DV-Xalpha(SCAT) start] > td144n_%1_time.txt
time < %dvdir%\data\return.key | find "." >> td144n_%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\cnvchk150
call converge.bat
if exist convd.txt goto cont4
if exist notconv.txt goto cont4
del converge.bat
goto scatrun
:cont4
echo [td144n_%1 DV-Xalpha(SCAT) end] >> td144n_%1_time.txt
time < %dvdir%\data\return.key | find "." >> td144n_%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
echo ***********************************************************
echo  CCC    OOO   NN  N  TTTTT  RRRR   DDDD     A   L     L
echo C   C  O   O  NN  N    T    R   R  D   D   A A  L     L
echo C      O   O  N N N    T    R   R  D   D  A   A L     L
echo C      O   O  N N N    T    RRRR   D   D  A   A L     L
echo C   C  O   O  N  NN    T    R   R  D   D  AAAAA L     L
echo C   C  O   O  N  NN    T    R   R  D   D  A   A L     L
echo  CCC    OOO   N   N    T    R   R  DDDD   A   A LLLLL LLLLL
echo ***********************************************************
call %dvdir%\exec\contrdall
dir/w *.sca
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 BBBB   NN  N  DDDD    OOO   DDDD   RRRR
echo B   B  NN  N  D   D  O   O  D   D  R   R
echo B   B  N N N  D   D  O   O  D   D  R   R
echo BBBB   N N N  D   D  O   O  D   D  RRRR
echo B   B  N  NN  D   D  O   O  D   D  R   R
echo B   B  N  NN  D   D  O   O  D   D  R   R
echo BBBB   N   N  DDDD    OOO   DDDD   R   R
echo ***********************************************************
call %dvdir%\exec\bndodr
echo ***********************************************************
echo PPPP    OOO   PPPP     A    NN  N  L       SSS
echo P   P  O   O  P   P   A A   NN  N  L      S   S
echo P   P  O   O  P   P  A   A  N N N  L       S
echo PPPP   O   O  PPPP   A   A  N N N  L        S
echo P      O   O  P      AAAAA  N  NN  L         S
echo P      O   O  P      A   A  N  NN  L      S   S
echo P       OOO   P      A   A  N   N  LLLLL   SSS
echo ***********************************************************
call %dvdir%\exec\popanls
rename F08P F08P_S
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   A    TTTTT  L      IIIII   SSS   TTTTT
echo  A A     T    L        I    S   S    T
echo A   A    T    L        I     S       T
echo A   A    T    L        I      S      T
echo AAAAA    T    L        I       S     T
echo A   A    T    L        I    S   S    T
echo A   A    T    LLLLL  IIIII   SSS     T
echo ***********************************************************
call %dvdir%\exec\atlist >atlist.out
echo ***********************************************************
echo BBBB   L      L      IIIII   SSS   TTTTT
echo B   B  L      L        I    S   S    T
echo B   B  L      L        I     S       T
echo BBBB   L      L        I      S      T
echo B   B  L      L        I       S     T
echo B   B  L      L        I    S   S    T
echo BBBB   LLLLL  LLLLL  IIIII   SSS     T
echo ***********************************************************
call %dvdir%\exec\bllist >bllist.out
echo ***********************************************************
echo PPPP   RRRR   EEEEE   SSS   TTTTT   SSS
echo P   P  R   R  E      S   S    T    S   S
echo P   P  R   R  E       S       T     S
echo PPPP   RRRR   EEEE     S      T      S
echo P      R   R  E         S     T       S
echo P      R   R  E      S   S    T    S   S
echo P      R   R  EEEEE   SSS     T     SSS
echo ***********************************************************
call %dvdir%\exec\prests
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
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 H   H  L       GGG     A    PPPP
echo H   H  L      G   G   A A   P   P
echo H   H  L      G      A   A  P   P
echo HHHHH  L      G GGG  A   A  PPPP
echo H   H  L      G   G  AAAAA  P
echo H   H  L      G   G  A   A  P
echo H   H  LLLLL   GGG   A   A  P
echo ***********************************************************
call %dvdir%\exec\hlgap
echo ***********************************************************
echo H   H  L       GGG     A    PPPP    SSS
echo H   H  L      G   G   A A   P   P  S   S
echo H   H  L      G      A   A  P   P   S
echo HHHHH  L      G GGG  A   A  PPPP     S
echo H   H  L      G   G  AAAAA  P         S
echo H   H  L      G   G  A   A  P      S   S
echo H   H  LLLLL   GGG   A   A  P       SSS
echo ***********************************************************
call %dvdir%\exec\hlgaps
type i08
type f08e
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 not exist
goto end
:end
