aboutsummaryrefslogtreecommitdiff
path: root/Molquery.f
blob: 2e33c4cf972742dd0994d78630f0c54618739521 (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

      subroutine molquery
c******************************************************************************
c     This routine discovers whether a species being analyzed in EW 
c     predicting of force-fitting mode is involved in molecular equilibrium 
c     (=M.E.) calculations as well; the variables is set appropriately
c******************************************************************************

      implicit real*8 (a-h,o-z)
      include 'Linex.com'
      include 'Mol.com'
      include 'Pstuff.com'

      molflag = 0
      iabatom = int(atom1(lim1obs)+0.0001)


c*****the species is an atom:
c*****search for it in the list of elements done in M.E.
      if (atom1(lim1line) < 100.) then
         if (neq == 0) then
            return
         else
            do n=1,neq
               if (iabatom == iorder(n)) molflag = 1
               return
            enddo
         endif


c*****the species is a molecule:
c*****halt if M.E. wasn't done or didn't include this species
      else
         if (neq == 0) then
            lscreen = lscreen + 2
            write (array,1001) iabatom
            call prinfo (lscreen)
            stop
         endif
         call sunder(atom1(lim1obs),ia,ib)
         iaa = ia
         ibb = ib
         do n=1,neq
            if (ia==iorder(n) .or. ib==iorder(n)) molflag = ia
         enddo
         if (molflag == 0) then
            lscreen = lscreen + 2
            write (array,1002) iabatom
            call prinfo (lscreen)
            stop
         endif
         molflag = 1

c*****if molecule is a hydride, the non-H element will be varied
         if (ia==1 .or. ib==1) then
            if (ia == 1) then
               iabatom = ib
            else
               iabatom = ia
            endif


c*****for other molecules, the user specifies which element will be varied
         else
            write (array,1003) iabatom
            nchars = 56
            call getnum (nchars,ikount+1,xnum,shortnum)
            iabatom = int(xnum+0.0001)
         
            if (iabatom/=ia .and. iabatom/=ib) then
               write (array,1003)
               stop
            endif
         endif
         return
      endif


c*****format statements
1001  format ('YOU FORGOT TO DO MOLECULAR EQUILIBRIUM FOR ',
     .        'SPECIES ', i3, '; I QUIT!')
1002  format ('YOUR MOLECULAR EQUILIBRIUM DOES NOT INCLUDE ',
     .        'THE ATOMS FOR SPECIES ', i3, '; I QUIT!')
1003  format ('LINES OF SPECIES ', i3, ' ARE NEXT: ',
     .        '   CHANGE ATOMIC NUMBER? ')


      end