2.1. How to start Angel

ANGEL can be used on various operation systems, such as Windows, UNIX and Mac. In the package, we included the source files and executable file. ANGEL is coded by the Fortran77. The ANGEL code can be compiled by almost Fortran77 software on various operation systems.

2.1.1. Starting parameters

You only need executable file to run ANGEL . Without the shell script or batch file, which will be explained later, you can use ANGEL .

We first explain the parameters in starting ANGEL . When you want to run ANGEL without any parameters, you have to the following messages in normal output.

List 1.3 • ANGEL starting message

1:  > angel_c
2:  >
3:  > ANGEL     (R) Graphic Program Version  4.00
4:  > Copyright (C) Koji NIITA  1993-2002. All rights reserved.
5:  >

In this moment, ANGEL is waiting for the input parameters from normal input. Then you should write file name and page numbers to be processed and output EPS file name in a line. These parameters should be separated by at least one blank. After you put Enter, ANGEL starts processing and creats an EPS file.

The format of the starting parameters is the following,

input_filename [ -f \(n_1\) ]


The parameters in [   ] are optional. At least the input file name is required. The parameters may appear in any order as long as they are separated by spaces.

The meaning of each parameter is

Table 2.1 starting parameters

parameter

explanation

input_filename

Input file name processed by ANGEL .

-f \(n_1\)

First page to process: \(n_1\)
If omitted, processing starts from page 1.

-t \(n_2\)

Last page to process: \(n_2\)
If omitted, processing continues through the last page.

-o output_filename

Output EPS file name. Without this, ANGEL make a file with the same name as the input file name except for the extension, changed to be EPS.

-a

By this parameter, ANGEL make a shell file which includes the information whether orientation of figure is portrait or landscape for Ghostview. The name of the shell file is angelbat. It is only for UNIX users.

-v12

By this parameter, ANGEL translates the input file for ANGEL ver.2 or before to the input file for the present version, since after ver.3 the format of special characters is changed completely. ANGEL makes a new input file with changing the extension name to be ’an2’, and processes this file.

-exp

By this parameter, if the input file includes the inclusion file description, ANGEL makes a new input file which include all data unfolded from the inclusion file, with different extension name ’new’.

2.1.2. Starting shell and batch file

For convenient use of ANGEL , you can use a shell script or batch file. In the following, we show examples of batch file for Windows and starting shell for UNIX.

List 1.4 • Batch file for Windows

 1:  @echo off
 2:  if "%1"=="" goto man
 3:  goto start
 4:  :man
 5:  echo ANGEL     (R) Graphic Program Version 4.00
 6:  echo Copyright (C) Koji NIITA  1993-2002. All rights reserved.
 7:  echo usage:
 8:  echo   angel4 INPUT [-a] [-f N1] [-t N2] [-o OUTPUT] [-v12] [-exp]
 9:  echo   -----------------------------------------------------------
10:  echo              INPUT  : input file name
11:  echo              N1     : first page
12:  echo              N2     : terminate page
13:  echo              OUTPUT : output file name
14:  goto end
15:  :start
16:  if exist error.ang del error.ang
17:  echo %1 %2 %3 %4 %5 %6 %7 %8 %9 > input.ang
18:  c:\angel\angel_c.exe < input.ang
19:  del input.ang
20:  :end

Without any parameters, this batch file only shows the name of program, copyright and short explanation of starting parameters. In the above batch file, error.ang deleted at the 16th line is an output file for error message. If there exists old error.ang file, this batch deletes the file. At the 17th line, the batch writes the starting parameters, maximum 9 parameters, on the file input.ang. In the next line, the batch redirects this file into ANGEL . In the above example, the path of ANGEL executable file is c:\angel. You can change this path according to your environment. After ANGEL processing, the file of input.ang is deleted.

The shell file for UNIX is almost the same as in Windows, except for -a parameter.

List 1.5 • Starting shell file for UNIX

 1:  #!/bin/sh
 2:  if [ "\$1" = "" ]
 3:  then
 4:  echo 'ANGEL     (R) Graphic Program Version 4.00'
 5:  echo 'Copyright (C) Koji NIITA  1993-2002 All rights reserved.'
 6:  echo 'usage:'
 7:  echo '  angel4 INPUT [-a] [-f N1] [-t N2] [-o OUTPUT] [-v12] [-exp]'
 8:  echo '  -----------------------------------------------------------'
 9:  echo '             INPUT  : input file name'
