File: main.F

package info (click to toggle)
aces3 3.0.6-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 82,460 kB
  • sloc: fortran: 225,647; ansic: 20,413; cpp: 4,349; makefile: 953; sh: 137
file content (235 lines) | stat: -rw-r--r-- 6,249 bytes parent folder | download
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

c This program takes command-line arguments and executes subroutines
c accordingly. Essentially, it is a shell environment for processing
c data generated by ACES2.

c#define _DIMARGS 3 /* 3 args required by jarec */
#define _DIMARGS 8 /* max number of JOBARC record tests */
#include "flags.h"

      program main
      implicit none

c INTERNAL VARIABLES
      integer dimargs, iuhf
      character*80 module
      character*80 args(_DIMARGS)

c COMMON BLOCKS
#include "icore.com"
#include "istart.com"
#include "flags.com"
#include "flags2.com"

c ----------------------------------------------------------------------

      dimargs = _DIMARGS
      call a2proc_init(module,args,dimargs)

      if ((module(1:5).eq.'help ').or.(module(1:3).eq.'-h ')) then
         print '()'
         print *, 'ACESII PROCESSOR LIST OF USEABLE MODULES'
         print *, '----------------------------------------'
         print *, 'factor <numb> [ <numb> [ <numb> [ ... ]]]'
         print *, 'mem <amount>'
         print *, 'test <file> [ <file> [ <file> [ ... ]]]'
         print *, 'molden'
c         print *, 'gennbo'
         print *, 'hyperchem'
         print *, 'extrap (energy|gradient)'
         print *, 'statthermo'
         print *, 'parfd (update|updump|dump|load <file>)'
         print *, 'jarec datatype RECNAME dimension'
         print *, 'jareq datatype RECNAME dimension (the quiet version)'
         print *, 'jasum'
         print *, 'xyz'
         print *, 'iosum'
         print *, 'clrdirty'
         print *, 'zerorec RECNAME [ RECNAME [ RECNAME [ ... ]]]'
         print *, 'rmfiles'
         print '()'
         stop
      end if

c ----------------------------------------------------------------------

c These modules require nothing from ACES.

      if (module(1:7).eq.'factor ') then
         call factor(args,dimargs)
         goto 9999
      end if
c
      if (module(1:11).eq.'PES_scan ') then
CSSS         Streamin   = .true.
CSSS         Stationary = .true.
CSSS         Drive_IRC  = .true.
C These must be providded the calling program.
      
         call pes_scan_main(.False., .False., .True.)
         goto 9998
      endif

c ----------------------------------------------------------------------

c These modules require JOBARC, but do not require heap space or lists.

      call aces_init_rte
      call aces_com_parallel_aces
      call aces_ja_init
      call getrec(1,'JOBARC','IFLAGS', 100,iflags)
      call getrec(1,'JOBARC','IFLAGS2',500,iflags2)

      if (module(1:6).eq.'jasum ') then
         call aces_ja_summary
         goto 9999
      end if

      if (module(1:8).eq.'zerorec ') then
         call zerorec(args,dimargs)
         goto 9999
      end if

      if (module(1:9).eq.'clrdirty ') then
         call putrec(0,'JOBARC','DIRTYFLG',1,0)
         print *, '@A2PROC: The dirty flag is clear.'
         goto 9999
      end if

      if (module(1:4).eq.'xyz ') then
         call xyz
         goto 9999
      end if

      if (module(1:4).eq.'mem ') then
         call mem(args,dimargs)
         goto 9999
      end if

c ----------------------------------------------------------------------

c These modules require heap space, but do not require lists.

      icrsiz = iflags(h_IFLAGS_mem)
      icore(1) = 0
      do while ((icore(1).eq.0).and.(icrsiz.gt.1000000))
         call aces_malloc(icrsiz,icore,i0)
         if (icore(1).eq.0) icrsiz = icrsiz - 1000000
      end do
      if (icore(1).eq.0) then
         print *, '@MAIN: unable to allocate at least ',
     &            1000000,' integers of memory'
         call aces_exit(1)
      end if
   
      call v2ja(icore(I0), icrsiz)

      if (module(1:5).eq.'test ') then
         call test(args,dimargs)
         goto 9998
      end if

      if (module(1:7).eq.'molden ') then
         call molden_main
         goto 9998
      end if

c This has not been audited.
c      if (module(1:7).eq.'gennbo ') then
c         call gennbo_main
c         goto 9998
c      end if

      if (module(1:10).eq.'hyperchem ') then
         call hyprchm_main
         goto 9998
      end if

      if (module(1:6).eq.'parfd ') then
         call parfd(args,dimargs)
         goto 9998
      end if

      if (module(1:6).eq.'jarec ') then
         call jarec(args,dimargs,.true.)
         goto 9998
      end if

      if (module(1:6).eq.'jareq ') then
         call jarec(args,dimargs,.false.)
         goto 9998
      end if

      if (module(1:7).eq.'extrap ') then
         call extrap_main(args, dimargs)
         goto 9998
      end if

      if (module(1:11).eq.'statthermo ') then
         call stat_thermo_main
         goto 9998
      endif 

      if (module(1:7).eq.'dplots ') then
         call den_plots_main(Icore(I0), icrsiz)
         goto 9998
      endif 
C
      if (module(1:7).eq.'a2rate ') then
         call a2rate_main(Icore(I0), icrsiz)
         goto 9998
      endif
C
      if (module(1:11).eq.'vrcoupling ') then
         call vib_rot_coupl(Icore(I0), icrsiz)
         goto 9998
      endif
C
      if (module(1:11).eq.'qta ') then
         call qntm_topl_main(Icore(I0), icrsiz)
         goto 9998
      endif
      
C
C      if (module(1:8).eq.'polyrate') then
C         call polyrate_main(Icore(I0), icrsiz)
C         goto 9998
C      endif
c ----------------------------------------------------------------------

c These modules require lists.

      call aces_io_init(icore,i0,icrsiz,.true.)

      if (module(1:6).eq.'iosum ') then
         call aces_io_summary
         goto 9997
      end if

      if (module(1:8).eq.'rmfiles ') then
         call aces_io_remove(50,'MOINTS')
         call aces_io_remove(51,'GAMLAM')
         call aces_io_remove(52,'MOABCD')
         call aces_io_remove(53,'DERINT')
         call aces_io_remove(54,'DERGAM')
         print *, '@A2PROC: Successfully removed list files.'
         goto 9997
      end if
c
      if (module(1:8) .eq. 'recovery') then
          call aces_init_chemsys
          call aces_io_recovery
          goto 9997
      endif
c ----------------------------------------------------------------------

 9997 continue
      call aces_io_fin
 9998 continue
c      call c_free(icore)
 9999 continue
      call aces_ja_fin
C
      call c_exit(0)
      end