-
Notifications
You must be signed in to change notification settings - Fork 0
/
DPot2_0.f
13234 lines (13174 loc) · 582 KB
/
DPot2_0.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
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
c***********************************************************************
PROGRAM DPotFit
c***********************************************************************
c** Program "D(iatomic)Pot(ential)Fit" (DPotFit) for performing least-
c squares fits of diatomic spectral data to molecular potential
c energy functions for one or multiple electronic states.
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c+++ COPYRIGHT 2006-2013 by R.J. Le Roy, J.Y. Seto and Y. Huang +++
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 authors. +
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c Version of 12 April 2013
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c++ Uses least-squares subroutine NLLSSRR written by Le Roy & Dulick +++
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** This program can perform the following types of calculations:
c (i) From a set of read-in constants, make predictions for any chosen
c input data set consisting of diatomic singlet-singlet transitions,
c and calculate deviations [calc.-obs.]
c (ii) Fit a data set made up of any combination of MW, IR or
c electronic vibrational bands, and/or fluorescence series, involving
c one or more electronic states and one or more isotopomers, to
c parameters defining the observed levels of each state.
c=======================================================================
c** Dimensioning parameters intrinsic to the program are input through
c 'arrsizes.h'
c** Parameters characterizing the problem and governing the fits are
c read on channel-5 while the raw data are read on channel-4 .
c Principle output goes to channel-6 while higher channel numbers
c are used for secondary or more detailed/voluminous output.
c***********************************************************************
INCLUDE 'arrsizes.h'
c=======================================================================
cc INCLUDE 'BLKISOT.h'
c=======================================================================
c** Isotope/isotopologue numbers, masses & BOB mass scaling factors
INTEGER NISTP,NDUNMX,AN(2),MN(2,NISTPMX)
c** NDUNMX is a dummy parameter reqd. for portability of READATA
PARAMETER (NDUNMX=0)
REAL*8 ZMASS(3,NISTPMX),RSQMU(NISTPMX),RSQMUP(0:NDUNMX,NISTPMX),
1 RMUP(0:9,NISTPMX),ZMUA(NISTPMX,NSTATEMX),ZMUB(NISTPMX,NSTATEMX),
2 ZMTA(NISTPMX,NSTATEMX),ZMTB(NISTPMX,NSTATEMX)
COMMON /BLKISOT/ZMASS,RSQMU,RSQMUP,RMUP,ZMUA,ZMUB,ZMTA,ZMTB,
1 NISTP,AN,MN
c=======================================================================
cc INCLUDE 'BLKDATA.h'
c=======================================================================
c** Type statements & common block for data
REAL*8 FREQ(NDATAMX),UFREQ(NDATAMX),DFREQ(NDATAMX),TEMP(NDATAMX),
1 YUNC(NDATAMX),Fqb
INTEGER COUNTOT,NFS1,NFSTOT,NBANDTOT,IB(NDATAMX),JP(NDATAMX),
1 JPP(NDATAMX),VP(NPARMX),VPP(NPARMX),EFP(NDATAMX),EFPP(NDATAMX),
2 TVUP(NDATAMX),TVLW(NDATAMX),FSBAND(NPARMX),IFXFS(NPARMX),
3 NFS(NPARMX),IEP(NPARMX),IEPP(NPARMX),ISTP(NPARMX),
4 IFIRST(NPARMX),ILAST(NPARMX),NTV(NSTATEMX,NISTPMX),FSsame
CHARACTER*2 NAME(2),SLABL(-5:NSTATEMX)
c
COMMON /DATABLK/Fqb,FREQ,UFREQ,YUNC,DFREQ,TEMP,COUNTOT,NFS1,
1 NFSTOT,NBANDTOT,IB,JP,JPP,VP,VPP,EFP,EFPP,TVUP,TVLW,FSBAND,IFXFS,
2 NFS,IEP,IEPP,ISTP,IFIRST,ILAST,NTV,FSsame, NAME,SLABL
c=======================================================================
cc INCLUDE 'BLKPOT.h'
c** Effective adiabatic radial potential variables.
INTEGER BOBCN(NSTATEMX),PSEL(NSTATEMX),IOMEG(NSTATEMX),
1 APSE(NSTATEMX),Nbeta(NSTATEMX),IFXDE(NSTATEMX),IFXRE(NSTATEMX),
2 IFXCm(NCMMax,NSTATEMX),IFXBETA(0:NbetaMX,NSTATEMX),
3 NDATPT(NSTATEMX),NCMM(NSTATEMX),MMLR(NCMMax,NSTATEMX),
4 nPB(NSTATEMX),nQB(NSTATEMX),pAD(NSTATEMX),qAD(NSTATEMX),
5 pNA(NSTATEMX),qNA(NSTATEMX),Pqw(NSTATEMX),IDF(NSTATEMX),
6 IDSTT(NSTATEMX)
REAL*8 DE(NSTATEMX),RE(NSTATEMX),BETA(0:NbetaMX,NSTATEMX),
1 ypBETA(NbetaMX,NSTATEMX),BETAFX(NPNTMX,NSTATEMX),RH(NSTATEMX),
2 RMIN(NSTATEMX),RMAX(NSTATEMX),VLIM(NSTATEMX),EPS(NSTATEMX),
3 betaINF(NSTATEMX),AGPEF(NSTATEMX),BGPEF(NSTATEMX),
4 CmVAL(NCMMax,NSTATEMX),rhoAB(NSTATEMX),AA(NSTATEMX),
5 BB(NSTATEMX),RREF(NSTATEMX),ASO(NSTATEMX),R01(NSTATEMX),
6 Q12(NSTATEMX),RD(NPNTMX,NSTATEMX),VPOT(NPNTMX,NSTATEMX)
c
COMMON /BLKPOT/DE,RE,BETA,ypBETA,BETAFX,RH,RMIN,RMAX,VLIM,EPS,
1 betaINF,AGPEF,BGPEF,CmVAL,rhoAB,AA,BB,RREF,ASO,R01,Q12,RD,VPOT,
2 BOBCN,PSEL,IOMEG,APSE,Nbeta,IFXDE,IFXRE,IFXCm,IFXBETA,NDATPT,
3 NCMM,MMLR,nPB,nQB,pAD,qAD,pNA,qNA,Pqw,IDF,IDSTT
c=======================================================================
cc INCLUDE 'BLKPARAM.h'
c=======================================================================
c** Parameters and count-labels for band constant (PSEL=-1) or term
c value (PSEL=-2) fits
REAL*8 TVALUE(NPARMX),ZBC(0:NVIBMX,0:NROTMX,NISTPMX,NSTATEMX)
c
INTEGER NSTATES,NTVALL(0:NSTATEMX),NTVI(NSTATEMX),NTVF(NSTATEMX),
1 VMIN(NSTATEMX,NISTPMX),VMAX(NSTATEMX,NISTPMX),
2 NBC(0:NVIBMX,NISTPMX,NSTATEMX),BCPARI(0:NVIBMX,NISTPMX,NSTATEMX),
3 BCPARF(0:NVIBMX,NISTPMX,NSTATEMX)
COMMON /BLKPARAM/TVALUE,ZBC,NSTATES,NTVALL,NTVI,NTVF,VMIN,VMAX,
1 NBC,BCPARI,BCPARF
c=======================================================================
cc INCLUDE 'BLKBOB.h'
c=======================================================================
c** Born-Oppenheimer Breakdown & doubling function parameters.
c** March 16 2012
c=======================================================================
INTEGER NUA(NSTATEMX),NUB(NSTATEMX),NTA(NSTATEMX),NTB(NSTATEMX),
1 IFXUA(0:NBOBMX,NSTATEMX),IFXUB(0:NBOBMX,NSTATEMX),
2 IFXTA(0:NBOBMX,NSTATEMX),IFXTB(0:NBOBMX,NSTATEMX),
3 NwCFT(NSTATEMX),IFXwCFT(0:NBOBMX,NSTATEMX),efREF(NSTATEMX)
c
REAL*8 UA(0:NBOBMX,NSTATEMX),UB(0:NBOBMX,NSTATEMX),
1 TA(0:NBOBMX,NSTATEMX),TB(0:NBOBMX,NSTATEMX),
2 wCFT(0:NBOBMX,NSTATEMX)
c
COMMON /BLKBOB/UA,UB,TA,TB,wCFT,NUA,NUB,NTA,NTB,NwCFT,
1 IFXUA,IFXUB,IFXTA,IFXTB,IFXwCFT,efREF
c=======================================================================
cc INCLUDE 'BLKCOUNT.h'
c=======================================================================
c Block data file BLKCOUNT.h
c=======================================================================
c** Counters for numbers of potential parameters of different types for
c each state
INTEGER TOTPOTPAR,POTPARI(NSTATEMX),POTPARF(NSTATEMX),
1 UAPARI(NSTATEMX),UAPARF(NSTATEMX),UBPARI(NSTATEMX),
2 UBPARF(NSTATEMX),TAPARI(NSTATEMX),TAPARF(NSTATEMX),
3 TBPARI(NSTATEMX),TBPARF(NSTATEMX),LDPARI(NSTATEMX),
4 LDPARF(NSTATEMX),HPARF(NSTATEMX),OSEL(NSTATEMX)
c
COMMON /BLKCOUNT/TOTPOTPAR,POTPARI,POTPARF,UAPARI,UAPARF,UBPARI,
1 UBPARF,TAPARI,TAPARF,TBPARI,TBPARF,LDPARI,LDPARF,HPARF,OSEL
c=======================================================================
c-----------------------------------------------------------------------
CHARACTER*40 DATAFILE,MAKEPRED
CHARACTER*24 WRITFILE,TVNAME(NPARMX)
CHARACTER*27 FN4,FN6,FN7,FN8,FN10,FN11,FN12,FN13,FN14,FN15,FN16,
1 FN20,FN22,FN30
cc 1 ,FN32
INTEGER*4 lnblnk
INTEGER I,J,ISTATE,ISOT,CHARGE,IPV,MKPRED,PRINP,
1 JTRUNC(NSTATEMX),EFSEL(NSTATEMX),PASok(NSTATEMX),OSEL(NSTATEMX),
2 NDAT(0:NVIBMX,NISTPMX,NSTATEMX)
REAL*8 UCUTOFF,ZMASE,DECM(NSTATEMX)
c
INTEGER NOWIDTHS
COMMON /WIDTHBLK/NOWIDTHS
c
c** Parameters required for NLLSSRR.
c
INTEGER NPTOT,CYCMAX,IROUND,ROBUST,LPRINT,SIROUND,NFPAR,uBv,
1 IFXPV(NPARMX),SIFXPV(NPARMX)
REAL*8 PV(NPARMX),PU(NPARMX),PS(NPARMX),CM(NPARMX,NPARMX),
1 PUSAV(NPARMX),PSSAV(NPARMX),TSTPS,TSTPU,DSE
c-----------------------------------------------------------------------
c** Set type statements for unused MASSES variables.
c
CHARACTER*2 CATOM
INTEGER GELGS(2,NISTPMX),GNS(2,NISTPMX)
REAL*8 ABUND(2,NISTPMX)
c------------------------------------------------------------------------
REAL*8 RDIST,VDIST,BETADIST
c
REAL*8 Vsr(NPNTMX,NSTATEMX),Bsr(NPNTMX,NSTATEMX)
INTEGER nPointSR(NSTATEMX)
COMMON /VsrBLK/Vsr,Bsr,nPointSR
c
REAL*8 Plr(NPNTMX,NSTATEMX),Blr(NPNTMX,NSTATEMX)
INTEGER nPointLR(NSTATEMX)
COMMON /PlrBLK/Plr,Blr,nPointLR
c**************************
REAL*8 RMINT,RMAXT,RHT
INTEGER NCNN
DATA ZMASE /5.4857990945D-04/
DATA MAKEPRED/'MAKEPRED'/
c=======================================================================
SLABL(-5)='VS'
SLABL(-4)='VR'
SLABL(-3)='VV'
SLABL(-2)='WI'
SLABL(-1)='PA'
SLABL(0)='FS'
c** uncertainties for data involving Quasibound level increased
c by Fqb*width to DSQRT{u(_i;exp)**2 + (Fqb*width)**2}
Fqb= 0.20d0
c=======================================================================
c** FSsame > 0 checks all FS to find those with a common (v',J',isot)
c and the fit will use a single upper-state energy, instead of a
c separate one for each series.
c!!! REMOVE THIS OPTION - for such cases invoke a fake electronic state !
FSsame= 0
c%% FSsame= 1
NFS1= 0
DO I=1,NPARMX
TVALUE(I)= 0.d0
PV(I)= 0.0d0
PU(I)= 0.0d0
PS(I)= 0.0d0
IFXPV(I)= 1
ENDDO
SIROUND= 0
c=======================================================================
c** Start by reading parameters describing the overall nature of the
c case and placing chosen restrictions on the data set to be used.
c
c AN(1) & AN(2) are atomic numbers identifying the atoms forming the
c molecule.
c
c CHARGE (+/- integer) is the charge on the molecule (=0 for neutral).
c If(CHARGE.ne.0) use Watson's(JMS 1980) charge-modified reduced mass.
c
c NISTP is the number of isotopomers to be simultaneously considered.
c
c NSTATES is the number of electronic states associated with the data
c set to be analysed: NSTATES = 1 for fits to IR/MW and/or
c fluorescence data for a single electronic state, while
c NSTATES > 1 for multi-state fits.
c Upper states of fluorescence series NOT included in this count.
c
c LPRINT specifies the level of printing inside NLLSSRR if:
c = 0 : no print except for failed convergence.
c < 0 : only converged, unrounded parameters, PU & PS's
c >= 1 : print converged parameters, PU & PS's
c >= 2 : also print parameter change each rounding step
c >= 3 : also indicate nature of convergence
c >= 4 : also print convergence tests on each cycle
c >= 5 : also parameters changes & uncertainties, each cycle
c
c PRINP > 0 causes a summary of the input data to be printed before
c the fitting starts. Normally set =0 unless troubleshooting
c
c DATAFILE is the (character variable) name of the file containing the
c experimental data to be used in the fit. If it is not located in
c the current directory, the name 'DATAFILE' must include the
c relative path. The valiable name may (currently) consist of up to
c 40 characters. READ ON A SEPARATE LINE!
c
c !! To make predictions using a completely specified set of parameters,
c the input value of parameter DATAFILE must be 'MAKEPRED'
c
c WRITFILE is the (character variable) name of the file to which the
c output will be written. Channel-6 outut goes to WRITFILE.6,
c channel-7 output to WRITFILE.7, channel-8 to WRITFILE.8, ... etc.
c If not in the current directory, the name 'WRITFILE' must include the
c relative path. The valiable name may (currently) consist of up to
c 40 characters, enclosed in single quotes, with no leading spaces.
c=======================================================================
READ(5,*) AN(1), AN(2), CHARGE, NISTP, NSTATES, LPRINT, PRINP
READ(5,*) DATAFILE
READ(5,*) WRITFILE
c=======================================================================
c** These statements construct and define the names of output files
c associated with WRITE's to channels 6-10 used by the program.
WRITE(FN6,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.6'
WRITE(FN7,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.7'
WRITE(FN8,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.8'
WRITE(FN20,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.20'
WRITE(FN22,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.22'
WRITE(FN30,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.30'
OPEN(UNIT=6,FILE=FN6)
OPEN(UNIT=7,FILE=FN7)
OPEN(UNIT=8,FILE=FN8)
OPEN(UNIT=20,FILE=FN20)
OPEN(UNIT=22,FILE=FN22)
OPEN(UNIT=30,FILE=FN30)
WRITE(6,601) NISTP
DO ISOT= 1,NISTP
c** Loop to read the mass numbers of the atoms in each of the isotopomers
c MN(i,ISOT) is the mass number for atom with atomic number AN(i)
c [NOTE: be sure order of MN values consistent with that of AN's].
c Choosing it .ne. value for some known isotope if that species
c causes the average atomic mass to be used.
c=======================================================================
READ(5,*) MN(1,ISOT), MN(2,ISOT)
c=======================================================================
I= MIN(I,MN(1,ISOT),MN(2,ISOT))
CALL MASSES(AN(1),MN(1,ISOT),CATOM,GELGS(1,ISOT),
1 GNS(1,ISOT),ZMASS(1,ISOT),ABUND(1,ISOT))
IF(ISOT.EQ.1) NAME(1)= CATOM
CALL MASSES(AN(2),MN(2,ISOT),CATOM,GELGS(2,ISOT),
1 GNS(2,ISOT),ZMASS(2,ISOT),ABUND(2,ISOT))
IF(ISOT.EQ.1) NAME(2)= CATOM
IF((AN(1).EQ.1).AND.(MN(1,ISOT).GT.3)) MN(1,ISOT)=MN(1,ISOT)-3
IF((AN(2).EQ.1).AND.(MN(2,ISOT).GT.3)) MN(2,ISOT)=MN(2,ISOT)-3
ZMASS(3,ISOT)= (ZMASS(1,ISOT)*ZMASS(2,ISOT))/
1 (ZMASS(1,ISOT)+ZMASS(2,ISOT)-CHARGE*ZMASE)
WRITE(6,602) NAME(1),MN(1,ISOT),NAME(2),MN(2,ISOT),
1 (ZMASS(J,ISOT),J=1,3)
IF(I.EQ.0) WRITE(6,603)
RSQMU(ISOT)= DSQRT(ZMASS(3,1)/ZMASS(3,ISOT))
ENDDO
c... end of loop over isotopologues ....................................
IF(CHARGE.NE.0) WRITE(6,597) CHARGE
WRITE(6,599) DATAFILE,Fqb
IF(AN(1).EQ.AN(2)) WRITE(6,604)
599 FORMAT(/' Use experimental data input file: ',a30/' Uncertainties
1 for transitions involving quasibound levels modified to:'/20x,
2 'SQRT{(u(i;exp)**2 + (',f5.2,'*width)**2}')
597 FORMAT(1x,67('-')/' Since this is an ion with charge',SP,i3,
1 ", use Watson's charge-modified reduced mass.")
601 FORMAT(2X,'Input data for',I3,' isotopomer(s)'/2X,16('**')/2X,
1 ' Isotopomer Mass of atom-1 Mass of atom-2 Reduced
2 mass'/ 2X,'----------------- ',3(' --------------'))
602 FORMAT(2X,A2,'(',I3,') - ',A2,'(',I3,')',3(3X,F14.9))
603 FORMAT(' Note that (Mass Number) = 0 causes the average atomi
1c mass to be used.')
604 FORMAT(' For electrically homonuclear molecules, BO correction fun
1ctions are the same'/5x,'for both atoms, so only the first sets of
2 correction coefficients'/5x,'UA(s) and TA(s) are used, and the ma
3ss scaling factors are sums over'/5x,'the two individual atoms.')
c
MKPRED= 0
IF(DATAFILE.EQ.MAKEPRED) THEN
MKPRED= 1
ENDIF
c-----------------------------------------------------------------------
c UCUTOFF Neglect any input data with uncertainties > UCUTOFF (cm-1)
c
c NOWIDTHS > 0 causes the program to ignore any tunneling widths in
c the data set and omit calculating partial derivatives
c of predissociation level widths w.r.t. potential param.
c <= 0 causes the program to fit to tunneling widths
c < 0 use simple version of dWdP, ignoring the partial
c derivative of t_vib which involves k = 1 phase integral
c IROUND specifies the level of rounding inside NLLSSRR if:
c > 0 : requires that Sequential Rounding & Refitting be
c performed, with each parameter being rounded at the
c IROUND'th sig. digit of its local uncertainty.
c <=0 : simply stops after full convergence (without rounding).
c
c ROBUST > 0 (integer) causes "Robust" least-squares weighting (as per
c Watson [J.Mol.Spectrosc. 219, 326 (2003)] to be used
c = 0 uses normal data weights 1/[uncertainty(i)]**2
c
c
c CYCMAX sets an upper bound on the number of cycles to allowed in the
c least-squares fit subroutine NLLSSRR
c
c uBv defines whether (uBv > 0) or nor (uBv.LE.0) to compute
c uncertainties in the calculated Bv value due to the fit unc.
c=======================================================================
READ(5,*) UCUTOFF, NOWIDTHS, IROUND, ROBUST, CYCMAX, uBv
c=======================================================================
IF(IROUND.NE.0) WRITE(6,685) IABS(IROUND)
IF(IROUND.GT.0) WRITE(6,686)
IF(IROUND.LT.0) WRITE(6,687)
IF(ROBUST.GT.0) THEN
ROBUST= 2
WRITE(6,596)
ELSE
WRITE(6,598)
ENDIF
WRITE(6,595) CYCMAX
596 FORMAT( " Fit uses Watson's",' "Robust" data weighting [J.Mol/Spec
1trosc. 219, 326 (2003)] '/20x,'1/[{unc(i)}^2 + {calc.-obs.}^2/3]')
595 FORMAT(' Non-linear fits are allowed a maximum of CYCMAX=', I4,'
1cycles')
598 FORMAT( ' Fit uses standard 1/[uncertainty(i)]**2 data weighting
1')
685 FORMAT(/' Apply "Sequential Rounding & Refitting" at digit-',
1 i1,' of the (local) parameter')
686 FORMAT(4x,'uncertainty, selecting remaining parameter with largest
1 relative uncertainty')
687 FORMAT(4x,'uncertainty, proceeding sequentially from the LAST para
1meter to the FIRST.')
c!!!
cc IF(NOWIDTHS.LE.0) THEN
cc WRITE(FN32,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.32'
cc OPEN(UNIT=32, FILE= FN32)
cc ENDIF
c!!!
c
DO ISTATE= 1,NSTATES
c-----------------------------------------------------------------------
c** Read parameters to characterize state & possibly restrict data used
c SLABL(s) is a 2-character alphameric label enclosed in single quotes
c to identify the electronic state; e.g., 'X0', 'A1', ... etc.
c IOMEG(s) .GE.0 is electronic angular momentum of singlet state with
c projection quantum number Lambda= IOMEG
c IOMEG(s) .EQ. -1 if it indicates a doublet SIGMA electronic state
c [other spin multiplets not yet coded]
c IOMEG(s) .EQ. -2 indicated that the centrifugal potential strength
c is to be scaled by [J(J+1) + 2] (special Li2 case)
c V(MIN/MAX)(s) Neglect data for electronic state vibrational levels
c outside the range VMIN to VMAX.
c JTRUNC(s) data with J > JTRUNC are not included in the fit.
c EFSEL(s) allows a user to consider data for:
c * ONLY the e-parity levels of this state, if EFSEL > 0
c * ONLY the f-parity levels of this state, if EFSEL < 0
c * BOTH e- and f-parity levels of thsi state, if EFSEL = 0
c=======================================================================
READ(5,*) SLABL(ISTATE), IOMEG(ISTATE), VMIN(ISTATE,1),
1 VMAX(ISTATE,1), JTRUNC(ISTATE), EFSEL(ISTATE)
c======================================================================
IF(NISTP.GT.1) THEN
DO ISOT= 2, NISTP
VMIN(ISTATE,ISOT)= VMIN(ISTATE,1)
VMAX(ISTATE,ISOT)= INT((VMAX(ISTATE,1)+1.0d0)/
1 RSQMU(ISOT)-0.5d0)
ENDDO
IF(VMAX(ISTATE,1).LT.0)
c** If desired, read separate upper bound level for each isotopologue
c=======================================================================
1 READ(5,*) (VMAX(ISTATE,ISOT), ISOT= 1, NISTP)
c=======================================================================
ENDIF
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CALL READPOT(ISTATE,SLABL)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** These statements construct and define the names of output files
c associated with WRITE's to channels 6-10 used by the program.
IF(OSEL(ISTATE).GT.0) THEN
WRITE(FN10,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.10'
WRITE(FN11,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.11'
OPEN(UNIT=10,FILE=FN10)
OPEN(UNIT=11,FILE=FN11)
IF(NUA(ISTATE).GE.0) THEN
WRITE(FN12,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.12'
OPEN(UNIT=12, FILE=FN12)
ENDIF
IF(NUB(ISTATE).GE.0) THEN
WRITE(FN13,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.13'
OPEN(UNIT=13,FILE=FN13)
ENDIF
IF(NTA(ISTATE).GE.0) THEN
WRITE(FN14,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.14'
OPEN(UNIT=14,FILE=FN14)
ENDIF
IF(NTB(ISTATE).GE.0) THEN
WRITE(FN15,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.15'
OPEN(UNIT=15,FILE=FN15)
ENDIF
IF(NwCFT(ISTATE).GE.0) THEN
WRITE(FN16,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.16'
OPEN(UNIT=16,FILE=FN16)
ENDIF
ENDIF
PASok(ISTATE)= 1
IF(PSEL(ISTATE).EQ.6) PASok(ISTATE)= 0
c** Call VGEN to prepare parameters for output in WRITEPOT
IF(PSEL(ISTATE).EQ.2) CALL VGEN(ISTATE,1.0d0,VDIST,BETADIST,0)
ENDDO
c** Now write summary of the initial potential parameters for each state
CALL WRITEPOT(1,SLABL,NAME,DECM,PV,PU,PS)
c
c** Now ... count potential parameters of various types for each state
c=======================================================================
c** Counters for numbers of potential parameters of different types for
c each state
c COMMON /BLKCOUNT/TOTPOTPAR,POTPARI,POTPARF,UAPARI,UAPARF,
c 1 UBPARI,UBPARF,TAPARI,TAPARF,TBPARI,TBPARF,LDPARI,LDPARF
c=======================================================================
TOTPOTPAR= 0
IPV= 0
DO 90 ISTATE= 1,NSTATES
IF((PSEL(ISTATE).EQ.0).OR.(PSEL(ISTATE).EQ.-2)) GOTO 90
IF(PSEL(ISTATE).EQ.-1) THEN
c... When using band constants for this state ... count them and label
c first and last for each level of each isotopologue ...
DO ISOT= 1, NISTP
DO I= VMIN(ISTATE,ISOT),VMAX(ISTATE,ISOT)
IF(NBC(I,ISOT,ISTATE).GT.0) THEN
BCPARI(I,ISOT,ISTATE)= IPV+1
DO J= 1,NBC(I,ISOT,ISTATE)
IPV= IPV+1
IFXPV(IPV)= 0
PV(IPV)= 0.d0
PU(IPV)= 0.d0
ENDDO
BCPARF(I,ISOT,ISTATE)= IPV
ENDIF
ENDDO
ENDDO
GOTO 90
ENDIF
c... For all types of fitted potential, count Re
IPV= IPV+ 1
POTPARI(ISTATE)= IPV
POTPARF(ISTATE)= IPV
IFXPV(IPV)= IFXRe(ISTATE)
UAPARI(ISTATE)= 0
UAPARF(ISTATE)= 0
UBPARI(ISTATE)= 0
UBPARF(ISTATE)= 0
TAPARI(ISTATE)= 0
TAPARF(ISTATE)= 0
TBPARI(ISTATE)= 0
TBPARF(ISTATE)= 0
LDPARI(ISTATE)= 0
LDPARF(ISTATE)= 0
HPARF(ISTATE)= 0
c... For all cases, except GPEF (where it doesn't appear), count De
IF(PSEL(ISTATE).LT.6) THEN
IFXPV(IPV)= IFXDe(ISTATE)
IPV= IPV+ 1
POTPARF(ISTATE)= IPV
IFXPV(IPV)= IFXRe(ISTATE)
ENDIF
IF((PSEL(ISTATE).GE.2).and.(PSEL(ISTATE).LE.5)) THEN
c... For MLJ/MLR family, count long-range parameters: first count Cm's
DO J= 1,NCMM(ISTATE)
c... additional Aubert-Frecon{3,6,6,8,8} parameters included in this count
IPV= IPV+ 1
POTPARF(ISTATE)= IPV
IFXPV(IPV)= IFXCm(J,ISTATE)
IF(IFXPV(IPV).GT.1) THEN
c!!! If constraining one or more Cm to be fixed at same value as for
c an earlier (smaller ISTATE) state ....
WRITE(6,610) IPV,IFXPV(IPV)
610 FORMAT('** Constrain PV(',i3,') = PV(',I3,') in the fits')
ENDIF
ENDDO
ENDIF
c... Now count [exponent] \beta_i expansion coefficients
J=0
c** For Pashov-exponent MLR count starts with 1 for y_p = 1.0
IF(APSE(ISTATE).GT.0) J=1
DO I= J,Nbeta(ISTATE)
IPV= IPV+ 1
POTPARF(ISTATE)= IPV
IFXPV(IPV)= IFXBETA(I,ISTATE)
ENDDO
IF(NUA(ISTATE).GE.0) THEN
c... Count adiabatic parameters for atom A (if appropriate)
UAPARI(ISTATE)= IPV + 1
DO J= 0,NUA(ISTATE)
IPV= IPV+ 1
UAPARF(ISTATE)= IPV
IFXPV(IPV)= IFXUA(J,ISTATE)
ENDDO
ENDIF
IF(NUB(ISTATE).GE.0) THEN
c... Count adiabatic parameters for atom B (if appropriate)
UBPARI(ISTATE)= IPV + 1
DO J= 0,NUB(ISTATE)
IPV= IPV+ 1
UBPARF(ISTATE)= IPV
IFXPV(IPV)= IFXUB(J,ISTATE)
ENDDO
ENDIF
IF(NTA(ISTATE).GE.0) THEN
c... Count centrifugal BOB parameters for atom A (if appropriate)
TAPARI(ISTATE)= IPV + 1
DO J= 0,NTA(ISTATE)
IPV= IPV+ 1
TAPARF(ISTATE)= IPV
IFXPV(IPV)= IFXTA(J,ISTATE)
ENDDO
ENDIF
IF(NTB(ISTATE).GE.0) THEN
c... Count centrifugal BOB parameters for atom B (if appropriate)
TBPARI(ISTATE)= IPV + 1
DO J= 0,NTB(ISTATE)
IPV= IPV+ 1
TBPARF(ISTATE)= IPV
IFXPV(IPV)= IFXTB(J,ISTATE)
ENDDO
ENDIF
IF(NwCFT(ISTATE).GE.0) THEN
c... Count Lambda/doublet-sigma doubling parameters (if appropriate)
LDPARI(ISTATE)= IPV + 1
DO J= 0,NwCFT(ISTATE)
IPV= IPV+ 1
LDPARF(ISTATE)= IPV
IFXPV(IPV)= IFXwCFT(J,ISTATE)
ENDDO
ENDIF
HPARF(ISTATE)= IPV
c..... end of parameter count/label loop!
90 CONTINUE
TOTPOTPAR= IPV
IF(TOTPOTPAR.GT.HPARMX) THEN
WRITE(6,626) TOTPOTPAR,HPARMX
STOP
ENDIF
NPTOT= TOTPOTPAR
NFPAR= 0
c** Count total free Hamiltonian fitting parameters
DO IPV= 1, TOTPOTPAR
IF(IFXPV(IPV).LE.0) NFPAR= NFPAR+ 1
ENDDO
c------------ Finished counting Hamiltonian Parameters------------------
626 FORMAT(/' *** Dimension Error *** [(total No. Hamiltonian parmaete
1rs)=',i4,'] > HPARMX=',i4)
638 FORMAT(' State ',A2,' Energy Convergence criterion EPS is',
1 1PD8.1,' cm-1')
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** Call subroutine to input experimental data in specified band-by-band
c format, and do bookkeeping to characterize amounts of data of each
c type.
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IF(MKPRED.LE.0) OPEN(UNIT= 4, STATUS= 'OLD', FILE= DATAFILE)
c** when COMMON blocks check out ... introduce MKPRED option ......
IF(MKPRED.GT.0) THEN
WRITE(FN4,'(2A)') WRITFILE(1:lnblnk(WRITFILE)),'.4'
OPEN(UNIT= 4, FILE= FN4)
IF(UCUTOFF.LT.1.d0) UCUTOFF= 1.d0
CALL MKPREDICT(NSTATES,NDAT)
REWIND(4)
ENDIF
CALL READATA(NSTATES,PASok,UCUTOFF,JTRUNC,EFSEL,VMIN,VMAX,NDAT,
1 NOWIDTHS,PRINP)
NTVALL(0)= 0
DO ISTATE= 1,NSTATES
IF(PSEL(ISTATE).EQ.-2) THEN
c... If this state to be represented by term values, determine the number
c and add them to the parameter count
NTVI(ISTATE)= NPTOT+ 1
CALL TVSORT(ISTATE,NPTOT,VMAX,NTVALL,TVNAME)
NTVALL(0)= NTVALL(0) + NTVALL(ISTATE)
IF(NTVALL(ISTATE).GT.0) THEN
NTVF(ISTATE)= NPTOT
ENDIF
ENDIF
ENDDO
c** Add number of fluorescence series origins to total parameter count
c and set initial values of any fluorescence series origins to zero.
IF(NFSTOT.GT.0) THEN
NFS1= NPTOT+ 1
NPTOT= NPTOT+ NFSTOT
ENDIF
c** Set the energy convergence criterion to be 1/100th of the smallest
c experimental uncertainty. [UCUTOFF reset by READATA to that min. unc.]
DO ISTATE=1,NSTATES
EPS(ISTATE)= DMIN1(UCUTOFF/100.0d0,1.d-06)
WRITE(6,638) SLABL(ISTATE), EPS(ISTATE)
c** Initialize the dissociation energy ????
DECM(ISTATE)= 0.0d0
ENDDO
flush(6)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** Now Generate internal NLLSSRR variables {PV} from the external ones
CALL MAPPAR(NISTP,PV,0)
SIROUND= IROUND
IROUND= 0
IF((NFSTOT.GT.0).OR.(NTVALL(0).GT.0)) THEN
c** If HAVE fluorescence series ... first fix ALL potential parameters
c and fit to determine the series origins, and only THEN free potential
c parameters too. First, save read-in values of 'IF(fix)' parameters
DO I= 1,TOTPOTPAR
SIFXPV(I)= IFXPV(I)
IFXPV(I)= 1
ENDDO
DO I= TOTPOTPAR+1,NPTOT
IFXPV(I)= 0
PV(I)= 0.d0
IF(IFXFS(I-TOTPOTPAR).GT.0) IFXPV(I)= 1
ENDDO
c** Call NLLSSRR to get Fluorescence series origins ....
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CALL NLLSSRR(COUNTOT,NPTOT,NPARMX,CYCMAX,IROUND,ROBUST,LPRINT,
1 IFXPV,FREQ,UFREQ,DFREQ,PV,PU,PS,CM,TSTPS,TSTPU,DSE)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c... Now reset "IFX(fix)" parameters to read-in values ... & proceed ..
DO I= 1,TOTPOTPAR
IFXPV(I)= SIFXPV(I)
ENDDO
c** Now, set TVALUE values & reset parameter array for global fit
DO I= TOTPOTPAR+1,NPTOT
TVALUE(I-TOTPOTPAR)= PV(I)
IFXPV(I)= 0
IF(IFXFS(I-TOTPOTPAR).GT.0) THEN
write(6,888) I-TOTPOTPAR,TVALUE(I-TOTPOTPAR),
1 IFXFS(I-TOTPOTPAR),TVALUE(IFXFS(I-TOTPOTPAR))
888 format(/' Following FS fit reset T(',i3,')=',f12.4,
1 ' equal T(',I3,')=', F12.4)
TVALUE(I-TOTPOTPAR)= TVALUE(IFXFS(I-TOTPOTPAR))
IFXPV(I)= 1
ENDIF
ENDDO
NFPAR= NFPAR+ NFSTOT+ NTVALL(0)
CALL MAPPAR(NISTP,PV,0)
ENDIF
c--- End of section to determine preliminary values of any fluorescence
c series origins
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** Call subroutine NLLSSRR to calculate converged parameters from trial
c values and spectroscopic data.
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CALL NLLSSRR(COUNTOT,NPTOT,NPARMX,CYCMAX,IROUND,ROBUST,LPRINT,
1 IFXPV,FREQ,UFREQ,DFREQ,PV,PU,PS,CM,TSTPS,TSTPU,DSE)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IF(SIROUND.NE.0) THEN
c** If SRR rounding is to be performed, first save global uncertainties
DO I= 1, NPTOT
PUSAV(I)= PU(I)
PSSAV(I)= PS(I)
ENDDO
c** Perform group rounding of all term values and/or fluorescence series
c origins in single step
IF((NFSTOT.GT.0).OR.(NTVALL(0).GT.0)) THEN
IROUND= IABS(SIROUND) + 1
CALL GPROUND(IROUND,NPTOT,NPARMX,TOTPOTPAR+1,NPTOT,
1 LPRINT,IFXPV,PV,PU)
ENDIF
c ... and then call NLLSSRR again to sequentially round remaining parm.
IROUND= SIROUND
CALL NLLSSRR(COUNTOT,NPTOT,NPARMX,CYCMAX,IROUND,ROBUST,LPRINT,
1 IFXPV,FREQ,UFREQ,DFREQ,PV,PU,PS,CM,TSTPS,TSTPU,DSE)
c ... finally, reset all parameter uncertainties at pre-rounding values
DO I= 1, NPTOT
PU(I)= PUSAV(I)
PS(I)= PSSAV(I)
ENDDO
c ... renormalize DSE relative value for to ALL fitting parameters free
DSE= DSE*DSQRT(DFLOAT(COUNTOT- (NFPAR- NFSTOT- NTVALL(0)))/
1 DFLOAT(COUNTOT- NFPAR))
ENDIF
c** Writing out the general information of the fit.
c-----------------------------------------------------------------------
WRITE(6,690)
WRITE(6,691) NFPAR,COUNTOT,DSE
c-----------------------------------------------------------------------
c** Writing out the fluorescence band results.
c-----------------------------------------------------------------------
IF(NFSTOT.GT.0) THEN
WRITE(6,690)
WRITE(6,692) NFSTOT
J= NPTOT - NFSTOT
DO I= 1,NFSTOT
WRITE(6,694) VP(FSBAND(I)),VPP(FSBAND(I)),
1 EFP(IFIRST(FSBAND(I))),ISTP(FSBAND(I)),TVALUE(J+I),
2 PU(J+I),PS(J+I)
ENDDO
ENDIF
DO ISTATE= 1, NSTATES
IF(PSEL(ISTATE).EQ.-2) THEN
c** For states represented by independent term values for each level ...
WRITE(6,690)
WRITE(6,696) SLABL(ISTATE),NTVALL(ISTATE)
WRITE(6,698) (TVNAME(I),PV(I),PU(I),PS(I),I=
1 NTVI(ISTATE),NTVF(ISTATE))
ELSEIF(PSEL(ISTATE).GT.0) THEN
c** Calculation of the uncertainties for Te for each potential require
c elements from the correlation matrix.
IF((IFXDE(1).LE.0).AND.(IFXDE(ISTATE).LE.0)) THEN
DECM(ISTATE)= CM(1,POTPARI(ISTATE))
ELSE
DECM(ISTATE)= 0.0d0
ENDIF
ENDIF
ENDDO
690 FORMAT(/,1X,34('=='))
691 FORMAT(' For fit of',I5,' parameters to',I6,
1 ' transitions, DSE=',G15.8)
692 FORMAT(' The following',I5,' Fluorescence Series Origins were det
1ermined'/1x,30('--')/" ( v', J', p'; ISTP)",4x,'T(value)',4x,
2 'Uncertainty Sensitivity'/1x,30('--'))
cc694 FORMAT(3X,'(',I3,',',I3,',',SP,I3,SS,';',I2,')',1X,1PD19.10,
694 FORMAT(2X,'(',I4,',',I3,',',SP,I3,SS,';',I2,')',1X,F15.6,
1 1PD11.1,D12.1)
696 FORMAT(' State ',A2,' represented by the',I5,' individual term va
1lues:'/1x,33('--')/" T(es: v', J', p';IS) #dat",4x,'T(value)',4x,
2 'Uncertainty Sensitivity'/1x,33('--'))
698 FORMAT(2X,A24,1PD19.10,D11.1,D12.1)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** Call subroutine MAPPAR to convert internal NLLSSRR parameter array
c back into external (logical) variable system.
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CALL MAPPAR(NISTP,PV,1)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** Call subroutine VGEN to generate the potential function from the
c final calculated converged parameters.
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DO ISTATE= 1,NSTATES
IF(PSEL(ISTATE).GT.0) THEN
RMINT= RD(1,ISTATE)
RMAXT= RD(NDATPT(ISTATE),ISTATE)
RHT= RD(2,ISTATE) - RD(1,ISTATE)
nPointSR(ISTATE)= RMINT/RHT
IF(OSEL(ISTATE) .NE. 0) THEN
IF(RMAXT .GT. 100.0) THEN
nPointLR(ISTATE)= 0
ELSE
nPointLR(ISTATE)= (100.0-RMAXT)
& /(RHT*OSEL(ISTATE))
ENDIF
ENDIF
CALL VGEN(ISTATE,-1.0d0,VDIST,BETADIST,0)
IF(OSEL(ISTATE).NE.0) THEN
DO I= 1,nPointSR(ISTATE),OSEL(ISTATE)
c ... generate potential & exponent values in inner extrapolation region
RDIST= RHT*DBLE(I-1)
CALL VGEN(ISTATE,RDIST,VDIST,BETADIST,0)
Vsr(I,ISTATE)= VDIST
Bsr(I,ISTATE)= BETADIST
ENDDO
DO I= 1,nPointLR(ISTATE)
c ... generate potential & exponent values in outer extrapolation region
RDIST= RMAXT + RHT*DBLE(I*OSEL(ISTATE))
CALL VGEN(ISTATE,RDIST,VDIST,BETADIST,0)
Plr(I,ISTATE)= VDIST
Blr(I,ISTATE)= BETADIST
ENDDO
ENDIF
ENDIF
ENDDO
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** Call subroutine to print out a summary of the converged and fixed
c values to standard output (channel-6).
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CALL WRITEPOT(2,SLABL,NAME,DECM,PV,PU,PS)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** If chosen, output file(s) will be created for the export of the
c generated functions: V, BETAFX, UAR/UBR, or TAR/TBR and their
c respective uncertainties.
DO ISTATE= 1, NSTATES
IF(OSEL(ISTATE).GT.0) THEN
IF(PSEL(ISTATE).GT.0) THEN
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** Call subroutine to print out the generated functions and their
c respective uncertainties.
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CALL FUNUNC(ISTATE,WRITFILE,PU,CM)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ELSE
DO I= 1,NDATPT(NSTATES),OSEL(ISTATE)
WRITE(18,900) RD(I,ISTATE),VPOT(I,NSTATES)
ENDDO
ENDIF
ENDIF
ENDDO
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
c** Call subroutine to print out summary of dimensionless standard
c errors on a band-by-band basis, and (if desired) print [obs.-calc.]
c values to channel-8.
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CALL DIFFSTATS(NSTATES,NPTOT,ROBUST,MKPRED)
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IF(uBv.GT.0) THEN
c** If desired, calculate Bv uncertainties
CALL UNCBV(NPTOT,PV,PU,CM)
ENDIF
STOP
900 FORMAT(5X,G18.8,5X,G18.8)
END
c23456789 123456789 123456789 123456789 123456789 123456789 123456789 12
c***********************************************************************
SUBROUTINE MASSES(IAN,IMN,NAME,GELGS,GNS,MASS,ABUND)
c***********************************************************************
c** For isotope with (input) atomic number IAN and mass number IMN,
c return (output): (i) as the right-adjusted 2-character variable NAME
c the alphabetic symbol for that element, (ii) the ground state
c electronic degeneracy GELGS, (iii) the nuclear spin degeneracy GNS,
c (iv) the atomic mass MASS [amu], and (v) the natural isotopic
c abundance ABUND [in percent]. GELGS values based on atomic states
c in Moore's "Atomic Energy Level" tables, the isotope masses are taken
c from the 2003 mass table [Audi, Wapstra & Thibault, Nucl.Phys. A729,
c 337-676 (2003)] and other quantities from Tables 6.2 and 6.3 of
c "Quantities, Units and Symbols in Physical Chemistry", by Mills et
c al. (Blackwell, 2'nd Edition, Oxford, 1993).
c** If the input value of IMN does not equal one of the tabulated values
c for atomic species IAN, return the abundance-averaged standard atomic
c weight of that atom and set GNS=-1 and ABUND=-1.
c COPYRIGHT 2005-2010
c** By R.J. Le Roy (with assistance from G.T. Kraemer & J.Y. Seto).
c Last modified 25 July 2010 (added proton, d, t)
c***********************************************************************
REAL*8 zm(123,0:10),mass,ab(123,10),abund
INTEGER i,ian,imn,gel(123),nmn(123),mn(123,10),ns2(123,10),
1 gelgs, gns
CHARACTER*2 NAME,AT(123)
c
DATA at(1),gel(1),nmn(1),(mn(1,i),i=1,6)/' H',2,6,1,2,3,4,5,6/
DATA (zm(1,i),i=0,6)/1.00794d0, 1.00782503207d0, 2.0141017778d0,
1 3.0160492777d0,1.00727646677d0,2.013553212724d0,
2 3.0155007134d0/
DATA (ns2(1,i),i=1,3)/1,2,1/
DATA (ab(1,i),i=1,3)/99.985d0,0.015d0,0.d0/
c
DATA at(2),gel(2),nmn(2),(mn(2,i),i=1,2)/'He',1,2,3,4/
DATA (zm(2,i),i=0,2)/4.002602d0, 3.0160293191d0, 4.00260325415d0/
DATA (ns2(2,i),i=1,2)/1,0/
DATA (ab(2,i),i=1,2)/0.000137d0,99.999863d0/
c
DATA at(3),gel(3),nmn(3),(mn(3,i),i=1,2)/'Li',2,2,6,7/
DATA (zm(3,i),i=0,2)/6.941d0, 6.015122795d0, 7.01600455d0/
DATA (ns2(3,i),i=1,2)/2,3/
DATA (ab(3,i),i=1,2)/7.5d0,92.5d0/
c
DATA at(4),gel(4),nmn(4),(mn(4,i),i=1,1)/'Be',1,1,9/
DATA (zm(4,i),i=0,1)/9.012182d0, 9.0121822d0/
DATA (ns2(4,i),i=1,1)/3/
DATA (ab(4,i),i=1,1)/100.d0/
c
DATA at(5),gel(5),nmn(5),(mn(5,i),i=1,2)/' B',2,2,10,11/
DATA (zm(5,i),i=0,2)/10.811d0, 10.0129370d0, 11.0093054d0/
DATA (ns2(5,i),i=1,2)/6,3/
DATA (ab(5,i),i=1,2)/19.9d0,80.1d0/
c
DATA at(6),gel(6),nmn(6),(mn(6,i),i=1,3)/' C',1,3,12,13,14/
DATA (zm(6,i),i=0,3)/12.011d0, 12.d0, 13.0033548378d0,
1 14.003241989d0/
DATA (ns2(6,i),i=1,3)/0,1,0/
DATA (ab(6,i),i=1,3)/98.90d0,1.10d0, 0.d0/
c
DATA at(7),gel(7),nmn(7),(mn(7,i),i=1,2)/' N',4,2,14,15/
DATA (zm(7,i),i=0,2)/14.00674d0, 14.0030740048d0, 15.0001088982d0/
DATA (ns2(7,i),i=1,2)/2,1/
DATA (ab(7,i),i=1,2)/99.634d0,0.366d0/
c
DATA at(8),gel(8),nmn(8),(mn(8,i),i=1,3)/' O',5,3,16,17,18/
DATA (zm(8,i),i=0,3)/15.9994d0, 15.99491461956d0, 16.99913170d0,
1 17.9991610d0/
DATA (ns2(8,i),i=1,3)/0,5,0/
DATA (ab(8,i),i=1,3)/99.762d0, 0.038d0, 0.200d0/
c
DATA at(9),gel(9),nmn(9),(mn(9,i),i=1,1)/' F',4,1,19/
DATA (zm(9,i),i=0,1)/18.9984032d0, 18.99840322d0/
DATA (ns2(9,i),i=1,1)/1/
DATA (ab(9,i),i=1,1)/100.d0/
c
DATA at(10),gel(10),nmn(10),(mn(10,i),i=1,3)/'Ne',1,3,20,21,22/
DATA (zm(10,i),i=0,3)/20.1797d0, 19.9924401754d0, 20.99384668d0,
1 21.991385114d0/
DATA (ns2(10,i),i=1,3)/0,3,0/
DATA (ab(10,i),i=1,3)/90.48d0, 0.27d0, 9.25d0/
c
DATA at(11),gel(11),nmn(11),(mn(11,i),i=1,1)/'Na',2,1,23/
DATA (zm(11,i),i=0,1)/22.989768d0, 22.9897692809d0/
DATA (ns2(11,i),i=1,1)/3/
DATA (ab(11,i),i=1,1)/100.d0/
c
DATA at(12),gel(12),nmn(12),(mn(12,i),i=1,3)/'Mg',1,3,24,25,26/
DATA (zm(12,i),i=0,3)/24.3050d0, 23.985041700d0, 24.98583692d0,
1 25.982592929d0/
DATA (ns2(12,i),i=1,3)/0,5,0/
DATA (ab(12,i),i=1,3)/78.99d0, 10.00d0, 11.01d0/
c
DATA at(13),gel(13),nmn(13),(mn(13,i),i=1,1)/'Al',2,1,27/
DATA (zm(13,i),i=0,1)/26.981539d0, 26.98153863d0/
DATA (ns2(13,i),i=1,1)/5/
DATA (ab(13,i),i=1,1)/100.d0/
c
DATA at(14),gel(14),nmn(14),(mn(14,i),i=1,3)/'Si',1,3,28,29,30/
DATA (zm(14,i),i=0,3)/28.0855d0, 27.9769265325d0, 28.976494700d0,
1 29.97377017d0/
DATA (ns2(14,i),i=1,3)/0,1,0/
DATA (ab(14,i),i=1,3)/92.23d0, 4.67d0, 3.10d0/
DATA at(15),gel(15),nmn(15),(mn(15,i),i=1,1)/' P',4,1,31/
DATA (zm(15,i),i=0,1)/30.973762d0, 30.97376163d0/
DATA (ns2(15,i),i=1,1)/1/
DATA (ab(15,i),i=1,1)/100.d0/
c
DATA at(16),gel(16),nmn(16),(mn(16,i),i=1,4)/' S',5,4,32,33,34,36/
DATA (zm(16,i),i=0,4)/32.066d0, 31.97207100d0, 32.97145876d0,
1 33.96786690d0, 35.96708076d0/
DATA (ns2(16,i),i=1,4)/0,3,0,0/
DATA (ab(16,i),i=1,4)/95.02d0, 0.75d0, 4.21d0, 0.02d0/
c
DATA at(17),gel(17),nmn(17),(mn(17,i),i=1,2)/'Cl',4,2,35,37/
DATA (zm(17,i),i=0,2)/35.4527d0, 34.96885268d0, 36.96590259d0/
DATA (ns2(17,i),i=1,2)/3,3/
DATA (ab(17,i),i=1,2)/75.77d0, 24.23d0/
c
DATA at(18),gel(18),nmn(18),(mn(18,i),i=1,3)/'Ar',1,3,36,38,40/
DATA (zm(18,i),i=0,3)/39.948d0, 35.967545106d0, 37.9627324d0,
1 39.9623831225d0/
DATA (ns2(18,i),i=1,3)/0,0,0/
DATA (ab(18,i),i=1,3)/0.337d0, 0.063d0, 99.600d0/
c
DATA at(19),gel(19),nmn(19),(mn(19,i),i=1,3)/' K',2,3,39,40,41/
DATA (zm(19,i),i=0,3)/39.0983d0, 38.96370668d0, 39.96399848d0,
1 40.96182576d0/
DATA (ns2(19,i),i=1,3)/3,8,3/
DATA (ab(19,i),i=1,3)/93.2581d0, 0.0117d0, 6.7302d0/
DATA at(20),gel(20),nmn(20),(mn(20,i),i=1,6)/'Ca',1,6,40,42,43,44,
1 46,48/
DATA (zm(20,i),i=0,6)/40.078d0, 39.96259098d0, 41.95861801d0,
1 42.9587666d0, 43.9554818d0, 45.9536926d0, 47.952534d0/
DATA (ns2(20,i),i=1,6)/0,0,7,0,0,0/
DATA (ab(20,i),i=1,6)/96.941d0, 0.647d0, 0.135d0, 2.086d0,
1 0.004d0, 0.187d0/
c
DATA at(21),gel(21),nmn(21),(mn(21,i),i=1,1)/'Sc',4,1,45/
DATA (zm(21,i),i=0,1)/44.955910d0, 44.9559119d0/
DATA (ns2(21,i),i=1,1)/7/
DATA (ab(21,i),i=1,1)/100.d0/
c
DATA at(22),gel(22),nmn(22),(mn(22,i),i=1,5)/'Ti',5,5,46,47,48,49,
1 50/
DATA (zm(22,i),i=0,5)/47.88d0, 45.9526316d0, 46.9517631d0,
1 47.9479463d0, 48.9478700d0, 49.9447912d0/
DATA (ns2(22,i),i=1,5)/0,5,0,7,0/
DATA (ab(22,i),i=1,5)/8.0d0, 7.3d0, 73.8d0, 5.5d0, 5.4d0/
c
DATA at(23),gel(23),nmn(23),(mn(23,i),i=1,2)/' V',4,2,50,51/
DATA (zm(23,i),i=0,2)/50.9415d0, 49.9471585d0, 50.9439595d0/
DATA (ns2(23,i),i=1,2)/12,7/
DATA (ab(23,i),i=1,2)/0.250d0, 99.750d0/
c
DATA at(24),gel(24),nmn(24),(mn(24,i),i=1,4)/'Cr',7,4,50,52,53,54/
DATA (zm(24,i),i=0,4)/51.9961d0, 49.9460442d0, 51.9405075d0,
1 52.9406494d0, 53.9388804d0/
DATA (ns2(24,i),i=1,4)/0,0,3,0/
DATA (ab(24,i),i=1,4)/4.345d0, 83.789d0, 9.501d0, 2.365d0/
c
DATA at(25),gel(25),nmn(25),(mn(25,i),i=1,1)/'Mn',6,1,55/
DATA (zm(25,i),i=0,1)/54.93805d0, 54.9380451d0/
DATA (ns2(25,i),i=1,1)/5/
DATA (ab(25,i),i=1,1)/100.d0/