10:  echo '             N1     : first page'
11:  echo '             N2     : terminate page'
12:  echo '             OUTPUT : output file name'
13:  exit
14:  fi
15:  if [ -r error.ang ]
16:  then
17:     rm error.ang
18:  fi
19:  if [ -r angelbat ]
20:  then
21:     rm angelbat
22:  fi
23:  echo \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 \$9 > input.ang
24:     angel_c < input.ang
25:     rm input.ang
26:  if [ -r error.ang ]
27:  then
28:     if [ -r angelbat ]
29:     then
30:        rm angelbat
31:     fi
32:     exit
33:  else
34:     if [ -r angelbat ]
35:     then
36:        . angelbat
37:     fi
38:  fi

Up to the 25th line, the above shell is the same as that for Windows. After checking an error, this shell start another shell angelbat created by ANGEL , in which you can set up Ghostview configuration to show EPS file.

2.1.3. Starting shell for Ghostview

If you specify -a in the starting parameter, ANGEL makes a file of angelbat. In ANGEL , you can select an orientation of A4 paper, Landscape or Portrait. According to the orientation of the paper, you can start Ghostview to show EPS file by making use of angelbat.

angelbat is very simple as,

List 1.6 • angelbat for Landscape

1:  angel-gs output\_filename >/dev/null &
2:  rm angelbat

List 1.7 • angelbat for Portrait

1:  angel-gp output\_filename >/dev/null &
2:  rm angelbat

You should prepare the shell of angel-gs for Landscape and angel-gp for Portrait, respectively. An example is shown below,

List 1.8 • angel-gs

1:  #!/bin/sh
2:  if [ "\$1" = "" ]
3:  then
4:     exit
5:  fi
6:  ghostview -fg black -bg white -a4 -magstep 1 -landscape \$1 -display myscreen &

List 1.9 • angel-gp

1:  #!/bin/sh
2:  if [ "\$1" = "" ]
3:  then
4:     exit
5:  fi
6:  ghostview -fg black -bg white -a4 -magstep 1 \$1 -display myscreen &

The difference between these two shells is only -landscape in angel-gs. You can modify -magstep and other parameters as you like. It is convenient to put IP address where you want to show a graph.

2.1.4. Output of error message

If ANGEL found an error in processing input file, ANGEL makes error.ang file where the error messages are included. The name of this file error.ang cannot be changed.

2.1.5. Source files

The list of ANGEL source and include files is shown as follow. These files should be put together in a same directory. ANGEL is coded by the Fortran77. The ANGEL code can be compiled by almost Fortran77 software on various operation systems.

a-alone.f  a-main0.f  a-main1.f  a-hsect.f  a-line.f  a-func.f   a-utl00.f
a-wtext.f  mdp-uni.f

You can modify the source file but it is forbidden to modified version or the executable file with the same name as ANGEL . It is also forbidden to use some parts of source code in the other software without permission.

2.1.6. Include file

To compile above source files, you need two include files, angel00.inc and angel01.inc

In angel00.inc, we define the size of hole array used in ANGEL by mdas. The value of mdas in default is 5000000. If you want to process huge number of points or if your machine does not have enough memory, please change this value and compile again.

List 1.10 • angel00.inc

 1:  ************************************************************************
 2:  *                                                                      *
 3:  *     angel00.inc                                                      *
 4:  *                                                                      *
 5:  ************************************************************************
 6:
 7:  *-----------------------------------------------------------------------
 8:
 9:        parameter ( mdas = 5000000 )
10:
11:        common /mdasa/ das( mdas )
12:        common /mdasb/ mmmax
13:
14:  *-----------------------------------------------------------------------

In angel01.inc, we define some parameters for maximum column number, maximum comment number and so on. You can change these parameters for special cases.

List 1.11 • angel01.inc

 1:  ************************************************************************
 2:  *                                                                      *
 3:  *     angel01.inc                                                      *
 4:  *                                                                      *
 5:  ************************************************************************
 6:
 7:  *-----------------------------------------------------------------------
 8:
 9:        parameter ( mh = 30 )
