aboutsummaryrefslogtreecommitdiff
path: root/Abunplot.f
blob: 44a81c5d6f59916a5a55b87fb0daeacb5466dc51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272

      subroutine abunplot
c******************************************************************************
c     This routine produces MONGO plots of line abundances versus
c     excitation potentials and equivalent widths
c******************************************************************************

      implicit real*8 (a-h,o-z)
      include 'Atmos.com'
      include 'Linex.com'
      include 'Pstuff.com'
      include 'Dummy.com'
      real*4 ep(2500),abb(2500),logrw(2500),wavepl(2500)
      equivalence (ep,dummy3(1)),(abb,dummy3(1251)),(logrw,dummy3(2501))
      real*4 style(1),ymed
      character ion*4


c*****dump the data into working arrays
      j = 0
      do l=lim1obs,lim2obs
         if (abundout(l) .ne. 999.99) then
            j = j + 1
            ep(j) = e(l,1)
            abb(j) = abundout(l)
c           logrw(j) = dlog10(wid1comp(l)/wave1(l))
            logrw(j) = dlog10(width(l)/wave1(l))
            wavepl(j) = wave1(l)
         endif
      enddo


c*****find the plot boundaries for the excitation potential plot
      xlo = 20.
      do j=1,kount
         xlo = amin1(xlo,ep(j))
      enddo
      xhi =  0.
      do j=1,kount
         xhi = amax1(xhi,ep(j))
      enddo
      if (xhi-xlo .lt. 5.) then
         xlo = amax1((xlo+xhi)/2.-2.5,-0.2)
         xhi = xlo + 5.0
      else
         xlo = amax1((xlo+xhi)/2.-5.0,-0.2)
         xhi = xlo + 10.
      endif
      ylo = 20.
      do j=1,kount
         ylo = amin1(ylo,abb(j))
      enddo
      yhi = -20.
      do j=1,kount
         yhi = amax1(yhi,abb(j))
      enddo
      if (yhi-ylo .lt. 0.5) then
         ylo = (ylo+yhi)/2. - 0.30
         yhi = ylo + 0.60
      elseif (yhi-ylo .lt. 1.0) then
         ylo = (ylo+yhi)/2. - 0.55
         yhi = ylo + 1.10
      else
         ylo = (ylo+yhi)/2. - 1.10
         yhi = ylo + 2.20
      endif


c*****start the excitation potential plot via plot setup calls
      call sm_defvar ('y_gutter','0.9')
      call sm_window (1,3,1,3,1,3)
      call sm_limits (xlo,xhi,ylo,yhi)
      call findtic (xlo,xhi,bigxtic,smlxtic)
      call findtic (ylo,yhi,bigytic,smlytic)
      call sm_ticksize (smlxtic,bigxtic,smlytic,bigytic)


c*****draw and label the box for the excitation potential plot
      call defcolor (1)
      call sm_lweight (4.0)
      call sm_expand (1.2)
      call sm_box (0,0,0,0)
      call sm_lweight (2.0)
      call sm_expand (0.8)
      call sm_box (1,2,4,4)
      array = 'E. P. (eV)'
      call sm_relocate (0.5*(xlo+xhi),ylo-0.20*(yhi-ylo))
      call sm_putlabel (5,array)
      array = 'log eps'
      call sm_relocate (xlo-0.10*(xhi-xlo),0.5*(yhi+ylo))
      call sm_angle (90.)
      call sm_putlabel (5,array)
      call sm_angle (0.)

c*****make the excitation potential plot
      call defcolor (2)
      call sm_expand (2.2)
      style(1) = 43.5
      call sm_ptype (style,1) 
      call sm_points (ep,abb,kount)
      call defcolor (4)
      ymed = average
      call sm_lweight (4.0)
      call sm_ltype (2)
      call sm_relocate (xlo,ymed)
      call sm_draw (xhi,ymed)
      if (kount .gt. 2 .and. deltaep .gt. 1.5) then
         call sm_ltype (3)
         call defcolor (3)
         call sm_relocate (xlo,real(xxm1*xlo+xxb1)) 
         call sm_draw (xhi,real(xxm1*xhi+xxb1)) 
      endif
      call sm_ltype (0)
      call sm_lweight (2.0)
      call defcolor (1)
      call sm_relocate (xlo+0.05*(xhi-xlo),ylo+0.15*(yhi-ylo))
      call sm_expand (0.8)
      ich = idint(charge(lim1obs) + 0.1)
      if (ich .eq. 1) then 
         ion = ' I  '
      elseif (ich .eq. 2) then
         ion = ' II '
      elseif (ich .eq. 3) then
         ion = ' III'
      endif
      iatom = idint(atom1(lim1obs))
      write (array,1002) names(iatom),ion
      call sm_relocate ((xhi+xlo)/2.,yhi-0.12*(yhi-ylo))
      call sm_expand (0.8)
      call sm_putlabel (5,array)
   

