The .ags files contain only standard ASCII text, and all lines are less than 80 characters long. The data fields within the files are strictly formatted, that is, unlike the .lvl files, the format of the fields is specified and use of any other format will generally make the file illegible by RadWare programs.
FORTRAN source code that could be used to write and read the .ags files is given in listings towards the end of this file. The equivalent C code can be found in the src/libs/gls directory, as subroutines read_write_gls and read_ascii_gls. The data fields written to the .ags and .gls files are declared in gls.h, or in GLS.CMN, which is also listed here.
The first five lines of a .ags file are reserved for a header comment; their contents are simply echoed to the output terminal of the reading program.
The sixth line specifies the format version to allow for future extensions, and must be set to:
ASCII GLS file format version 1.0Lines 7 through 12 specify fields such as the atomic number, numbers of levels, bands, gammas and text labels, default character sizes etc. Lines 7, 9 and 11 are simply comments that identify the fields contained in each of the following lines. The data are read with the following format:
55 FORMAT(/I5,4I8,3F10.2//F15.6,5F11.2//2F12.2,6F9.2)Lines 13 and 14 are comments to specify the data fields for each level. They are followed by one or two lines of data for each level in the scheme. These contain, for example, the energy, spin, parity, number of the band to which the level belongs, etc. Optional fields, to do with modified positions of spin-parity and level energy labels, and altered left/right ends of the level drawn with respect to the boundaries of the band, are given in the second line. This second line is to be present if and only if the first line ends in the characters ' &', placed immediately after the last data field, i.e. in characters 76 and 77. If this is not the case, default values are used for the optional data fields.
Three integer flags at the end of the first level data line deserve special mention. In the file, these are called LevelFlag, LabelFlag and EnLabFlag; in GLS.CMN they are declared as:
INTEGER LEVEL_FLAG(MAXLEV)
INTEGER L_LABEL_FLAG(MAXLEV), L_E_LABEL_FLAG(MAXLEV)
These flags define the appearance of the level and its spin-parity and energy
labels, as follows:
LEVEL_FLAG = 0 for normal level
1 for broken (tentative) level
2 for thick (e.g. isomeric) level
L_LABEL_FLAG = 0 for spin label = Jpi
1 for spin label = (J)pi
2 for spin label = J(pi)
3 for spin label = (Jpi)
4 for spin label = J
5 for spin label = (J)
6 for no spin label
L_E_LABEL_FLAG = 0 for no energy label
1 for energy label as nearest integer e.g. 123
2 for tentative nearest integer e.g. (123)
3 for one decimal place e.g. 123.4
4 for tentative, one decimal place e.g. (123.4)
The level data lines are read with the following format:
65 FORMAT(6X,F11.3,F8.3,A8,A6,I6,3I10,A2) (first line) 66 FORMAT(2X,6F10.2) (optional second line)Following the level data, there is a single comment line followed by a line of data for each band defined in the level scheme. The data for each band include the band name, position and width of the band in the drawing, and optional fields to do with level spin-parity/energy label positions. Each band data line is read with the following format:
75 FORMAT(5X,1X,A8,6F10.2)Next come three comment lines, identifying the gamma-ray data fields. Each gamma then has one, two or three lines of data. The second and third lines are optional; as for the level data lines, the second line must be present if and only if the first line ends in ' &' (in characters 63 and 64), and the third line must be present if and only if the second line is present and ends in ' &' (in characters 72 and 73).
The first gamma data line contains the energy and relative intensity, multipolarity, and initial and final level index numbers. It is read with the format:
85 FORMAT(6X,F11.3,F8.3,3X,A,I2,2I6,F11.4,F8.4,A2)The optional second gamma data line contains the Conversion coefficient, branching ratio and mixing ratio. If it is not present, default values are taken for the conversion coefficient (from Hager-Seltzer ICC tables) and the mixing ratio (zero). The branching ratio is ignored in RadWare programs, since it is generally taken directly from the intensities of the transitions. It is provided only for compatibility with other types of level scheme data files. The second line is read with the format:
86 FORMAT(2X,3(E13.5,E10.3),A2)The optional third gamma data line contains position information for the gamma ray and its energy label, if they are not to be drawn at their default positions. It is read with the format:
87 FORMAT(2X,4F10.2,2I10)Two integer flags at the end of the third gamma data line deserve special mention. In the file, these are called GammaFlag and LabelFlag; in GLS.CMN they are declared as:
INTEGER GAMMA_FLAG(MAXGAM), G_LABEL_FLAG(MAXGAM)These flags define the appearance of the gamma and its energy label, as follows:
GAMMA_FLAG = 0 for normal gamma
1 for broken (tentative) gamma
G_LABEL_FLAG = 0 for label as nearest integer e.g. 123
1 for tentative nearest integer e.g. (123)
2 for no label
3 for one decimal place e.g. 123.4
4 for tentative, one decimal place e.g. (123.4)
Last in the file are the data on any text labels used in the level scheme.
After an initial two-line comment, there are two lines of data for each label,
containing the text, number of characters, character sizes, and label position.
They are read with the format:
95 FORMAT(5X,2X,A40,I8/2X,4F10.2)
** ASCII Graphical Level Scheme file.
** First five lines are reserved for comments.
** This file created 22-AUG-96 11:50:48
** Program GLS, author D.C. Radford
**
ASCII GLS file format version 1.0
** Z Nlevels Ngammas Nbands Nlabels CharSizeX CharSizeY ArrowWidFact
67 18 36 4 2 40.00 45.00 3.00
** MaxArrowTan MaxArrowDX DefBandWid DefBandSep ArrowWidth ArrowLength
0.267900 999.00 350.00 100.00 30.00 60.00
** ArrowBreak LevelBreak LevCSX LevCSY LevEnCSX LevEnCSY GamCSX GamCSY
30.00 40.00 40.00 45.00 40.00 45.00 40.00 45.00
** Level Energy +/- err Jpi K Band# LevelFlag LabelFlag EnLabFlag
++ LabelDX LabelDY EnLabelDX EnLabelDY LevelDX1 LevelDX2
1 0.000 0.000 7/2- 0 1 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
2 210.033 0.040 11/2- 0 1 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
3 345.281 0.047 13/2- 0 2 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
4 499.616 0.049 15/2- 0 1 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
5 673.233 0.052 17/2- 0 2 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
6 863.705 0.055 19/2- 0 1 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
7 94.820 0.044 9/2- 0 2 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
8 1072.905 0.058 21/2- 0 2 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
9 1295.300 0.060 23/2- 0 1 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
10 1786.367 0.067 27/2- 0 1 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
11 1536.811 0.063 25/2- 0 2 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
12 1136.881 0.337 17/2- 0 3 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
13 1321.684 0.337 19/2- 0 4 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
14 1523.316 0.337 21/2- 0 3 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
15 1740.689 0.338 23/2- 0 4 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
16 969.378 0.337 15/2- 0 4 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
17 819.377 0.584 13/2- 0 3 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
18 688.717 0.640 11/2- 0 4 0 0 0 &
++ 0.00 0.00 0.00 0.00 0.00 0.00
** Band Name X0 NX LabelDX LabelDY EnLabelDX EnLabelDY
1 ho165a 27916.40 450.00 72.92 0.00 0.00 0.00
2 ho165b 28435.57 450.00 -71.66 0.00 0.00 0.00
3 Ho165c 29432.87 350.00 39.95 0.00 0.00 0.00
4 Ho165b 29832.90 350.00 -35.50 0.00 0.00 0.00
** Gamma Energy +/- err Mult ILev FLev Intensity +/- err
++ ConvCoef +/- error BrRatio +/- error MixRatio +/- error
++ GammaX1 GammaX2 LabelDX LabelDY GammaFlag LabelFlag
1 209.996 0.034 E 2 2 1 4.0450 0.1492 &
++ 0.20876E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56282.80 0.00 0.00 0 0
2 135.130 0.030 M 1 3 2 26.8236 0.8285 &
++ 0.11301E+01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56834.91 0.00 0.00 0 0
3 154.294 0.030 M 1 4 3 28.6106 0.8686 &
++ 0.77778E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56774.15 0.00 0.00 0 0
4 173.556 0.030 M 1 5 4 26.2193 0.7928 &
++ 0.55987E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56824.63 0.00 0.00 0 0
5 190.425 0.030 M 1 6 5 22.3524 0.6751 &
++ 0.43284E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56783.83 0.00 0.00 0 0
6 115.046 0.030 M 1 2 7 20.3988 0.7097 &
++ 0.17879E+01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56763.67 0.00 0.00 0 0
7 94.634 0.030 M 1 7 1 20.0000 0.0100 &
++ 0.31197E+01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56845.74 0.00 0.00 0 0
8 209.158 0.030 M 1 8 6 16.7276 0.5067 &
++ 0.33412E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56815.10 0.00 0.00 0 0
9 222.365 0.030 M 1 9 8 12.7343 0.3858 &
++ 0.28224E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56792.38 0.00 0.00 0 0
10 289.654 0.031 E 2 4 2 12.4140 0.3852 &
++ 0.74864E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56282.80 0.00 0.00 0 0
11 364.139 0.030 E 2 6 4 16.1308 0.4902 &
++ 0.37817E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56282.80 0.00 0.00 0 0
12 328.034 0.030 E 2 5 3 15.1664 0.4625 &
++ 0.51333E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 57321.14 0.00 0.00 0 0
13 250.452 0.031 E 2 3 7 9.3656 0.2972 &
++ 0.11773E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 57321.14 0.00 0.00 0 0
14 431.692 0.030 E 2 9 6 13.1524 0.3998 &
++ 0.23493E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56282.80 0.00 0.00 0 0
15 399.775 0.030 E 2 8 5 14.8525 0.4512 &
++ 0.29033E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 57321.14 0.00 0.00 0 0
16 491.108 0.031 E 2 10 9 7.0650 0.2173 &
++ 0.16640E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56282.80 0.00 0.00 0 0
17 463.970 0.031 E 2 11 8 9.8935 0.3020 &
++ 0.19339E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 57321.14 0.00 0.00 0 0
18 241.540 0.031 M 1 11 9 8.8071 0.2683 &
++ 0.22506E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56806.44 0.00 0.00 0 0
19 249.386 0.032 M 1 10 11 5.1498 0.1600 &
++ 0.20577E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 56799.66 0.00 0.00 0 0
20 184.930 0.033 M 1 13 12 2.0907 0.0822 &
++ 0.46903E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 59616.29 0.00 0.00 0 0
21 201.531 0.034 M 1 14 13 1.9312 0.0746 &
++ 0.36893E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 59615.77 0.00 0.00 0 0
22 217.310 0.034 M 1 15 14 1.9424 0.0742 &
++ 0.30012E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 59615.77 0.00 0.00 0 0
23 386.379 0.039 E 2 14 12 1.5752 0.0724 &
++ 0.31951E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 59215.74 0.00 0.00 0 0
24 418.702 0.043 E 2 15 13 1.3541 0.0655 &
++ 0.25469E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 60015.80 0.00 0.00 0 0
25 352.525 0.043 E 2 13 16 1.2000 0.0552 &
++ 0.41334E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 60015.80 0.00 0.00 0 0
26 167.518 0.033 M 1 12 16 1.6000 0.0637 &
++ 0.61698E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 59610.61 0.00 0.00 0 0
27 317.059 0.049 E 2 12 17 0.6000 0.0303 &
++ 0.56107E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 59215.74 0.00 0.00 0 0
28 149.391 0.036 M 1 16 17 0.8000 0.0373 &
++ 0.85138E+00 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 59625.62 0.00 0.00 0 0
29 280.294 0.123 E 2 16 18 0.1500 0.0172 &
++ 0.82240E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 60015.80 0.00 0.00 0 0
30 130.601 0.055 M 1 17 18 0.2100 0.0186 &
++ 0.12653E+01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 59600.74 0.00 0.00 0 0
31 759.235 0.049 E 2 16 2 1.0000 0.0590 &
++ 0.58373E-02 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 29335.57 29132.20 0.00 0.00 0 0
32 724.915 0.046 E 2 17 7 1.0000 0.0786 &
++ 0.64794E-02 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 29610.32 29416.31 0.00 0.00 0 0
33 791.657 0.053 E 2 12 3 0.8766 0.0522 &
++ 0.53150E-02 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 29241.61 29029.38 0.00 0.00 0 0
34 689.002 0.066 E 2 18 1 0.3500161.3821 &
++ 0.72799E-02 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 30004.93 29820.61 0.00 0.00 0 0
35 609.773 0.061 M 1 17 2 0.5500 0.0480 &
++ 0.20021E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 58702.50 0.00 0.00 0 0
36 594.500 1.000 M 1 18 7 0.1100 0.3084 &
++ 0.21392E-01 0.000E+00 0.00000E+00 0.000E+00 0.00000E+00 0.000E+00 &
++ 0.00 59506.70 0.00 0.00 0 0
** Label text NChars
++ SizeX SizeY PositionX PositionY
1 K=11/2 {gg}-vib 15 &
++ 60.00 65.00 29776.43 1956.54
2 7/2{u-}[523] 12 &
++ 60.00 65.00 28377.07 2021.91
INCLUDE 'LEVELS.PAR'
C LEVELS.PAR defines the max. allowable number of levels, gammas
C for example:
C PARAMETER (MAXLEV=600,MAXGAM=800,MAXEMIT=21)
C level definition-----------------
C levname=name of level
C levid=id number related to level spin
C levdata= 1)energy
C 2)energy error
C 3)spin
C 4)parity
C 5)K
CHARACTER*8 LEVNAME(MAXLEV)
INTEGER LEVID(MAXLEV)
REAL LEVDATA(MAXLEV,5)
C gamma definition------------------------
C gamid= 1)index pointer to initial level
C 2)index pointer to final level
C gamdata= 1)energy
C 2)energy error
C 3)intensity
C 4)intensity error
C 5)BR (branching ratio)
C 6)A (conversion coeffient)
C 7)D (mixing ratio)
C 8)delta A
C 9)delta D
C 10)delta BR
INTEGER GAMID(MAXGAM,2)
CHARACTER GAML(MAXGAM)
REAL GAMDATA(MAXGAM,10),GAMN(MAXGAM)
INTEGER LEVEL,GAMMA
COMMON /L/ LEVNAME,LEVID,LEVDATA,LEVEL,
+ GAMID,GAML,GAMDATA,GAMN,GAMMA
PARAMETER (MAXBAND=200)
INTEGER ATOMIC_NO, NBANDS, BAND(MAXLEV)
REAL GAMMA_X1(MAXGAM), GAMMA_X2(MAXGAM)
REAL BAND_X0(MAXBAND), BAND_NX(MAXBAND)
CHARACTER*8 BAND_NAME(MAXBAND)
COMMON /GLS/ ATOMIC_NO, GAMMA_X1, GAMMA_X2,
+ NBANDS, BAND_NAME, BAND_X0, BAND_NX, BAND
INTEGER LEVEMIT(MAXLEV,MAXEMIT)
COMMON /LEVEMIT/ LEVEMIT
C all figure distance units are in keV....
C gamma arrow widths = intensity*aspect_ratio (keV)...
REAL X0, HIX, Y0, HIY, TX0, THIX, TY0, THIY
REAL CSX, CSY, ASPECT_RATIO, MAX_TANGENT, MAX_DIST
REAL DEFAULT_WIDTH, DEFAULT_SEP
REAL ARROW_WIDTH, ARROW_LENGTH
REAL GAMMA_X(10,MAXGAM), GAMMA_Y(10,MAXGAM)
INTEGER GAMMA_NP(MAXGAM)
CHARACTER*10 G_LABEL(MAXGAM)
REAL G_LABEL_X(MAXGAM), G_LABEL_Y(MAXGAM)
INTEGER G_LABEL_NC(MAXGAM)
REAL LEVEL_X(4,MAXLEV), LEVEL_Y(MAXLEV)
REAL L_LABEL_X(MAXLEV), L_LABEL_Y(MAXLEV)
CHARACTER*12 L_LABEL(MAXLEV)
INTEGER L_LABEL_NC(MAXLEV)
LOGICAL B_LABEL_L(MAXBAND)
REAL B_LABEL_DX(MAXBAND)
REAL G_LABEL_DX(MAXGAM), G_LABEL_DY(MAXGAM)
REAL L_LABEL_DX(MAXLEV)
COMMON /GLS_FIG/ X0, HIX, Y0, HIY, TX0, THIX, TY0, THIY,
+ CSX, CSY, ASPECT_RATIO, MAX_TANGENT, MAX_DIST,
+ DEFAULT_WIDTH, DEFAULT_SEP,
+ ARROW_WIDTH, ARROW_LENGTH,
+ GAMMA_X, GAMMA_Y, GAMMA_NP,
+ G_LABEL, G_LABEL_X, G_LABEL_Y, G_LABEL_NC,
+ LEVEL_X, LEVEL_Y,
+ L_LABEL, L_LABEL_X, L_LABEL_Y, L_LABEL_NC,
+ B_LABEL_L, B_LABEL_DX, G_LABEL_DX, G_LABEL_DY,
+ L_LABEL_DX
C break distance in kev for tentative gammas, levels....
REAL ARROW_BREAK, LEVEL_BREAK
C character sizes for j(pi), level energy, gamma energy....
REAL L_CSX, L_CSY, L_E_CSX, L_E_CSY, G_CSX, G_CSY
C flags for tentative gammas, gamma energies....
INTEGER GAMMA_FLAG(MAXGAM), G_LABEL_FLAG(MAXGAM)
C flags for tentative levels....
INTEGER LEVEL_FLAG(MAXLEV)
C flags for tentative j(pi)'s, level energies....
INTEGER L_LABEL_FLAG(MAXLEV), L_E_LABEL_FLAG(MAXLEV)
CHARACTER*10 L_E_LABEL(MAXLEV)
INTEGER L_E_LABEL_NC(MAXLEV)
C horizontal offsets for stretching/shrinking levels....
REAL LEVEL_DX(2,MAXLEV)
C vertical offset for j(pi)....
REAL L_LABEL_DY(MAXLEV)
C horiz., vert. offsets, positions for level energies....
REAL L_E_LABEL_DX(MAXLEV), L_E_LABEL_DY(MAXLEV)
REAL L_E_LABEL_X(MAXLEV), L_E_LABEL_Y(MAXLEV)
C vertical offset for j(pi)
REAL B_LABEL_DY(MAXBAND)
C horizontal, vertical offsets for level energies....
REAL B_E_LABEL_DX(MAXBAND), B_E_LABEL_DY(MAXBAND)
C general purpose text labels....
INTEGER NTLABEL, TLABEL_NC(100)
CHARACTER*40 TLABEL(100)
REAL TCSX(100), TCSY(100)
REAL TLABEL_X(100), TLABEL_Y(100)
COMMON /GLS2/ ARROW_BREAK, LEVEL_BREAK, L_CSX, L_CSY, L_E_CSX,
+ L_E_CSY, G_CSX, G_CSY, GAMMA_FLAG, G_LABEL_FLAG,
+ LEVEL_FLAG, L_LABEL_FLAG, L_E_LABEL_FLAG,
+ L_E_LABEL, L_E_LABEL_NC, LEVEL_DX, L_LABEL_DY,
+ L_E_LABEL_DX, L_E_LABEL_DY, L_E_LABEL_X,
+ L_E_LABEL_Y, B_LABEL_DY, B_E_LABEL_DX,
+ B_E_LABEL_DY, NTLABEL, TLABEL_NC, TLABEL,
+ TCSX, TCSY, TLABEL_X, TLABEL_Y
COMMON /LUS/ IR,IW,IP,IG
SUBROUTINE READ_WRITE_GLS(COMMAND)
INCLUDE 'GLS.CMN'
CHARACTER*(*) COMMAND
CHARACTER*40 FILNAM
CHARACTER*20 DATTIM
CHARACTER*8 JPI
CHARACTER*6 KAY
C ask for and open level scheme file....
20 IF (COMMAND.EQ.'WRITE' .OR.
+ COMMAND.EQ.'WRITE_AGS') THEN
WRITE(IW,*)' Name for new GLS level scheme file = ?'
IF (COMMAND.EQ.'WRITE_AGS') THEN
CALL CASK(' (default .EXT = .gls, rtn to quit)',
+ FILNAM,NC)
IF (NC.EQ.0) RETURN
CALL SETEXT(FILNAM,'.gls',JEXT)
ELSE
CALL CASK(' (default .EXT = .gls, rtn to quit)',
+ FILNAM,NC)
IF (NC.EQ.0) RETURN
CALL SETEXT(FILNAM,'.gls',JEXT)
ENDIF
IF (COMMAND.EQ.'WRITE_AGS' .OR.
+ FILNAM(JEXT:JEXT+3).EQ.'.AGS' .OR.
+ FILNAM(JEXT:JEXT+3).EQ.'.ags') THEN
C write out ascii version of gls file (.ags file).....
CALL OPEN_PR_FILE(25,FILNAM)
CALL DATETIME(DATTIM)
WRITE (25,50) DATTIM
WRITE (25,55) ATOMIC_NO, LEVEL, GAMMA, NBANDS, NTLABEL,
+ CSX, CSY, ASPECT_RATIO, MAX_TANGENT, MAX_DIST,
+ DEFAULT_WIDTH, DEFAULT_SEP, ARROW_WIDTH,
+ ARROW_LENGTH, ARROW_BREAK, LEVEL_BREAK,
+ L_CSX, L_CSY, L_E_CSX, L_E_CSY, G_CSX, G_CSY
WRITE (25,60)
DO J = 1, LEVEL
J2 = NINT(2.0*LEVDATA(J,3))
J1 = J2/2
IF (J2.EQ.2*J1) THEN
WRITE(JPI,'(I7)') J1
ELSE
WRITE(JPI,'(I5)') J2
JPI(6:7) = '/2'
ENDIF
IF (LEVDATA(J,4).LT.0.0) THEN
JPI(8:8) = '-'
ELSE
JPI(8:8) = '+'
ENDIF
J2 = NINT(2.0*LEVDATA(J,5))
J1 = J2/2
IF (J2.EQ.2*J1) THEN
WRITE(KAY,'(I6)') J1
ELSE
WRITE(KAY,'(I4)') J2
KAY(5:6) = '/2'
ENDIF
WRITE (25,65) J, (LEVDATA(J,K),K=1,2), JPI, KAY, BAND(J),
+ LEVEL_FLAG(J), L_LABEL_FLAG(J), L_E_LABEL_FLAG(J),
+ L_LABEL_DX(J), L_LABEL_DY(J),
+ L_E_LABEL_DX(J), L_E_LABEL_DY(J),
+ LEVEL_DX(1,J), LEVEL_DX(2,J)
ENDDO
WRITE (25,70)
DO J = 1, NBANDS
WRITE (25,75) J, BAND_NAME(J), BAND_X0(J), BAND_NX(J),
+ B_LABEL_DX(J), B_LABEL_DY(J),
+ B_E_LABEL_DX(J), B_E_LABEL_DY(J)
ENDDO
WRITE (25,80)
DO J = 1, GAMMA
WRITE (25,85) J, GAMDATA(J,1), GAMDATA(J,2), GAML(J),
+ NINT(GAMN(J)), (GAMID(J,K),K=1,2),
+ GAMDATA(J,3), GAMDATA(J,4),
+ GAMDATA(J,6), GAMDATA(J,8), GAMDATA(J,5),
+ GAMDATA(J,10), GAMDATA(J,7), GAMDATA(J,9),
+ GAMMA_X1(J), GAMMA_X2(J),
+ G_LABEL_DX(J), G_LABEL_DY(J),
+ GAMMA_FLAG(J), G_LABEL_FLAG(J)
ENDDO
WRITE (25,90)
DO J = 1, NTLABEL
WRITE (25,95) J, TLABEL(J), TLABEL_NC(J),
+ TCSX(J), TCSY(J), TLABEL_X(J), TLABEL_Y(J)
ENDDO
50 FORMAT('** ASCII Graphical Level Scheme file.'/
+ '** First five lines are reserved for comments.'/
+ '** This file created ',A/
+ '** Program GLS, author D.C. Radford'/
+ '**'/
+ ' ASCII GLS file format version 1.0')
55 FORMAT(
+ '** Z Nlevels Ngammas Nbands Nlabels CharSizeX CharSizeY',
+ ' ArrowWidFact'/
+ I5,4I8,3F10.2/
+ '** MaxArrowTan MaxArrowDX DefBandWid DefBandSep ArrowWidth',
+ ' ArrowLength'/
+ F15.6,5F11.2/
+ '** ArrowBreak LevelBreak LevCSX LevCSY LevEnCSX LevEnCSY',
+ ' GamCSX GamCSY'/
+ 2F12.2, 6F9.2)
60 FORMAT('** Level Energy +/- err Jpi K Band#',
+ ' LevelFlag LabelFlag EnLabFlag'/
+ '++ LabelDX LabelDY EnLabelDX EnLabelDY LevelDX1 LevelDX2')
65 FORMAT(I6,F11.3,F8.3,A8,A6,I6,3I10,' &'/'++',6F10.2)
70 FORMAT('** Band Name X0 NX',
+ ' LabelDX LabelDY EnLabelDX EnLabelDY')
75 FORMAT(I5,1X,A8,6F10.2)
80 FORMAT(
+ '** Gamma Energy +/- err Mult ILev FLev Intensity +/- err'/
+ '++ ConvCoef +/- error BrRatio +/- error',
+ ' MixRatio +/- error'/
+ '++ GammaX1 GammaX2 LabelDX LabelDY GammaFlag LabelFlag')
85 FORMAT(I6,F11.3,F8.3,3X,A,I2,2I6,F11.4,F8.4,' &'/
+ '++',3(E13.5,E10.3),' &'/
+ '++',4F10.2,2I10)
90 FORMAT(
+ '** Label text NChars'/
+ '++ SizeX SizeY PositionX PositionY')
95 FORMAT(I5,2X,A40,I8,' &'/'++',4F10.2)
ELSE
C write out standard unformatted version of gls file.....
CALL OPEN_NEW_UNF(25,FILNAM,0,0)
WRITE (25) ATOMIC_NO, LEVEL, GAMMA, NBANDS,
+ CSX, CSY, ASPECT_RATIO, MAX_TANGENT, MAX_DIST,
+ DEFAULT_WIDTH, DEFAULT_SEP,
+ ARROW_WIDTH, ARROW_LENGTH
WRITE (25) ((LEVDATA(J,K),K=1,5), BAND(J), J=1,LEVEL),
+ ((GAMID(J,K),K=1,2), GAML(J),
+ (GAMDATA(J,K),K=1,10), GAMN(J),
+ GAMMA_X1(J), GAMMA_X2(J), J=1,GAMMA),
+ (BAND_NAME(J), BAND_X0(J), BAND_NX(J), J=1,NBANDS)
WRITE (25) (B_LABEL_DX(J), J=1,NBANDS),
+ (G_LABEL_DX(J), G_LABEL_DY(J), J=1,GAMMA),
+ (L_LABEL_DX(J), J=1,LEVEL)
WRITE (25) ARROW_BREAK, LEVEL_BREAK, L_CSX, L_CSY,
+ L_E_CSX, L_E_CSY, G_CSX, G_CSY, NTLABEL
WRITE (25) (GAMMA_FLAG(J), G_LABEL_FLAG(J), J=1,GAMMA),
+ (LEVEL_FLAG(J), L_LABEL_FLAG(J), L_E_LABEL_FLAG(J),
+ LEVEL_DX(1,J), LEVEL_DX(2,J), L_LABEL_DY(J),
+ L_E_LABEL_DX(J), L_E_LABEL_DY(J), J=1,LEVEL),
+ (B_LABEL_DY(J), B_E_LABEL_DX(J), B_E_LABEL_DY(J),
+ J=1,NBANDS)
WRITE (25) (TLABEL(J), TLABEL_NC(J), TCSX(J), TCSY(J),
+ TLABEL_X(J), TLABEL_Y(J), J=1,NTLABEL)
ENDIF
ELSEIF (COMMAND.EQ.'OPEN_READ') THEN
WRITE(IW,*)' Name of GLS level scheme file = ?'
CALL CASK( ' (default .EXT = .gls, rtn to quit)'
+ ,FILNAM,NC)
IF (NC.EQ.0) RETURN
CALL SETEXT(FILNAM,'.gls',JEXT)
IF (FILNAM(JEXT:JEXT+3).EQ.'.AGS' .OR.
+ FILNAM(JEXT:JEXT+3).EQ.'.ags') THEN
OPEN (25,FILE=FILNAM,STATUS='OLD',ERR=900)
CALL READ_ASCII_GLS
RETURN
ENDIF
OPEN (25,FILE=FILNAM,FORM='UNFORMATTED',STATUS='OLD',ERR=900)
READ (25) ATOMIC_NO, LEVEL, GAMMA, NBANDS,
+ CSX, CSY, ASPECT_RATIO, MAX_TANGENT, MAX_DIST,
+ DEFAULT_WIDTH, DEFAULT_SEP,
+ ARROW_WIDTH, ARROW_LENGTH
READ (25) ((LEVDATA(J,K),K=1,5), BAND(J), J=1,LEVEL),
+ ((GAMID(J,K),K=1,2), GAML(J),
+ (GAMDATA(J,K),K=1,10), GAMN(J),
+ GAMMA_X1(J), GAMMA_X2(J), J=1,GAMMA),
+ (BAND_NAME(J), BAND_X0(J), BAND_NX(J), J=1,NBANDS)
READ (25) (B_LABEL_DX(J), J=1,NBANDS),
+ (G_LABEL_DX(J), G_LABEL_DY(J), J=1,GAMMA),
+ (L_LABEL_DX(J), J=1,LEVEL)
READ (25, END=100) ARROW_BREAK, LEVEL_BREAK, L_CSX, L_CSY,
+ L_E_CSX, L_E_CSY, G_CSX, G_CSY, NTLABEL
READ (25) (GAMMA_FLAG(J), G_LABEL_FLAG(J), J=1,GAMMA),
+ (LEVEL_FLAG(J), L_LABEL_FLAG(J), L_E_LABEL_FLAG(J),
+ LEVEL_DX(1,J), LEVEL_DX(2,J), L_LABEL_DY(J),
+ L_E_LABEL_DX(J), L_E_LABEL_DY(J), J=1,LEVEL),
+ (B_LABEL_DY(J), B_E_LABEL_DX(J), B_E_LABEL_DY(J),
+ J=1,NBANDS)
READ (25) (TLABEL(J), TLABEL_NC(J), TCSX(J), TCSY(J),
+ TLABEL_X(J), TLABEL_Y(J), J=1,NTLABEL)
ELSEIF (COMMAND.EQ.'READ') THEN
READ (25) ATOMIC_NO, LEVEL, GAMMA, NBANDS,
+ CSX, CSY, ASPECT_RATIO, MAX_TANGENT, MAX_DIST,
+ DEFAULT_WIDTH, DEFAULT_SEP,
+ ARROW_WIDTH, ARROW_LENGTH
READ (25) ((LEVDATA(J,K),K=1,5), BAND(J), J=1,LEVEL),
+ ((GAMID(J,K),K=1,2), GAML(J),
+ (GAMDATA(J,K),K=1,10), GAMN(J),
+ GAMMA_X1(J), GAMMA_X2(J), J=1,GAMMA),
+ (BAND_NAME(J), BAND_X0(J), BAND_NX(J), J=1,NBANDS)
READ (25) (B_LABEL_DX(J), J=1,NBANDS),
+ (G_LABEL_DX(J), G_LABEL_DY(J), J=1,GAMMA),
+ (L_LABEL_DX(J), J=1,LEVEL)
READ (25, END=100) ARROW_BREAK, LEVEL_BREAK, L_CSX, L_CSY,
+ L_E_CSX, L_E_CSY, G_CSX, G_CSY, NTLABEL
READ (25) (GAMMA_FLAG(J), G_LABEL_FLAG(J), J=1,GAMMA),
+ (LEVEL_FLAG(J), L_LABEL_FLAG(J), L_E_LABEL_FLAG(J),
+ LEVEL_DX(1,J), LEVEL_DX(2,J), L_LABEL_DY(J),
+ L_E_LABEL_DX(J), L_E_LABEL_DY(J), J=1,LEVEL),
+ (B_LABEL_DY(J), B_E_LABEL_DX(J), B_E_LABEL_DY(J),
+ J=1,NBANDS)
READ (25) (TLABEL(J), TLABEL_NC(J), TCSX(J), TCSY(J),
+ TLABEL_X(J), TLABEL_Y(J), J=1,NTLABEL)
ENDIF
CLOSE(25)
RETURN
100 ARROW_BREAK = ARROW_WIDTH*0.75
LEVEL_BREAK = ARROW_WIDTH
L_CSX = CSX
L_CSY = CSY
L_E_CSX = CSX
L_E_CSY = CSY
G_CSX = CSX
G_CSY = CSY
NTLABEL = 0
DO J = 1, GAMMA
GAMMA_FLAG(J) = 0
G_LABEL_FLAG(J) = 0
ENDDO
DO J = 1, LEVEL
LEVEL_FLAG(J) = 0
L_LABEL_FLAG(J) = 0
L_E_LABEL_FLAG(J) = 0
LEVEL_DX(1,J) = 0.0
LEVEL_DX(2,J) = 0.0
L_LABEL_DY(J) = 0.0
L_E_LABEL_DX(J) = 0.0
L_E_LABEL_DY(J) = 0.0
ENDDO
DO J = 1, NBANDS
B_LABEL_DY(J) = 0.0
B_E_LABEL_DX(J) = 0.0
B_E_LABEL_DY(J) = 0.0
ENDDO
CLOSE(25)
RETURN
C error messages....
900 WRITE(IW,*) 'File ',FILNAM,' does not exist.'
GO TO 20
END
C=======================================================================
SUBROUTINE READ_ASCII_GLS
INCLUDE 'GLS.CMN'
CHARACTER*80 JUNK
CHARACTER*8 JPI
CHARACTER*6 KAY
CHARACTER*2 EOL
C read comments (first five lines of file) ....
WRITE (IW,*) 'Level Scheme File header:'
DO J = 1, 5
READ (25,50) JUNK
WRITE (IW,*) JUNK
ENDDO
READ (25,50) JUNK
IF (JUNK.NE.' ASCII GLS file format version 1.0') GO TO 900
C read data....
READ (25,55,ERR=900) ATOMIC_NO, LEVEL, GAMMA, NBANDS, NTLABEL,
+ CSX, CSY, ASPECT_RATIO, MAX_TANGENT, MAX_DIST,
+ DEFAULT_WIDTH, DEFAULT_SEP, ARROW_WIDTH,
+ ARROW_LENGTH, ARROW_BREAK, LEVEL_BREAK,
+ L_CSX, L_CSY, L_E_CSX, L_E_CSY, G_CSX, G_CSY
READ (25,50) JUNK
READ (25,50) JUNK
DO J = 1, LEVEL
READ (25,65,ERR=900) (LEVDATA(J,K),K=1,2), JPI, KAY,
+ BAND(J), LEVEL_FLAG(J), L_LABEL_FLAG(J),
+ L_E_LABEL_FLAG(J), EOL
IF (EOL.EQ.' &') THEN
READ (25,66,ERR=900) L_LABEL_DX(J), L_LABEL_DY(J),
+ L_E_LABEL_DX(J), L_E_LABEL_DY(J),
+ LEVEL_DX(1,J), LEVEL_DX(2,J)
ELSE
L_LABEL_DX(J) = 0.0
L_LABEL_DY(J) = 0.0
L_E_LABEL_DX(J) = 0.0
L_E_LABEL_DY(J) = 0.0
LEVEL_DX(1,J) = 0.0
LEVEL_DX(2,J) = 0.0
ENDIF
IF (JPI(6:7).EQ.'/2') THEN
READ(JPI,'(I5)') J1
LEVDATA(J,3) = FLOAT(J1)/2.0
ELSE
READ(JPI,'(I7)') J1
LEVDATA(J,3) = FLOAT(J1)
ENDIF
IF (JPI(8:8).EQ.'-') THEN
LEVDATA(J,4) = -1.0
ELSE
LEVDATA(J,4) = 1.0
ENDIF
IF (KAY(5:6).EQ.'/2') THEN
READ(KAY,'(I4)') J1
LEVDATA(J,5) = FLOAT(J1)/2.0
ELSE
READ(KAY,'(I6)') J1
LEVDATA(J,5) = FLOAT(J1)
ENDIF
ENDDO
READ (25,50) JUNK
DO J = 1, NBANDS
READ (25,75,ERR=900) BAND_NAME(J), BAND_X0(J), BAND_NX(J),
+ B_LABEL_DX(J), B_LABEL_DY(J),
+ B_E_LABEL_DX(J), B_E_LABEL_DY(J)
ENDDO
READ (25,50) JUNK
READ (25,50) JUNK
READ (25,50) JUNK
DO J = 1, GAMMA
READ (25,85,ERR=900) GAMDATA(J,1), GAMDATA(J,2), GAML(J), J1,
+ (GAMID(J,K),K=1,2), GAMDATA(J,3), GAMDATA(J,4), EOL
GAMN(J) = J1
IF (EOL.EQ.' &') THEN
READ (25,86,ERR=900)
+ GAMDATA(J,6), GAMDATA(J,8), GAMDATA(J,5),
+ GAMDATA(J,10), GAMDATA(J,7), GAMDATA(J,9), EOL
ELSE
DO K = 5, 10
GAMDATA(J,K) = 0.0
ENDDO
CALL CALC_ALPHA(J)
ENDIF
IF (EOL.EQ.' &') THEN
READ (25,87,ERR=900)
+ GAMMA_X1(J), GAMMA_X2(J),
+ G_LABEL_DX(J), G_LABEL_DY(J),
+ GAMMA_FLAG(J), G_LABEL_FLAG(J)
ELSE
GAMMA_X1(J) = 0.0
GAMMA_X2(J) = 0.0
G_LABEL_DX(J) = 0.0
G_LABEL_DY(J) = 0.0
GAMMA_FLAG(J) = 0
G_LABEL_FLAG(J) = 0
ENDIF
ENDDO
READ (25,50) JUNK
READ (25,50) JUNK
DO J = 1, NTLABEL
READ (25,95,ERR=900) TLABEL(J), TLABEL_NC(J),
+ TCSX(J), TCSY(J), TLABEL_X(J), TLABEL_Y(J)
ENDDO
CLOSE(25)
RETURN
50 FORMAT(A)
55 FORMAT(/I5,4I8,3F10.2//F15.6,5F11.2//2F12.2,6F9.2)
65 FORMAT(6X,F11.3,F8.3,A8,A6,I6,3I10,A2)
66 FORMAT(2X,6F10.2)
75 FORMAT(5X,1X,A8,6F10.2)
85 FORMAT(6X,F11.3,F8.3,3X,A,I2,2I6,F11.4,F8.4,A2)
86 FORMAT(2X,3(E13.5,E10.3),A2)
87 FORMAT(2X,4F10.2,2I10)
95 FORMAT(5X,2X,A40,I8/2X,4F10.2)
C error messages....
900 WRITE(IW,*) 'ERROR - cannot read ASCII gls file.'
RETURN
END