Next: PLOT
Up: Commands
Previous: IFELSE,
ENDIF
Write some data. The only difference between WRITE and PRINT
is the default destination which is OutFile for WRITE and
MsgFile for PRINT. Therefore, they are identical if FILE operand is
specified. Another difference is that errors in reading the command
cause abnormal termination for WRITE whereas the command is ignored
for PRINT.
[form-1: write beam data]WRITE
BEAM,
[FILE='file_name',]
[RIGHTLEFT,] [KIND=k,]
[INCP,] [SHORT]
;
- BEAM
- Write beam data.
-
- File reference number. See above for default.
- file_name
- New or old file name. Must be enclosed by apostrophes.
Either full path or relative path. Note that CAIN is run
in the directory cain/exec.
When file_name is specified, the input file reference number is ignored
and the file is opened with the reference number 98.
- SHORT
- Short format which fits to a wide screen.
Otherwise, use standard format (see Sec.3.3).
- RIGHTLEFT
- Write only either right-going
or left-going particles. Default=both.
- INCP
- Write particles created by incoherent processes (defined by
PPINT command).
Otherwise, normal particles only. If you want both, execute
the command twice.
- k
- Write only photon (k=1) or electron (k=2) or
positron (k=3) selectively. Default=all.
[form-2: write beam statistics data]
PRINT STATISTICS, [INCP,]
[SHORTLONG,]
[FILE=,]
;
- STATISTICS
- Write beam global data such as
number of particles, r.m.s. size, etc.
- SHORT
- Print only the number of macro- and real particles.
If none of SHORT and LONG is specified, print average
and r. m. s. of (t,x,y,s) and as well as
the average spin components.
- LONG
- Print max. and min. in addition to the standard items.
- INCP
- Include incoherent particles only.
Otherwise, normal particles only. If you want both, execute
the command twice.
-
- File reference number. See above for default.
[form-3: write cpu time so far]
PRINT CPUTIME, [LONG,]
[FILE=,] ;
- LONG
- Print cpu-time for individual major subroutines.
If not specfied, print only the total cpu-time.
[form-4: write values of parameters and expressions]
PRINT [PARAMETER,]
[FILE=,]
[, [, ]],
[FORMAT=(fmt),]
;
- PARAMETER
- Write values of (predefined
or user defined) parameters or expressions.
Can be omitted.
-
- File reference number. See above for default.
-
- Expressions .
It is safer to enclose each expression
by ( ) or [ ] or
{ }.
It is also possible to write a do-type sequence
of the form (almost like FORTRAN)
( ,,,i=,,)
where 's are expressions, i is a user-parameter
name (need not be defined by SET command), , ,
and are expressions for initial, final, and increment
values of i.
If is omitted, is adopted.
Note that
, , and are considered to be integers.
(Nint is applied.)
Do-type sequence may be nested as in FORTRAN.
The do-control variable must not duplicate, of course.
(Duplication within the sequence is checked but
possible interference with variables outside PRINT
or WRITE is not checked.)
- (fmt)
- Fortran format. Must be enclosed by
( ). CAIN does not check the grammer so that
a wrong format will cause an abnormal term by your
computer system.
Note that all the expressions are REAL*8. You cannot
use I-format.
If format is not specified, printed as
`expression=value' by 1PD15.8 (one line for each).
If format is given but there is no expression to be printed,
the format is executed as in FORTRAN. For example,
W RITE FORMAT=('nothing');
will cause `nothing' be printed.
Unfortunately, the grammer of CAIN does not allow an un-paired
apostrophe so that, for example, 1H' will cause an error.
Next: PLOT
Up: Commands
Previous: IFELSE,
ENDIF
Toshiaki Tauchi
Thu Dec 3 17:27:26 JST 1998