c*****define the plot limits for the equivalent width plot
      xlo = 5000.
      do j=1,kount
         xlo = amin1(xlo,logrw(j))
      enddo
      xhi =  -5000.
      do j=1,kount
         xhi = amax1(xhi,logrw(j))
      enddo
      xlo = int((xlo-0.01)*2.-1.)/2.
      xhi = int((xhi+0.01)*2.)/2.
      call sm_defvar ('y_gutter','0.9')
      call sm_window (1,3,1,2,1,2)
      call sm_limits (xlo,xhi,ylo,yhi)
      call findtic (xlo,xhi,bigxtic,smlxtic)
      call findtic (ylo,yhi,bigytic,smlytic)
      call sm_ticksize (smlxtic,bigxtic,smlytic,bigytic)


c*****draw and label the box for the equivalent width plot
      call defcolor (1)
      call sm_lweight (4.0)
      call sm_expand (1.2)
      call sm_box (0,0,0,0)
      call sm_lweight (2.0)
      call sm_expand (0.8)
      call sm_box (1,2,4,4)
      array = 'log (EW/lambda)'
      call sm_relocate (0.5*(xlo+xhi),ylo-0.20*(yhi-ylo))
      call sm_putlabel (5,array)
      array = 'log eps'
      call sm_relocate (xlo-0.10*(xhi-xlo),0.5*(yhi+ylo))
      call sm_angle (90.)
      call sm_putlabel (5,array)
      call sm_angle (0.)


c*****make the equivalent width plot
      call defcolor (2)
      call sm_expand (2.2)
      style(1) = 43.5
      call sm_ptype (style,1)
      call sm_points (logrw,abb,kount)
      call defcolor (4)
      call sm_lweight (4.0)
      call sm_ltype (2)
      call sm_relocate (xlo,ymed)
      call sm_draw (xhi,ymed)
      if (kount .gt. 2 .and. deltarw .gt. 0.5) then
         call sm_ltype (3)
         call defcolor (3)
         call sm_relocate (xlo,real(xxm2*xlo+xxb2)) 
         call sm_draw (xhi,real(xxm2*xhi+xxb2)) 
      endif
      call sm_ltype (0)
      call sm_lweight (2.0)
      call defcolor (1)
      call sm_expand (0.8)
      call sm_relocate ((xhi+xlo)/2.,yhi-0.12*(yhi-ylo))
      call sm_putlabel (5,moditle(1:56))
      call sm_relocate ((xhi+xlo)/2.,ylo+0.12*(yhi-ylo))
      call sm_putlabel (5,moditle(57:80))


c*****define the plot limits for the wavelength plot
      xlo = 5000000.
      do j=1,kount
         xlo = amin1(xlo,wavepl(j))
      enddo
      xhi = 0.
      do j=1,kount
         xhi = amax1(xhi,wavepl(j))
      enddo
      xlo = int(xlo-50.)
      xhi = int(xhi+50.)
      call sm_defvar ('y_gutter','0.9')
      call sm_window (1,3,1,1,1,1)
      call sm_limits (xlo,xhi,ylo,yhi)
      call findtic (xlo,xhi,bigxtic,smlxtic)
      call findtic (ylo,yhi,bigytic,smlytic)
      call sm_ticksize (smlxtic,bigxtic,smlytic,bigytic)


c*****draw and label the box for the wavelength plot
      call defcolor (1)
      call sm_lweight (4.0)
      call sm_expand (1.2)
      call sm_box (0,0,0,0)
      call sm_lweight (2.0)
      call sm_expand (0.8)
      call sm_box (1,2,4,4)
      array = 'lambda (A)'
      call sm_relocate (0.5*(xlo+xhi),ylo-0.20*(yhi-ylo))
      call sm_putlabel (5,array)
      array = 'log eps' 
      call sm_relocate (xlo-0.10*(xhi-xlo),0.5*(yhi+ylo)) 
      call sm_angle (90.) 
      call sm_putlabel (5,array) 
      call sm_angle (0.) 


c*****make the wavelength plot, and exit normally
      call defcolor (2)
      call sm_expand (2.2)
      style(1) = 43.5 
      call sm_ptype (style,1)
      call sm_points (wavepl,abb,kount)
      call defcolor (4)
      call sm_relocate (xlo,ymed)
      call sm_lweight (4.0)
      call sm_ltype (2)
      call sm_draw (xhi,ymed)
      if (kount .gt. 2 .and. deltawv .gt. 500.) then
         call sm_ltype (3)
         call defcolor (3)
         call sm_relocate (xlo,real(xxm3*xlo+xxb3))
         call sm_draw (xhi,real(xxm3*xhi+xxb3))
      endif
      call sm_ltype (0)  
      call sm_lweight (2.0)
      call defcolor (1)
      call sm_relocate ((xhi+xlo)/2.,yhi-0.12*(yhi-ylo))
      call sm_expand (0.8)
      call sm_putlabel (5,linitle)
      return


c*****format statements
1002  format (a2,a4)


      end