10:  *                 max column terms in one h: section
11:
12:        parameter ( mfc = 100 )
13:  *                 mfc : max number of constant
14:  *                       and max terms of equation
15:
16:  *-----------------------------------------------------------------------
17:
18:        parameter ( icolm = 200 )
19:  *                 icolm : max column number, should be less than ichrl
20:
21:        parameter ( ichrl = 2048 )
22:  *                 ichrl : length of character for dimension
23:  *                         and max column number for ps file
24:
25:  *-----------------------------------------------------------------------
26:
27:        parameter ( inig = 500 )
28:  *                 inig : length of character for dimension
29:
30:        parameter ( mc = 500 )
31:  *                 mc : max number of line comments (total)
32:  *                      max number of arrows
33:  *                      max number of multi records
34:
35:        parameter ( numtic = 1000 )
36:  *                 numtic : max number of tic number
37:
38:        parameter ( ipsm = 100 )
39:  *                   max number of include ps file in one graph
40:
41:        parameter ( nr = 50 )
42:        parameter ( nc = 50 )
43:
44:  *     nr: maxmum number of row in one table
45:  *     nc: maxmum number of column in one table
46:
47:  *-----------------------------------------------------------------------
48:
49:        parameter ( r0max = 1.0d+40,  r1max = 1.0d+41 )
50:  *                   max real number
51:
52:        parameter ( r9max = 1.0d+39 )
53:        parameter ( r9min = 1.0d-39 )
54:
55:        parameter ( pi = 3.1415926535898d0 )
56:
57:  *-----------------------------------------------------------------------
58:
59:        parameter (jol=18)
60:  *                   output temporary file of lines
61:        parameter (jil=19)
62:  *                   output temporary file of region line
63:        parameter (jhc=20)
64:  *                   output temporary file of 3D color plot
65:        parameter (jhl=21)
66:  *                   output temporary file of 3D cluster plot
67:        parameter (jer=22)
68:  *                   for error message
69:        parameter (jps=23)
70:  *                   input ps file
71:        parameter (jab=24)
72:  *                   angelbat for psview only for unix
73:        parameter (jht=25)
74:  *                   final eps output for angel
75:        parameter (jhs=26)
76:  *                   temporary file of gauss smearing fot contour plot
77:  *                   temporary new input file
78:  *                   temporary file for wtab
79:        parameter (jwt=71)
80:  *                   temporary file for wtab:
81:        parameter (jhm=72)
82:  *                   temporary file for w: wt:
83:        parameter (jha=73)
84:  *                   temporary file for aw:
85:        parameter (jhy=74)
86:  *                   temporary file for y-comment
87:
88:  *-----------------------------------------------------------------------

2.1.7. Makefile

In order to compile the ANGEL , you need to modify the makefile. Uncomment the options suitable for your environment. Then you can compile ANGEL by the “make” command.

List 1.12 • Makefile

 1:  #------------------------------------------------------------------------
 2:  #
 3:  #       @(#)Makefile  2002/08/06
 4:  #
 5:  #       Makefile for ANGEL
 6:  #
 7:  #------------------------------------------------------------------------
 8:  ##### sors #####
 9:  #------------------------------------------------------------------------
10:
11:  OBJ1 = \
12:        a-alone.o
13:
14:  OBJ2 = \
15:        a-main1.o  a-hsect.o  a-line.o  a-func.o  a-utl00.o  \
16:        a-main0.o  a-wtext.o  mdp-uni.o
17:
18:  #------------------------------------------------------------------------
19:  ##### set executable file name #####
20:  #------------------------------------------------------------------------
21:
22:  TERGET = angel400
23:
24:  #------------------------------------------------------------------------
25:  ##### set compile options #####
26:  #------------------------------------------------------------------------
27:  #Alpha
28:  # FFLAGS = -O4 -warn noalignments -warn nousage
29:  # FC = f77
30:  #------------------------------------------------------------------------
31:  #Linux pgf
32:    FFLAGS = -O4
33:    FC = pgf77
34:  #------------------------------------------------------------------------
35:  #Linux g77
36:  # FFLAGS = -O4 -fno-automatic
37:  # FC = g77
38:  #------------------------------------------------------------------------
39:  #Sun
40:  # FFLAGS = -O
41:  # FC = f90
42:  #------------------------------------------------------------------------
43:  #HP
44:  # FFLAGS = +DA1.1 +O0 +e +U77 +Onolimit
45:  # FC = f77
46:  #------------------------------------------------------------------------
47:
48:  MAKE    = Makefile
49:  CC      =  cc
50:  CFLAGS  = -O0
51:
52:  OBJS = $(OBJ1) $(OBJ2)
53:
54:  .f.o    :
55:          $(FC) $(FFLAGS) -c $*.f
56:  .c.o    :
57:          $(CC) $(CFLAGS) -c $*.c
58:
59:  all     :$(OBJS)
60:          $(FC) -o $(TERGET) $(OBJS)
61:
62:  $(OBJ1) : angel00.inc
63:  $(OBJ2) : angel01.inc
64:
65:  clean   :
66:          rm -f $(OBJS)