-
Notifications
You must be signed in to change notification settings - Fork 0
/
schrq.f
924 lines (920 loc) · 35.9 KB
/
schrq.f
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
c***********************************************************************
c***** R.J. Le Roy subroutine SCHRQ, last modified 9 May 2015 ********
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c COPYRIGHT 2008-2014 by Robert J. Le Roy +
c Dept. of Chemistry, Univ. of Waterloo, Waterloo, Ontario, Canada +
c This software may not be sold or any other commercial use made +
c of it without the express written permission of the author. +
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** SCHRQ solves radial Schrodinger equation in dimensionless form
c d2WF/dR2 = - (E-V(R))*WF(R) , where WF(I) is the wave function.
c** Integrate by Numerov method over N mesh points with increment
c H=RH across range beginning at RMIN .
c** Input trial energy EO, eigenvalue convergence criterion EEPS
c potential asymptote VLIM, and all returned energies (EO, GAMA & VMAX)
c have units (cm-1).
c** On entry, the input potential V(I) must include the centrifugal
c term and the factor: 'BFCT'=2*mu*(2*pi*RH/hPLANCK)**2 (1/cm-1) ,
c which is also internally incorporated into EO, VLIM & EEPS.
c* Note that these reduced quantities (& the internal eigenvalue E)
c contain a factor of the squared integration increment RH**2 .
c This saves arithmetic work in the innermost loop of the algorithm.
c** For energy in (cm-1), BFCT=ZMU(u)*H(Angst)**2/16.857629206 (1/cm-1)
c** INNODE > 0 specifies that wavefx. initiates at RMIN with a node
c (normal default case); INNODE.le.0 specifies zero slope at
c RMIN (for finding symmetric eigenfunctions of symmetric potential
c with potential mid-point @ RMIN).
c** INNER specifies wave function matching condition: INNER = 0 makes
c matching of inward & outward solutions occur at outermost turning
c point; INNER > 0 makes matching occur at innermost turning point.
c * Normally use INNER=0 , but to find inner-well levels of double
c minimum potential, set INNER > 0 .
c----------------------------------------------------------------------
SUBROUTINE SCHRQ(KV,JROT,EO,GAMA,VMAX,VLIM,V,WF,BFCT,EEPS,RMIN,
1 RH,N,NBEG,NEND,INNODE,INNER,IWR,LPRWF)
c----------------------------------------------------------------------
c** Output vibrational quantum number KV, eigenvalue EO, normalized
c wave function WF(I), and range, NBEG .le. I .le. NEND over
c which WF(I) is defined. *** Have set WF(I)=0 outside this range.
c* (NBEG,NEND), defined by requiring abs(WF(I)) < RATST=1.D-9 outside.
c** If(LPRWF.gt.0) print wavefunction WF(I) every LPRWF-th point.
c* If(LPRWF.lt.0) "punch" (i.e., WRITE(10,XXX)) every |LPRWF|-th point
c of the wave function on disk starting at R(NBEG) with step size
c of IPSIQ=|LPRWF|*RH.
c** For energies above the potential asymptote VLIM, locate quasibound
c levels using Airy function boundary condition and return the level
c width GAMA and barrier height VMAX, as well as EO.
c** ERROR condition on return is KV < 0 ; usually KV=-1, but return
c KV=-2 if error appears to arise from too low trial energy.
c** If(IWR.ne.0) print error & warning descriptions
c If (IWR.gt.0) also print final eigenvalues & node count.
c If (IWR.ge.2) also show end-of-range wave function amplitudes
c If (IWR.ge.3) print also intermediate trial eigenvalues, etc.
c** If input KV.ge.998 , tries to find highest bound level, and
c trial energy should be only slightly less than VLIM.
c** If input KV < -10 , use log-derivative outer boundary condition at
c mesh point |KV| , based on incoming value of wave function WF(|KV|)
c and of the wavefunction derivative at that point, SPNEND, which is
c brought in as WF(|KV|-1). For a hard wall condition at mesh point
c |KV|, set WF(|KV|)=0 and WF(|KV|-1)= -1 before entry.
c----------------------------------------------------------------------
c++ "SCHRQ" calls subroutineas "QBOUND" and "WIDTH", and the latter
c++ calls "LEVQAD" .
c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INTEGER I,IBEGIN,ICOR,IJ,IJK,INNODE,INNER,IPSID,IQTST,IT,
1 ITER,ITP1,ITP1P,ITP3,IWR,J,JJ,J1,J2,JPSIQ,JQTST,JROT,
2 KKV,KV,KVIN,LPRWF,M,MS,MSAVE,N,NBEG,NDN,NEND,NLINES,NPR
REAL*8 BFCT,DE,DEP,DEPRN,DF,DOLD,DSOC,
2 E,EEPS,EO,EPS,F,FX,GAMA,GI,GN,H,HT,PROD,PPROD,
3 RATIN,RATOUT,RATST,RH,RINC,RMIN,RMINN,RR,RSTT,RWR(20),
4 WF(N),SB,SI,SM,SN,SNEND,SPNEND,SRTGI,SRTGN,SWR(20),
5 V(N),VLIM,VMAX,VMX,VPR,
6 WKBTST,XEND,XPR,XPW,DXPW,Y1,Y2,Y3,YIN,YM,YOUT
DATA RATST/1.D-9/,XPW/27.63d0/
DATA NDN/15/
c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DXPW= XPW/NDN
ICOR= 0
KVIN= KV
KV= -1
RMINN= RMIN-RH
GAMA= 0.d0
VMAX= VLIM
VMX= VMAX*BFCT
H= RH
HT= 1.d0/12.D+0
E= EO*BFCT
EPS= EEPS*BFCT
DSOC= VLIM*BFCT
DE= 0.d0
RATIN= 0.d0
RATOUT= 0.d0
IF(IWR.GT.2) THEN
IF(KVIN.GE.998) then
WRITE(6,610) EO
ELSE
WRITE(6,601) KVIN,JROT,EO,INNER
ENDIF
WRITE(6,602)
ENDIF
NEND= N
IF(KVIN.LT.-10) THEN
NEND= -KVIN
SNEND= WF(NEND)
SPNEND= WF(NEND-1)
ENDIF
JQTST = 0
c** Start iterative loop; try to converge for up to 30 iterations.
DO 90 IT= 1,30
ITER= IT
IF(INNER.GT.0) GO TO 38
10 IF(KVIN.LT.-10) THEN
c** If desired, (KVIN < -10) outer boundary set at NEND=|KVIN| and
c initialize wavefunction with log-derivative condition based on value
c WF(NEND) & derivative SPNEND at that mesh point (brought in in CALL)
GN= V(NEND)-E
GI= V(NEND-1)-E
SB= SNEND
SI= SB*(1.d0+ 0.5d0*GN)- RH*SPNEND
GO TO 24
END IF
IF(E.GE.DSOC) THEN
c** For quasibound levels, initialize wave function in "QBOUND"
CALL QBOUND(KVIN,JROT,E,EO,VMX,DSOC,V,RMIN,H,GN,GI,
1 SB,SI,N,ITP3,IWR,IQTST,BFCT,IT)
NEND= ITP3
VMAX= VMX/BFCT
IF(IQTST.GT.0) GO TO 24
IF(IQTST.LT.0) THEN
JQTST = JQTST+IQTST
IF((JQTST.LE.-2).OR.(VMAX.LT.VLIM)) GO TO 999
c** Try up to once to find level using trial value just below maximum
EO = VMAX-0.1D0
E = EO*BFCT
GO TO 90
ENDIF
GO TO 20
ENDIF
c** For E < DSOC begin inward integration by using JWKB to estimate
c optimum (minimum) inward starting point which will still give
c RATOUT < RATST = exp(-XPW) (ca. 1.d-9) [not needed after 1'st 2 ITER]
IF(ITER.LE.2) THEN
NEND= N
c ... first do rough inward search for outermost turning point
DO M= N,1,-NDN
MS= M
GI= V(M)- E
IF(GI.LE.0.D0) GO TO 12
GN= GI
ENDDO
IF(IWR.NE.0) WRITE(6,611) JROT,EO
GO TO 999
12 IF(MS.GE.N) GO TO 998
FX= GN/(GI-GN)
SM= 0.5d0*(1.d0+ FX)*DSQRT(GN)
MS= MS+ 2*NDN
IF(MS.GE.N) GO TO 20
c ... now integrate exponent till JWKB wave fx. would be negligible
DO M= MS,N,NDN
NEND= M
SM= SM+ DSQRT(V(M)- E)
IF(SM.GT.DXPW) EXIT
ENDDO
IF(NEND.LT.N) NEND= NEND+ NDN
ENDIF
c** For truly bound state initialize wave function as 1-st order WKB
c solution increasing inward
20 GN= V(NEND)- E
GI= V(NEND-1)- E
MS= NEND-1
IF(GI.LT.0.d0) GO TO 998
SRTGN= DSQRT(GN)
SRTGI= DSQRT(GI)
SB= 1.d0
SI= SB*DSQRT(SRTGN/SRTGI)*DEXP((SRTGN+SRTGI)*0.5d0)
IF(SB.GT.SI) THEN
c WOOPS - JWKB gives inward DEcreasing solution, so initialize with node
IF(IWR.NE.0) WRITE(6,618) JROT,EO,SB/SI
SI= 1.d0
SB= 0.d0
ENDIF
24 M= NEND-1
Y1= (1.d0-HT*GN)*SB
Y2= (1.d0-HT*GI)*SI
WF(NEND)= SB
WF(NEND-1)= SI
MS= NEND
IBEGIN= 3
IF(INNER.GT.0) IBEGIN= ITP1+2
c** Actual inward integration loop starts here
DO I= IBEGIN,NEND
M= M-1
Y3= Y2+Y2-Y1+GI*SI
GI= V(M)-E
SB= SI
SI= Y3/(1.d0-HT*GI)
WF(M)= SI
IF(DABS(SI).GE.1.D+17) THEN
c** Renormalize to prevent overflow of WF(I) in classically
c forbidden region where (V(I) .gt. E)
SI= 1.d0/SI
DO J= M,MS
WF(J)= WF(J)*SI
ENDDO
ccc MS= M
Y2= Y2*SI
Y3= Y3*SI
SB= SB*SI
SI= 1.d0
ENDIF
Y1= Y2
Y2= Y3
c** Test for outermost maximum of wave function.
c... old S{max} matching condition - turning point works OK & is simpler.
ccc IF((INNER.EQ.0).AND.(SI.LE.SB)) GO TO 32
c** Test for outermost well outer turning point
IF((INNER.EQ.0).AND.(GI.lt.0.d0)) GO TO 32
ENDDO
IF(INNER.EQ.0) THEN
c** Error mode ... inward propagation finds no turning point
KV= -2
IF(IWR.NE.0) WRITE(6,616) KV,JROT,EO
GO TO 999
ENDIF
c** Scale outer part of wave function before proceding
32 SI= 1.d0/SI
MSAVE= M
RR= RMINN+MSAVE*H
YIN= Y1*SI
RATOUT= WF(NEND)*SI
DO J= MSAVE,NEND
WF(J)= WF(J)*SI
ENDDO
IF(INNER.GT.0) GO TO 70
c-------------------------------------------------------------------
c** Set up to prepare for outward integration **********************
38 NBEG= 1
IF(INNODE.LE.0) THEN
c** Option to initialize with zero slope at beginning of the range
SB= 1.d0
GN= V(1)-E
Y1= SB*(1.d0-HT*GN)
Y2= Y1+GN*SB*0.5d0
GI= V(2)-E
SI= Y2/(1.d0-HT*GI)
ELSE
c** Initialize outward integration with a node at beginning of range
40 GN= V(NBEG)-E
IF(GN.GT.10.D0) THEN
c** If potential has [V(1)-E] so high that H is (locally) much too
c large, then shift inner starting point outward.
NBEG= NBEG+1
IF(NBEG.LT.N) GO TO 40
IF(IWR.NE.0) WRITE(6,613)
GO TO 999
ENDIF
IF((ITER.LE.1).AND.(IWR.NE.0)) THEN
IF(NBEG.GT.1) WRITE(6,609) JROT,EO,NBEG
IF(GN.LE.0.d0) WRITE(6,604) JROT,EO,NBEG,V(NBEG)/BFCT
ENDIF
c** Initialize outward wave function with a node: WF(NBEG) = 0.
SB= 0.d0
SI= 1.d0
GI= V(NBEG+1)-E
Y1= SB*(1.d0- HT*GN)
Y2= SI*(1.d0- HT*GI)
ENDIF
c
WF(NBEG)= SB
WF(NBEG+1)= SI
IF(INNER.GT.0) MSAVE= N
c** Actual outward integration loops start here
DO I= NBEG+2,MSAVE
Y3= Y2+Y2-Y1+GI*SI
GI= V(I)-E
SI= Y3/(1.d0- HT*GI)
WF(I)= SI
IF(DABS(SI).GE.1.D+17) THEN
c** Renormalize to prevent overflow of WF(I) in classically forbidden
c region where V(I) .gt. E
SI= 1.d0/SI
DO J= NBEG,I
WF(J)= WF(J)*SI
ENDDO
Y2= Y2*SI
Y3= Y3*SI
SI= 1.d0
ENDIF
Y1= Y2
Y2= Y3
ITP1= I
c** Exit from this loop at onset of classically allowed region
IF(GI.LE.0.d0) GO TO 52
ENDDO
MS= MSAVE
IF((INNER.EQ.0).AND.(GN.LE.0.d0)) GO TO 60
IF(IWR.NE.0) WRITE(6,612) KVIN,JROT,EO,MSAVE
GO TO 999
52 ITP1P= ITP1+1
MS= ITP1
IF(INNER.GT.0) GO TO 60
DO I= ITP1P,MSAVE
Y3= Y2+Y2-Y1+GI*SI
GI= V(I)-E
SI= Y3/(1.d0- HT*GI)
WF(I)= SI
IF(DABS(SI).GT.1.D+17) THEN
c** Renormalize to prevent overflow of WF(I) , as needed.
SI= 1.d0/SI
DO J= NBEG,I
WF(J)= WF(J)*SI
ENDDO
Y2= Y2*SI
Y3= Y3*SI
SI= 1.d0
ENDIF
Y1= Y2
Y2= Y3
ENDDO
MS= MSAVE
c** Finished outward integration. Normalize w.r.t. WF(MSAVE)
60 SI= 1.d0/SI
YOUT= Y1*SI
YM= Y2*SI
RATIN= WF(NBEG+1)*SI
DO I= NBEG,MS
WF(I)= WF(I)*SI
ENDDO
IF(INNER.GT.0) GO TO 10
c----- Finished numerical integration ... now correct trial energy
c** DF*H is the integral of (WF(I))**2 dR
70 DF= 0.d0
DO J= NBEG,NEND
DF= DF+WF(J)**2
ENDDO
c** Add edge correction to DF assuming wave function dies off as simple
c exponential past R(NEND); matters only if WF(NEND) unusually large.
IF((E.LE.DSOC).AND.(WF(NEND).NE.0)) THEN
IF((KVIN.GE.-10).AND.(WF(NEND-1)/WF(NEND).GT.1.d0))
1 DF= DF+ WF(NEND)**2/(2.d0*DLOG(WF(NEND-1)/WF(NEND)))
ENDIF
c... note that by construction, at this point WF(MSAVE)= 1.0
F= (-YOUT-YIN+2.d0*YM+GI)
DOLD= DE
IF(DABS(F).LE.1.D+30) THEN
DE= F/DF
ELSE
F= 9.9D+30
DF= F
DE= DABS(0.01D+0 *(DSOC-E))
ENDIF
IF(IWR.GT.2) THEN
DEPRN = DE/BFCT
XEND= RMINN+NEND*H
c** RATIN & RATOUT are wave fx. amplitude at inner/outer ends of range
c relative to its value at outermost extremum.
cc WRITE(6,603) IT,EO,F,DF,DEPRN,MSAVE,RR,RATIN,RATOUT,
cc 1 XEND,NBEG,ITP1
WRITE(6,603) IT,EO,DEPRN,MSAVE,RR,RATIN,RATOUT,
1 XEND,NBEG,ITP1
ENDIF
c** Test trial eigenvalue for convergence
IF(DABS(DE).LE.DABS(EPS)) GO TO 100
E= E+DE
c** KV.ge.999 Option ... Search for highest bound level. Adjust new
c trial energy downward if it would have been above dissociation.
IF((KVIN.GE.998).AND.(E.GT.VMX)) E= VMX- 2.d0*(VMX-E+DE)
EO= E/BFCT
IF((IT.GT.4).AND.(DABS(DE).GE.DABS(DOLD)).AND.
1 ((DOLD*DE).LE.0.d0)) THEN
c** Adjust energy increment if having convergence difficulties. Not
c usually needed except for some quasibounds extremely near VMAX .
ICOR= ICOR+1
DEP= DE/BFCT
IF(IWR.NE.0) WRITE(6,617) JROT,EO,IT,DEP
DE= 0.5d0*DE
E= E-DE
EO= E/BFCT
ENDIF
90 CONTINUE
c** End of iterative loop which searches for eigenvalue ************
c-------------------------------------------------------------------*
c** Convergence fails, so return in error condition
E= E-DE
EO= E/BFCT
DEPRN= DE/BFCT
IF(IWR.NE.0) WRITE(6,620) KVIN,JROT,ITER,DEPRN
GO TO 999
100 IF(IWR.NE.0) THEN
IF(IWR.GE.3) WRITE(6,619)
IF((DABS(RATIN).GT.RATST).AND.(INNODE.GT.0)
1 .AND.(RMIN.GT.0.d0)) WRITE(6,614) KVIN,JROT,EO,RATIN
IF((E.LT.DSOC).AND.(DABS(RATOUT).GT.RATST)) THEN
WKBTST=0.5d0*DABS(V(NEND)-V(NEND-1))/DSQRT((V(NEND)-E)**3)
IF(WKBTST.GT.1.d-3) WRITE(6,615) KVIN,JROT,EO,RATOUT,
1 RATST,WKBTST
ENDIF
ENDIF
KKV = 0
c** Perform node count on converged solution
PROD= WF(ITP1)*WF(ITP1-1)
J1= ITP1+1
J2= NEND-1
DO J= J1, J2
PPROD= PROD
PROD= WF(J)*WF(J-1)
IF((PPROD.LE.0.d0).AND.(PROD.GT.0.d0)) KKV= KKV+1
ENDDO
KV = KKV
c** Normalize & find interval (NBEG,NEND) where WF(I) is non-negligible
SN= 1.d0/DSQRT(H*DF)
DO I= NBEG,NEND
WF(I)= WF(I)*SN
ENDDO
IF(ITP1.LE.1) GO TO 122
J= ITP1P
DO I= 1,ITP1
J= J-1
IF(DABS(WF(J)).LT.RATST) GO TO 119
ENDDO
119 NBEG= J
IF(NBEG.LE.1) GO TO 122
J= J-1
DO I= 1,J
WF(I)= 0.d0
ENDDO
122 IF(KVIN.GE.-10) THEN
c** For "non-wall" cases, move NEND inward to where wavefunction
c "non-negligible"
J= NEND-1
DO I= NBEG,NEND
IF(DABS(WF(J)).GT.RATST) GO TO 126
J= J-1
ENDDO
126 NEND= J+1
END IF
IF(NEND.LT.N) THEN
c** Zero out wavefunction array at distances past NEND
DO I= NEND+1,N
WF(I)= 0.d0
ENDDO
ENDIF
IF(LPRWF.LT.0) THEN
c** If desired, write every |LPRWF|-th point of the wave function
c to a file on channel-10, starting at the NBEG-th mesh point.
JPSIQ= -LPRWF
NPR= 1+(NEND-NBEG)/JPSIQ
RINC= RH*JPSIQ
RSTT= RMINN+NBEG*RH
c** Write every JPSIQ-th point of the wave function for level v=KV
c J=JROT , beginning at mesh point NBEG & distance RSTT where
c the NPR values written separated by mesh step RINC=JPSIQ*RH
WRITE(10,701) KV,JROT,EO,NPR,RSTT,RINC,NBEG,JPSIQ
WRITE(10,702) (RMINN+I*RH,WF(I),I=NBEG,NEND,JPSIQ)
GO TO 140
ENDIF
c** Print solutions every LPRWF-th point, 6 to a line, in columns.
IF(LPRWF.GT.0) THEN
NLINES= ((1+(NEND-NBEG)/LPRWF)+3)/4
IPSID= LPRWF*NLINES
WRITE(6,605) KV,JROT,EO
DO J= 1,NLINES
JJ= NBEG+(J-1)*LPRWF
IJK= 0
DO IJ= JJ,NEND,IPSID
IJK= IJK+1
RWR(IJK)= RMINN+IJ*H
SWR(IJK)= WF(IJ)
ENDDO
WRITE(6,606) (RWR(I),SWR(I),I= 1,IJK)
ENDDO
ENDIF
140 IF(IWR.EQ.1) WRITE(6,607) KV,JROT,EO
IF(IWR.GE.2) WRITE(6,607) KV,JROT,EO,ITER,RR,NBEG,RATIN,INNER,
1 NEND,RATOUT
c** For quasibound levels, calculate width in subroutine "WIDTH"
IF((E.GT.DSOC).AND.(KVIN.GT.-10)) CALL WIDTH(KV,JROT,E,EO,DSOC,
1 V,WF,VMX,RMIN,H,BFCT,IWR,ITP1,ITP3,INNER,N,GAMA)
RETURN
c** ERROR condition if E.gt.V(R) at outer end of integration range.
998 XPR= RMINN+MS*H
VPR= V(MS)/BFCT
IF(IWR.NE.0) WRITE(6,608) EO,MS,VPR,XPR,IT
c** Return in error mode
999 KV= -1
RETURN
601 FORMAT(/' Solve for v=',I3,' J=',I3,' ETRIAL=',1PD15.7,
1 ' INNER=',i2)
cc602 FORMAT(' ITER ETRIAL',8X,'F(E) DF(E) D(E)',
cc 1 6X,'M R(M) /WF(M) /WF(M) R(NEND) NBEG ITP1'/
cc 2 1X,99('-'))
602 FORMAT(' ITER ETRIAL',7X,'D(E) M r(M) wf(1)/wf(M) wf(NE
1ND)/wf(M) R(NEND) NBEG ITP1'/1X,85('-'))
603 FORMAT(I4,1PD15.7,D10.2,0P,I7,F7.2,1P2D9.1,0PF8.2,I5,I5)
604 FORMAT(' NOTE: for J=',I3,' EO=',F12.4,' .ge. V(',i3,')=',
1 F12.4)
605 FORMAT(/' Solution of radial Schr. equation for E(v=',I3,',J=',
1 I3,') =',F15.7/2x,4(' R(I) WF(I) ')/2X,38('--') )
606 FORMAT(2X,4(F8.3,F11.7))
607 FORMAT('E(v=',I3,',J=',I3,')=',F11.4,I4,' Iter R(M)=',F6.2,
1 ' WF(NBEG=',i6,')/WF(M)=',1PD8.1/36x,'INNER=',I2,6x,
2 'WF(NEND=',i6,')/WF(M)=',D8.1)
608 FORMAT(' *** SCHRQ Error: E=',F9.2,' > V(',I6,')=',F9.2,
1 ' at Rmax=',F6.2,' for IT=',I2)
609 FORMAT(' *** For J=',I3,' E=',1PD15.7," integration can't",
1 ' start till past mesh'/37x,'point',I5,', so RMIN smaller than n
2eeded')
610 FORMAT(/' Attempt to find the highest bound level starting from',
1 ' ETRIAL =',1PD9.2)
611 FORMAT(' *** SCHRQ inward search at J=',i3,' E=',f11.2,
1 ' finds no classical region')
612 FORMAT(/' *** ERROR *** for v =',I3,' J =',I3,' E =',
1 F12.4,' Innermost turning point not found by M = MSAVE =',I5)
613 FORMAT(/' *** ERROR in potential array ... V(I) everywhere',
1 ' too big to integrate with given increment')
614 FORMAT(' ****** For v=',I3,', J=',I3,' E=',G15.8/16x,
1 'WF(first)/WF(Max)=',D9.2,' suggests RMIN may be too large')
615 FORMAT(' ****** For v=',I3,',J=',I3,' E=',1PD13.6,
1 ' WF(NEND)/WF(Max)=',D8.1,' >',D8.1/4X,'& initialization ',
2 'quality test ',1PD8.1,' > 1.D-3 so RMAX may be too small')
616 FORMAT(' ** WARNING *** For v=',I2,', J=',I3,' at E=',G14.7,
1 ': inward propagation finds no turning point ... Energy too low
2 or potential too weak' )
617 FORMAT(' ** @ J=',I3,' E=',1PD9.2,' SCHRQ has cgce prob at IT=',
1 0P,I3,', so halve DE=',1PD10.2 )
618 FORMAT(' *** For J=',I3,' E=',F9.2,' JWKB start gives SB/SI=',
1 1PD10.3,' so use a node.')
619 FORMAT(1X,99('-'))
620 FORMAT(' *** CAUTION for v=',I3,' J=',I3," SCHRQ doesn't conver
1ge by ITER=",I2,' DE=',1PD9.2)
701 FORMAT(/2x,'Level v=',I3,' J=',I3,' E=',F12.4,' , wave funct
1ion at',I6,' points.'/7x,'R(1-st)=',F12.8,' mesh=',F12.8,
2 ' NBEG=',I4,' |LPRWF|=',I3)
702 FORMAT((1X,4(0Pf9.4,1PD13.5)))
END
c23456789 123456789 123456789 123456789 123456789 123456789 123456789 12
c***********************************************************************
SUBROUTINE QBOUND(KV,JROT,E,EO,VMX,DSOC,V,RMIN,H,GB,GI,SB,SI,N,
1 ITP3,IWR,IQTST,BFCT,IT)
c***********************************************************************
c** Subroutine to initialize quasibound level wave function as Airy
c function at third turning point (if possible). For the theory see
c J.Chem.Phys. 54, 5114 (1971), J.Chem.Phys. 69, 3622-31 (1978)
c----------------------------------------------------------------------
c** IQTST is error flag. *** If (IQTST.lt.0) initialization fails
c so eigenvalue calculation aborts *** (IQTST.gt.0) for successful
c Airy function initialization. *** (IQTST=0) if Airy function
c initialization prevented because 3-rd turning point beyond
c range, so that WKB initialization is used.
c----------------------------------------------------------------------
INTEGER I,II,IQTST,IT,ITP3,IWR,J,JROT,K,KV,N
REAL*8 A1,A2,A13,A23,BFCT,
1 C1A,C2A,DF,DSOC,E,EO,FBA,FIA,FJ,GB,GBA,GI,GIA,H,
2 RMIN,RMINN,SB,SI,SL,V(N),VMX,VMXPR,XJ1
DATA C1A/0.355028053887817D0/,C2A/0.258819403792807D0/
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IQTST=1
RMINN=RMIN-H
c** Start by searching for third turning point.
J=N
IF(V(N).GT.E) GO TO 22
DO I=2,N
J=J-1
IF(V(J).GT.E) GO TO 10
ENDDO
GO TO 14
10 II=J
c** Check that there is a classically allowed region inside this point
c and determine height of barrier maximum.
VMX=DSOC
DO I=2,J
II=II-1
IF(V(II).LE.E) GO TO 16
IF(V(II).GT.VMX) VMX=V(II)
ENDDO
c** Energy too high ... find no more than one turning point.
14 XJ1=RMINN+J*H
c ... Search outward for barrier height to facilitate energy correction
IF(J.EQ.1) J= 2
K=J-1
DO I=J,N
IF(V(I).GT.V(K)) GO TO 120
K=I
ENDDO
VMX=V(K)
GO TO 130
120 K=K+2
J=K-1
DO I=K,N
IF(V(I).LT.V(J)) GO TO 126
J=I
ENDDO
126 VMX=V(J)
130 VMXPR=VMX/BFCT
IF(IWR.NE.0) WRITE(6,608) JROT,EO,VMXPR,XJ1
ITP3= J
IQTST=-1
GO TO 100
16 ITP3= J+1
c** ITP3 is the first mesh point outside classically forbidden region
GB=V(ITP3)-E
GI=V(ITP3-1)-E
FJ=GI/(GI-GB)
c** Treat quasibound levels as bound using outer boundary condition
c of Airy function at third turning point ... as discussed by
c R.J.Le Roy and R.B.Bernstein in J.Chem.Phys. 54,5114(1971).
c Uses series expansions of Abramowitz & Stegun Eq.(10.4.3)
SL=(GI-GB)**(1.d0/3.d0)/H
IF((SL*H).LT.1.d0) THEN
A1=GI/(SL*H)**2
A2=GB/(SL*H)**2
A13=A1*A1*A1
A23=A2*A2*A2
FIA= 1.d0+ A13*(A13*(A13+72.D0)+2160.D0)/12960.D0
GIA=A1+A1*A13*(A13*(A13+90.D0)+3780.D0)/45360.D0
FBA= 1.d0+ A23*(A23*(A23+72.D0)+2160.D0)/12960.D0
GBA=A2+A2*A23*(A23*(A23+90.D0)+3780.D0)/45360.D0
c** Airy function Bi(X) at points straddling 3-rd turning point
SI=C1A*FIA+C2A*GIA
SB=C1A*FBA+C2A*GBA
GO TO 100
ENDIF
c** If Airy function expansion unreliable, use zero slope at third
c turning point as quasibound outer boundary condition.
DF=GI-GB
SI= 1.d0+ DF*FJ**3/6.d0
SB= 1.d0 -DF*(1.d0- FJ)**3/6.d0
IF(IWR.NE.0) WRITE(6,606) KV,JROT,EO,IT
GO TO 100
c** If 3-rd turning point beyond range start with WKB wave function
c at end of range.
22 IF(IWR.NE.0) WRITE(6,607) JROT,EO
ITP3= N
IQTST=0
GB=V(ITP3)-E
GI=V(ITP3-1)-E
VMX=V(ITP3)
II=ITP3
DO I=2,ITP3
II=II-1
IF(V(II).LT.VMX) GO TO 100
VMX=V(II)
ENDDO
IF(IWR.NE.0) WRITE(6,604)
c** End of quasibound level initialization schemes.
IQTST=-9
100 RETURN
604 FORMAT(" **** QBOUND doesn't work ... no classically allowed regio
1n accessible at this energy.")
606 FORMAT(' *** CAUTION *** v=',I3,' J=',I3,' E=',1PD13.6,
1 ' IT=',I2/5x,'Airy initialization unstable so use zero slope',
2 'at R(3-rd)' )
607 FORMAT(' *** For J=',I3,' E=',F9.2,
1 ' R(3-rd) > RMAX & E < V(N) so try WKB B.C. @ RMAX')
608 FORMAT(' For J=',I3,' ETRY=',F11.4,' > VMAX=',F11.4,
1 ' find onee turn point: R=',F6.2)
END
c23456789 123456789 123456789 123456789 123456789 123456789 123456789 12
c***********************************************************************
c** Subroutine to calculates quasibound level tunneling lifetime/width
c** For relevant theory see Le Roy & Liu [J.Chem.Phys.69,3622-31(1978)]
c and Connor & Smith [Mol.Phys. 43, 397 (1981)] and Huang & Le Roy
c [J.Chem.Phys. 119, 7398 (2003); Erratum, ibid, 126, 169904 (2007)]
c** Final level width calculation from Eq.(4.5) of Connor & Smith.
c Rearranged slightly for consistency with PotFit derivatives 9/05/02
c-----------------------------------------------------------------------
SUBROUTINE WIDTH(KV,JROT,E,EO,DSOC,V,S,VMX,RMIN,H,BFCT,IWR,ITP1,
1 ITP3,INNER,N,GAMA)
c++ "WIDTH" calls subroutine "LEVQAD" ++++++++++++++++++++++++++++++++++
c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INTEGER I,IMM,INNER,IRM,ITP1,ITP1P,ITP1P1,ITP2,ITP2M,ITP2M2,
1 ITP2P1,ITP2P2,ITP3,IWR,JROT,KV,KVI,KVO,
2 M,M2,N,NN,NST
REAL*8 ANS1,ANS2,ARG,BFCT,COR,
1 D1,D2,D3,DFI,DSGB,DSGN,DSOC,DWEB,OMEGJC,
2 E,EO,EMSC,EMV,G1,G2,G3,GA,GAMA,GAMALG,
3 H,H2,HBW,HBWB,PI,PMX,RMIN,RMINN,RMX,RT,RT1,RT2,
4 S(N),SM,TAU,TAULG,TI,TUN0,U1,U2,V(N),VMAX,VMX,
7 XJ,XX
CHARACTER*5 LWELL(2)
DATA PI/3.141592653589793D0/
DATA LWELL/'INNER','OUTER'/
RMINN= RMIN- H
H2= H*H
c** ITP1 is first mesh point to right of innermost turning point.
40 ITP1P= ITP1+ 1
ITP1P1= ITP1P+ 1
IRM= ITP1- 1
c** Calculate JWKB tunneling probability from quadrature over barrier
c** First must locate 2-nd turning point.
DO I= ITP1P1,ITP3
ITP2= I
IF(V(I).GT.E) GO TO 202
ENDDO
GAMA= 0.d0
GO TO 250
202 ITP2P1= ITP2+ 1
ITP2P2= ITP2+ 2
c** ITP2M is the last mesh point before the 2-nd turning point.
ITP2M= ITP2- 1
ITP2M2= ITP2- 2
G1= V(ITP2M)- E
G2= V(ITP2)- E
GA= V(ITP2P1)- E
c** Quadrature over barrier starts here.
CALL LEVQAD(G1,G2,GA,H,RT,ANS1,ANS2)
SM= ANS2/H
IF(GA.LT.0.d0) GO TO 218
SM= SM+ 0.5d0*DSQRT(GA)
PMX= VMX
M2= ITP2P2
204 DO I=M2,ITP3
M= I
GA= V(I)- E
IF(V(I).GT.PMX) PMX=V(I)
IF(GA.LT.0.d0) GO TO 210
SM= SM+ DSQRT(GA)
ENDDO
IF(V(M).GT.V(M-1)) THEN
IF(IWR.NE.0) WRITE(6,602) KV,JROT
GO TO 250
ENDIF
RMX= RMINN+ M*H
U1= DSQRT(GA/(V(M)- DSOC))
U2= DSQRT((E- DSOC)/(V(M)- DSOC))
SM= SM- 0.5d0*DSQRT(GA)+ (DLOG((1.d0+U1)/U2)-U1)*RMX*
1 DSQRT(V(M)- DSOC)/H
XJ= (DSQRT(1.d0+ 4.d0*(V(M)-DSOC)*(RMX/H)**2)- 1.d0)*0.5d0
IF(IWR.NE.0) WRITE(6,603) JROT,EO,XJ,RMX
GO TO 218
210 IF(M.LT.ITP3) THEN
c** If encounter a double-humped barrier, take care here.
IF(IWR.NE.0) WRITE(6,609) KV,JROT,EO,M
KVO= 0
DSGN= DSIGN(1.d0,S(M-1))
c** Find the effective quantum number for the outer well
DO I= M,ITP3
DSGB= DSGN
DSGN= DSIGN(1.d0,S(I))
IF((DSGN*DSGB).LT.0.d0) KVO=KVO+1
ENDDO
KVI= KV- KVO
IF(INNER.EQ.0) THEN
c** For levels of outer well, get correct width by changing ITP1
ITP1= M
IF(IWR.GT.0) WRITE(6,610) KVO,LWELL(2)
GO TO 40
ENDIF
IF(IWR.GT.0) WRITE(6,610) KVI,LWELL(1)
c** For "inner-well" levels, locate outer barrier
DO I= M,ITP3
M2= I
GA= V(I)- E
IF(GA.GE.0.d0) GO TO 204
ENDDO
GO TO 218
ENDIF
G3= V(M-2)- E
G2= V(M-1)- E
CALL LEVQAD(GA,G2,G3,H,RT,ANS1,ANS2)
SM= SM- 0.5d0*DSQRT(G3)-DSQRT(G2) + ANS2/H
218 EMSC= -SM/PI
IF(INNER.GT.0) VMX= PMX
VMAX= VMX/BFCT
c** Tunneling factors calculated here ** TUN0 is simple WKB result
c as in Child's eqs.(57c) & (59).
c ..... EPSRJ= -2.* PI* EMSC
TUN0= 0.5d0*DEXP(2.d0*PI*EMSC)
c ... for permeability calculate Connor-Smith's Eq.(3.7) \omega=OMEGJC
OMEGJC= DSQRT(1.d0+ 2.d0*TUN0) - 1.d0
c ... alternate calculation to give better precision for small TUN0
IF(TUN0.LT.1.d-5) OMEGJC= TUN0*(1.d0-0.5d0*TUN0*(1.d0-TUN0))
OMEGJC= 4.d0*OMEGJC/(OMEGJC + 2.d0)
c** Quadrature for JWKB calculation of vibrational spacing in well HBW
D1= E- V(IRM)
D2= E- V(ITP1)
D3= E- V(ITP1P)
CALL LEVQAD(D1,D2,D3,H,RT,ANS1,ANS2)
RT1= RT
SM= ANS1/H
IF(D3.LT.0.d0) GO TO 228
SM= SM+ 0.5d0/DSQRT(D3)
DO I= ITP1P1,ITP2M2
IMM= I
EMV= E- V(I)
IF(EMV.LT.0.d0) GO TO 222
SM= SM+ 1.d0/DSQRT(EMV)
ENDDO
D3= E- V(ITP2M2)
D2= E- V(ITP2M)
D1= E- V(ITP2)
GO TO 226
c** If encounter a double-minimum well, take care here.
222 D1= EMV
D2= E- V(IMM-1)
D3= E- V(IMM-2)
IF(IWR.NE.0) WRITE(6,605) KV,JROT,EO
226 CALL LEVQAD(D1,D2,D3,H,RT,ANS1,ANS2)
RT2=RT
SM=SM-0.5d0/DSQRT(D3) + ANS1/H
c** Get HBW in same energy units (1/cm) associated with BFCT
228 HBW=2.d0*PI/(BFCT*SM)
c** HBW fix up suggested by Child uses his eqs.(48)&(62) for HBW
c** Derivative of complex gamma function argument calculated as
c per eq.(6.1.27) in Abramowitz and Stegun.
NST= INT(DABS(EMSC)*1.D2)
NST= MAX0(NST,4)
ARG= -1.963510026021423d0
DO I= 0,NST
NN= I
XX= I + 0.5d0
TI= 1.d0/(XX*((XX/EMSC)**2 + 1.d0))
ARG= ARG+TI
IF(DABS(TI).LT.1.D-10) GO TO 233
ENDDO
c ... and use continuum approximation for tail of summation (???)
233 COR= 0.5d0*(EMSC/(NN+1.d0))**2
ARG= ARG+ COR- COR**2
c** Now use WKL's Weber fx. approx for (?) derivative of barrier integral ..
DWEB= (EO-VMAX)*BFCT/(H2*EMSC)
DFI= (DLOG(DABS(EMSC)) - ARG)*BFCT/(H2*DWEB)
HBWB= 1.d0/(1.d0/HBW + DFI/(2.d0*PI))
c** Width from formula (4.5) of Connor & Smith, Mol.Phys.43,397(1981)
c [neglect time delay integral past barrier in their Eq.(4.16)].
IF(EMSC.GT.-25.D0) THEN
GAMA= (HBWB/(2.d0*PI))* OMEGJC
TAU= 0.D0
IF(GAMA.GT.1.D-60) TAU= 5.308837457D-12/GAMA
c** GAM0 = TUN0*HBW/PI is the simple WKB width GAMMA(0) discussed by
c Le Roy & Liu in J.C.P.69,3622(1978).
IF(IWR.GT.0) WRITE(6,601) TAU,GAMA,HBWB,VMAX
ELSE
GAMALG= DLOG10(HBWB/(2.d0*PI))+2.d0*PI*EMSC/2.302585093D0
TAULG= DLOG10(5.308837457D-12)-GAMALG
IF(IWR.GT.0) WRITE(6,611) TAULG,GAMALG,HBWB,VMAX
ENDIF
250 RETURN
601 FORMAT(' Lifetime=',1PD10.3,'(s) Width=',D10.3,' dG/dv=',
1 0PF7.2,' V(max)=',F9.2)
602 FORMAT(' *** WARNING *** For v =',I3,' J =',I3,' cannot cal
1culate width since barrier maximum beyond range')
603 FORMAT(' *** For J=',I3,' E=',F9.2,' R(3-rd) beyond range so tu
1nneling calculation uses'/8X,'pure centrifugal potential with J(a
2pp)=',F7.2,' for R > R(max)=',F7.2)
605 FORMAT(' **** CAUTION *** Width estimate only qualitative, as have
1 a double-minimum well for E(v=',I3,', J=',I3,')=',F15.7/15X,
2 'a more stable result may be obtained by searching for the quasib
3ound levels using option: INNER > 0 .')
609 FORMAT(' *** CAUTION - Permeability estimate not exact as have a d
1ouble-humped barrier: E(v=',I3,', J=',I3,') =',G15.8,I6)
610 FORMAT(16X,'(NOTE: this has the node count of a v=',I3,2X,A5,
1 '-well level')
611 FORMAT(12X,'Log10(lifetime/sec)=',F10.5,' ; Log10(width/cm-1)=',
1 F10.5,' dG/dv=',G12.5,' V(max)=',G14.7,'(cm-1)')
END
c23456789 123456789 123456789 123456789 123456789 123456789 123456789 12
c***********************************************************************
SUBROUTINE LEVQAD(Y1,Y2,Y3,H,RT,ANS1,ANS2)
c** Subroutine "LEVQAD" fits quadratic Y = A + B*X + C*X**2 through
c function values Y1, Y2, Y3 at equally spaced points separated by
c distance H, where Y1 < 0 and (Y2,Y3 .ge.0), locates the function
c zero (at RT, relative to X1 < X2 = 0) between points X1 & X2, and
c evaluates the integral from RT to R3 of 1/sqrt(Y) , called
c ANS1, and the integral (same range) of sqrt(Y) , which is ANS2
c** Alternately, if Y1 & Y3 both < 0 and only the middle point
c Y2.ge.0 , fit the points to: Y = A - B*(X-X0)**2 , locate the
c turning points between which Y(X) > 0 and evaluate these integrals
c on this interval. **************************************************
c-----------------------------------------------------------------------
REAL*8 A,ANS1,ANS2,B,C,CQ,H,HPI,R1,R2,RCQ,RR,RT,SL3,SLT,
1 X0,Y1,Y2,Y3,ZT
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DATA HPI/1.570796326794896D0/
IF((Y1.GE.0).OR.(Y2.LT.0)) GO TO 99
IF(Y3.LT.0.d0) GO TO 50
c** Here treat case where both 'Y2' & 'Y3' are positive
IF(DABS((Y2-Y1)/(Y3-Y2) -1.D0).LT.1.d-10) THEN
c ... special case of true (to 1/10^10) linearity ...
RT= -H*Y2/(Y2-Y1)
ANS1= 2.d0*(H-RT)/DSQRT(Y3)
ANS2= ANS1*Y3/3.D0
RETURN
ENDIF
C= (Y3-2.d0*Y2+Y1)/(2.d0*H*H)
B= (Y3-Y2)/H-C*H
A= Y2
CQ= B**2- 4.d0*A*C
RCQ= DSQRT(CQ)
R1= (-B-RCQ)/(2.d0*C)
R2= R1+ RCQ/C
IF((R2.LE.0.d0).AND.(R2.GE.-H)) RT=R2
IF((R1.LE.0.d0).AND.(R1.GE.-H)) RT=R1
SL3= 2.d0*C*H+B
SLT= 2.d0*C*RT+B
IF(C.LT.0.d0) GO TO 10
ANS1= DLOG((2.d0*DSQRT(C*Y3)+SL3)/SLT)/DSQRT(C)
GO TO 20
10 ANS1= -(DASIN(SL3/RCQ)- DSIGN(HPI,SLT))/DSQRT(-C)
20 ANS2= (SL3*DSQRT(Y3)- CQ*ANS1/2.d0)/(4.d0*C)
IF(RT.GE.H) WRITE(6,601) H,R1,R2
601 FORMAT(' *** CAUTION *** in LEVQAD, turning point not between poin
1ts 1 & 2. H =',F9.6,' R1 =',F9.6,' R2 =',F9.6)
RETURN
c** Here treat case when only 'Y2' is non-negative
50 RR= (Y2-Y1)/(Y2-Y3)
X0= H*(RR-1.d0)/((RR+1.d0)*2.d0)
B= (Y2-Y1)/(H*(2.d0*X0+H))
A= Y2+ B*X0**2
ZT= DSQRT(A/B)
RT= X0- ZT
ANS1= 2.d0*HPI/DSQRT(B)
ANS2= ANS1*A*0.5d0
RETURN
99 WRITE(6,602) Y1,Y2
602 FORMAT(' *** ERROR in LEVQAD *** No turning point between 1-st two
1 points as Y1=',D10.3,' Y2=',D10.3)
ANS1= 0.d0
ANS2= 0.d0
RETURN
END
c23456789 123456789 123456789 123456789 123456789 123456789 123456789 12