forked from valentastanislav/dicebox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fce_common.f90
2420 lines (2394 loc) · 88.8 KB
/
fce_common.f90
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
!TODO gilbert cameron and spin distribution of initial states email jutta escher
!TODO NOPTE1.EQ.65 -> 75, added scaling with PAR_E1(1)
!TODO ETR deleted, replaced by PAR_E1(1) or PAR_M1(1) in relevant models
!TODO added TCONST parameter, now in models 39,46,56,74,75,76,79
!TODO deleted 78 as it was the 74
!TODO check about the models 48,49
module spolecne
use lokalni_fce
integer:: nbin,LMODE,LDENP,LDSTAG,NLD,NGIGE,NLOWLOR,NGIGM,NGIGE2,NOPTE1,NOPTM1,NOPTE2
integer:: max_decays,numlev,NOPTDE
real:: BN,AMASS,DELTA,PAIRING,FJ
real:: ASHELL09,DEL09,TEMPER09,EZERO09,PAIRING09,SIG_CUSTOM,EZERO,TEMPER,DEL,ASHELL
real:: DENLO,DENHI,DENPA,DENPB,DENPC,DENPD,ZNUM,DENPPC,DENPA0,DENPA1,DENPA2
real:: FERMC,TCONST,PAIR_PSF,DEG,DMG,QEL,EK0
real:: EGZERO,DIPSLP,DIPZER,EFEC_E
real, dimension(1:4):: PAR_E1,PAR_M1
integer, dimension(1:199):: denum,LVL_CLASS
integer, dimension(0:49,0:1):: NDIS,NEIGENVAL
integer, dimension(1:199,1:20):: delev,deparity
integer,dimension(:,:),allocatable:: ityp
real, dimension(1:5):: ER,SIG,W0,ERM,SIGM,WM0,ERE,SIGE,WE0
real, dimension(1:199):: LVL_ENERGY
real, dimension(0:270):: TABENLD
real, dimension(1:199,0:20):: sal,errsal,alpha !TODO somehow smart determine the maximum number of decays in DIS and make these allocatable
real, dimension(0:24,0:20):: F4
real, dimension(1:199,1:20):: despin
real, dimension(1:20,0:49,0:1):: ENDIS
real, dimension(0:270,0:49,0:1):: TABLD
integer, dimension(1:3):: NPSF
real, dimension(1:3,0:400):: TABENPSF,TABPSF
real, dimension(0:1000,0:49,0:1):: EIGENVAL
real, dimension(1:4,1:4,0:24,0:20):: Fk
contains
!***********************************************************************
SUBROUTINE ADJUST_NBIN(SPC,NBIN)
integer:: NBIN
real:: SPC
INTEGER,PARAMETER:: MAXJC = 49
INTEGER:: n_adjust,I,n_nul,J,IP
REAL:: SP,E
!globalni BN,DELTA
n_adjust=-1
DO I=NBIN,1,-1
SP=SPC-INT(SPC+.25)-1.
n_nul=0
E=BN+DELTA/2.-FLOAT(I)*DELTA
DO J=0,MAXJC
SP=SP+1.
DO IP=0,1
IF (DENSITY(E,SP,IP).EQ.0.) n_nul=n_nul+1
ENDDO
ENDDO
IF (n_nul.EQ.((MAXJC+1)*2)) THEN
235 FORMAT('in bin #',I3,' that is under energy',F11.6,' total density is zero')
WRITE(*,235) I,(BN+(FLOAT(1-I))*DELTA)
WRITE(*,*) I,(BN+(FLOAT(1-I))*DELTA),DELTA,NBIN
n_adjust=I
ENDIF
ENDDO
IF(n_adjust.NE.(-1)) THEN
NBIN=n_adjust-1
ENDIF
RETURN
END SUBROUTINE ADJUST_NBIN
!***********************************************************************
SUBROUTINE READ_INT(sall,IFLAG,U,IR4) !should be OK
!***********************************************************************
integer:: IFLAG,IR4
real:: U
real,dimension(:,:),allocatable:: sall
INTEGER:: I,J,K
REAL:: sal_tp
!global despin,deparity,delev,denum,alpha,ndis,endis,max_decays,sal,errsal
if(.not.allocated(sall)) then
allocate(sall(1:numlev,0:max_decays))
endif
DO I=1,numlev
DO K=0,max_decays
sall(I,K)=0.
ENDDO
ENDDO
sal_tp=0.
IFLAG=0
DO I=1,numlev
DO K=1,denum(I)
! write(*,*) I,K
DO J=1,ndis(ISUBSC(despin(I,K)),deparity(I,K))
IF (endis(J,ISUBSC(despin(I,K)),deparity(I,K)).EQ.endis(delev(I,K),ISUBSC(despin(I,K)),deparity(I,K))) THEN
51 sal_tp=sal(I,K)+errsal(I,K)*GAUSS(IR4,U,IFLAG) !TODO we might want to change this to better accomodate E0 transitions <-alpha here, not later
if (sal_tp.LE.0.) goto 51 !!!TODO ask FB ??/MK .LT.
sall(I,K)=sall(I,K-1)+sal_tp*(1+alpha(I,K))
ENDIF
ENDDO
ENDDO
ENDDO
RETURN
END SUBROUTINE READ_INT
!***********************************************************************
SUBROUTINE LEVELSCH(IR,IREAL,IFLAG,NTOTAL,ITID,SPC,U,LEVCON) !should be OK
!***********************************************************************
! - the Poisson distribution of neighbourhood level spacing is
! assumed for LMODE=0
! - the Wigner distribution (with long-range correlations) is
! assumed for LMODE=1
! - the "restricted Wigner distribution" - no long-range correlations
INTEGER,PARAMETER:: MAXJC = 49
INTEGER:: IP,J,I,IAUX,K,KLO,KHI
REAL:: SP,E,AVNL,X,OMEGA,ALPHA,RA
integer,dimension(:,:,:),allocatable::LEVCON
integer:: IR,IREAL,IFLAG,NTOTAL,ITID
real:: SPC,U
! vstup(BN,DELTA,LMODE,NBIN) vystup(NTOTAL,LEVCON,IFLAG)
if (.not.allocated(LEVCON)) then
allocate(LEVCON(0:NBIN,0:MAXJC,0:1))
endif
NTOTAL=0
DO IP=0,1
DO J=0,MAXJC
DO I=0,NBIN
LEVCON(I,J,IP)=0
ENDDO
ENDDO
ENDDO
IF (LMODE.EQ.0) THEN !Poisson distribution
DO IP=0,1
SP=SPC-INT(SPC+.25)-1.
DO J=0,MAXJC
SP=SP+1.
DO I=1,NBIN
E=BN+DELTA/2.-FLOAT(I)*DELTA
AVNL=DELTA*DENSITY(E,SP,IP) !neni nic nahodneho, pri paralelnim behu ma byt pocet pruchodu porad stejny
LEVCON(I,J,IP)=NPOISS(IR,AVNL,IFLAG,U)
NTOTAL=NTOTAL+LEVCON(I,J,IP)
ENDDO !I
ENDDO !J
ENDDO !IP
! WRITE(*,*) 'poissona zavolam',2*(MAXJC+1)*NBIN,' ale gausse jen',uziti_u !should be OK
ELSEIF (LMODE.EQ.1) THEN !Wigner distribution with long-range correlations
DO IP=0,1
SP=SPC-FLOAT(INT(SPC+.25))-1.
DO J=0,MAXJC
SP=SP+1.
X=10.*RAN0(IR)
K=1
8 IF (GOE_EIGEN_VAL(K,J,IP).LT.X) THEN
K=K+1
GOTO 8
ENDIF
KLO=K
DO I=NBIN,1,-1
E=BN+DELTA/2.-FLOAT(I)*DELTA
AVNL=DELTA*DENSITY(E,SP,IP)
X=X+AVNL
9 IF (GOE_EIGEN_VAL(K,J,IP).LT.X) THEN
K=K+1
GOTO 9
ENDIF
KHI=K
LEVCON(I,J,IP)=KHI-KLO
NTOTAL=NTOTAL+KHI-KLO
KLO=KHI
ENDDO !I
ENDDO !J
ENDDO !IP
ELSE !Wigner distribution - no long-range correlations
DO IP=0,1 !pouzivam i pozici LEVCON(0,...) kvuli kumulativnimu ukladani
SP=SPC-INT(SPC+.25)-1.
DO J=0,MAXJC
DO I=0,NBIN
LEVCON(I,J,IP)=0
ENDDO !I
SP=SP+1.
OMEGA=0.
ALPHA=0.
I=0
! OMEGA is a random sample drawn from the Wigner distribution;
! the expectation value of average distance between
! neighbouring levels of a given spin and parity is assumed
! to be equal to 1.
! The constant 1.1283791671 is equal to "two divided by
! square root of pi"
1 RA=RAN0(IR)
IF (RA.LE.0.) GO TO 1
OMEGA=OMEGA+1.1283791671*SQRT(-ALOG(RA))
3 IF (OMEGA.LT.ALPHA) THEN
LEVCON(I,J,IP)=LEVCON(I,J,IP)+1
NTOTAL=NTOTAL+1
GO TO 1
ELSE
I=I+1
IF (I.GT.NBIN) GO TO 2
E=BN+DELTA/2.-FLOAT(I)*DELTA
ALPHA=ALPHA+DENSITY(E,SP,IP)*DELTA
GO TO 3
ENDIF
2 CONTINUE
ENDDO !J
ENDDO !IP
ENDIF
!debug line
! CALL WRITELVLSCH(IREAL,NBIN,ITID,IFLAG,NTOTAL,LEVCON)
! NTOTAL is the total number of generated levels.
! At this moment for each value of I the variable LEVCON(...) contains
! the number of those levels of a particular spin and parity that fall
! within the corresponding energy bin (whose width is DELTA).
! The following DO-loops, however, convert this differential distribution
! of level energies into a CUMULATIVE (i.e. integral) form. This simple
! conversion leads to a significant increase of the speed of
! functio SEED.
IAUX=0
DO IP=0,1
DO J=0,MAXJC
LEVCON(0,J,IP)=IAUX
DO I=1,NBIN
LEVCON(I,J,IP)=LEVCON(I,J,IP)+LEVCON(I-1,J,IP)
ENDDO
IAUX=LEVCON(NBIN,J,IP)
ENDDO !J
ENDDO !IP
RETURN
END SUBROUTINE LEVELSCH
!***********************************************************************
REAL FUNCTION DENSITY(EEXC,SPIN,IPAR) !should be OK
!
! Explicit expressions for level density
! NOPTDE= 0: CTF-model
! = 1: Bethe's level-density formula following formulation
! of T.von Egidy et al., Nucl.Phys. A (1988)
! = 2: modified BSFG
! = 3: modified CTF
! =4,5: BSFG with modified spin cut-off parameter
! = 6: BSFG from T. von Egidy 2005
! =11: Goriely - tabulated level density
!
! Changed a factor 1/2 in the row DENSITY=DENSITY*FJ*.5
! => the parity-dependent level density allowed (PRC67,015803)
!
!***********************************************************************
REAL:: EFEC_E,SIGSQ,FJ,PARDEP,PAIRS
real:: EEXC,SPIN
integer:: IPAR
!uses 'global' variables EZERO,TEMPER,AMASS,LDENP,DEL,ASHELL,various09,...
DENSITY=0.
IF (NOPTDE.EQ.0) THEN ! CTF
EFEC_E=EEXC-EZERO
IF (EFEC_E.LE.0.) RETURN
DENSITY=EXP(EFEC_E/TEMPER)/TEMPER
SIGSQ=(.98*AMASS**.29)**2.
! SIGSQ=(2.*AMASS**.29)**2.
ELSEIF (NOPTDE.EQ.1) THEN ! BSFG
EFEC_E=EEXC-DEL
IF (EFEC_E.LE.0.) RETURN
SIGSQ=.0888*SQRT(ASHELL*EFEC_E)*AMASS**.666667
DENSITY=EXP(2.*SQRT(ASHELL*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL**.25*EFEC_E**1.25)
ELSEIF (NOPTDE.EQ.2) THEN ! modified BSFG
EFEC_E=EEXC-DEL
IF (EFEC_E.LE.0.) RETURN
SIGSQ=.0888*SQRT(ASHELL*EFEC_E)*AMASS**.666667
DENSITY=EXP(2.*SQRT(ASHELL*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL**.25*EFEC_E**1.25)
IF ((EEXC.GE.DENLO).AND.(EEXC.LE.DENHI)) THEN
FCTDEN=DENPA+DENPB*EEXC+DENPC*EEXC**2+DENPD*EEXC**3
DENSITY=DENSITY*FCTDEN
ENDIF
ELSEIF (NOPTDE.EQ.3) THEN ! modified CTF
EFEC_E=EEXC-EZERO
IF (EFEC_E.LE.0.) RETURN
DENSITY=EXP(EFEC_E/TEMPER)/TEMPER
SIGSQ=(.98*AMASS**.29)**2.
IF ((EEXC.GE.DENLO).AND.(EEXC.LE.DENHI)) THEN
FCTDEN=DENPA+DENPB*EEXC+DENPC*EEXC**2+DENPD*EEXC**3
DENSITY=DENSITY*FCTDEN
ENDIF
ELSEIF (NOPTDE.EQ.4) THEN ! BSFG, s=0.1446 (Paar,Al-Quraishi)
EFEC_E=EEXC-DEL
IF (EFEC_E.LE.0.) RETURN
SIGSQ=.1446*SQRT(ASHELL*EFEC_E)*AMASS**.666667
DENSITY=EXP(2.*SQRT(ASHELL*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL**.25*EFEC_E**1.25)
ELSEIF (NOPTDE.EQ.5) THEN ! BSFG, another s (Al-Quraishi)
EFEC_E=EEXC-DEL
IF (EFEC_E.LE.0.) RETURN
SIGSQ=.0145*0.8*SQRT(EFEC_E/ASHELL)*AMASS**1.66667
DENSITY=EXP(2.*SQRT(ASHELL*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL**.25*EFEC_E**1.25)
ELSEIF (NOPTDE.EQ.6) THEN ! BSFG - Von Egidy (2006) cut-off
EFEC_E=EEXC-DEL
IF (EFEC_E.LE.0.) RETURN
SIGSQ=.0146*(1+SQRT(1+4*ASHELL*EFEC_E))/2./ASHELL*AMASS**1.666667
DENSITY=EXP(2.*SQRT(ASHELL*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL**.25*EFEC_E**1.25)
ELSEIF (NOPTDE.EQ.66) THEN ! BSFG - Von Egidy (2006) cut-off
EFEC_E=EEXC-DEL
IF (EFEC_E.LE.0.) RETURN
IF ((SPIN.EQ.2.5).AND.(EEXC.GE.DENPC).AND.(EEXC.LE.DENPD)) RETURN
SIGSQ=.0146*(1+SQRT(1+4*ASHELL*EFEC_E))/2./ASHELL*AMASS**1.666667
DENSITY=EXP(2.*SQRT(ASHELL*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL**.25*EFEC_E**1.25)
ELSEIF (NOPTDE.EQ.67) THEN ! BSFG - Von Egidy (2006) cut-off
EFEC_E=EEXC-DEL
IF (EFEC_E.LE.0.) RETURN
IF (((SPIN.EQ.2.5).OR.(SPIN.EQ.3.5)).AND.(EEXC.GE.DENPC).AND.(EEXC.LE.DENPD)) RETURN
SIGSQ=.0146*(1+SQRT(1+4*ASHELL*EFEC_E))/2./ASHELL*AMASS**1.666667
DENSITY=EXP(2.*SQRT(ASHELL*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL**.25*EFEC_E**1.25)
ELSEIF (NOPTDE.EQ.68) THEN ! modified BSFG
EFEC_E=EEXC-DEL
IF (EFEC_E.LE.0.) RETURN
SIGSQ=.0146*(1+SQRT(1+4*ASHELL*EFEC_E))/2./ASHELL*AMASS**1.666667
DENSITY=EXP(2.*SQRT(ASHELL*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL**.25*EFEC_E**1.25)
IF ((EEXC.GE.DENLO).AND.(EEXC.LE.DENHI)) THEN
FCTDEN=DENPA+DENPB*EEXC+DENPC*EEXC**2+DENPD*EEXC**3
DENSITY=DENSITY*FCTDEN
ENDIF
ELSEIF (NOPTDE.EQ.11) THEN ! Goriely
IF (EEXC.LE.0.) RETURN
DENSITY = ALD(EEXC,SPIN,IPAR)
RETURN
ELSEIF (NOPTDE.EQ.12) THEN ! Kawano
IF (EEXC.LE.0.) RETURN
DENSITY = ALD(EEXC,SPIN,IPAR)
RETURN
ELSEIF (NOPTDE.EQ.7) THEN ! Voinov Mo BSFG
EFEC_E=EEXC-DEL
IF (EFEC_E.LE.0.) RETURN
SIGSQ=.0146*SQRT(EFEC_E/ASHELL)*AMASS**1.666667
DENSITY=EXP(2.*SQRT(ASHELL*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL**.25*EFEC_E**1.25)
ELSEIF (NOPTDE.EQ.8) THEN ! CTF von Egidy 09
EFEC_E=EEXC-EZERO09
IF (EFEC_E.LE.0.) RETURN
IF (EEXC.LE..5*PAIRING09) RETURN
DENSITY=EXP(EFEC_E/TEMPER09)/TEMPER09
SIGSQ=.391*AMASS**.675*(EEXC-.5*PAIRING09)**.312
ELSEIF (NOPTDE.EQ.9) THEN ! BSFG von Egidy 09
EFEC_E=EEXC-DEL09
IF (EFEC_E.LE.0.) RETURN
IF (EEXC.LE..5*PAIRING09) RETURN
SIGSQ=.391*AMASS**.675*(EEXC-.5*PAIRING09)**.312
DENSITY=EXP(2.*SQRT(ASHELL09*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL09**.25*EFEC_E**1.25)
ELSEIF (NOPTDE.EQ.13) THEN ! Oslo BS - CTF with BSFG von Egidy cut-off
EEFF=EEXC-DEL
IF (EEFF.LE.0.) RETURN
SIGSQ=.0146*(1+SQRT(1+4*ASHELL*EEFF))/2./ASHELL*AMASS**1.666667
EEFF=EEXC-EZERO
DENSITY=EXP(EEFF/TEMPER)/TEMPER
ELSEIF (NOPTDE.EQ.18) THEN ! CTF with custom SIGSQ
EFEC_E=EEXC-EZERO09
IF (EFEC_E.LE.0.) RETURN
DENSITY=EXP(EFEC_E/TEMPER09)/TEMPER09
SIGSQ=SIG_CUSTOM**2
ELSEIF (NOPTDE.EQ.19) THEN ! BSFG with custom SIGSQ
EFEC_E=EEXC-DEL09
IF (EFEC_E.LE.0.) RETURN
SIGSQ=SIG_CUSTOM**2
DENSITY=EXP(2.*SQRT(ASHELL09*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL09**.25*EFEC_E**1.25)
ELSEIF (NOPTDE.EQ.29) THEN ! BSFG custom for 168Er, inspired by von Egidy 09
EFEC_E=EEXC !E1_ours=0.00; NOTE needs staggering - maximum effect up to at least 2.4~MeV, probably higher
IF (EFEC_E.LE.0.) RETURN
IF (EEXC.LE..5*PAIRING09) RETURN !pairing_ours=pairing_09
SIGSQ=.28*AMASS**.695*(EEXC-.5*PAIRING09)**.14 !sigma dependence with modified coefficients
DENSITY=EXP(2.*SQRT(15.00*EFEC_E))/(16.9706*SQRT(SIGSQ)*15.00**.25*EFEC_E**1.25) !a_ours=15.00
ELSEIF (NOPTDE.EQ.39) THEN ! BSFG custom for 168Er, inspired by von Egidy 09
EFEC_E=EEXC-DEL09 ! f(J,-) significantly wider at low energies
IF (EFEC_E.LE.0.) RETURN ! same width as f(J,+) at neutron sep. energy
IF (EEXC.LE..5*PAIRING09) RETURN
IF (IPAR.EQ.0) THEN
SIGSQ=.391*AMASS**.675*(EEXC-.5*PAIRING09)**.312
ELSE
SIGSQ=SIG_CUSTOM**2.
ENDIF
DENSITY=EXP(2.*SQRT(ASHELL09*EFEC_E))/(16.9706*SQRT(SIGSQ)*ASHELL09**.25*EFEC_E**1.25)
ENDIF
!
FJ=(SPIN+.5)*EXP(-(SPIN+.5)**2/(2.*SIGSQ))/SIGSQ
! "staggering" as originally proposed by von Egidy (2009) for models 8 and 9
IF (LDSTAG.EQ.1) THEN !staggering in + parity only
IF (IPAR.EQ.0) THEN
STAG = (EEXC - DENLO) / (DENHI - DENLO)
IF (STAG.LE.0.0) STAG = 0.0
IF (STAG.GE.1.0) STAG = 1.0
IF (SPIN.LT.0.25) THEN
FJ = FJ * (1.0 + 1.02 * (1.0 - STAG) )
ELSEIF (MOD(INT(SPIN+0.25),2).EQ.0) THEN
FJ = FJ * (1.0 + 0.227 * (1.0 - STAG) )
ELSE
FJ = FJ * (1.0 - 0.227 * (1.0 - STAG) )
ENDIF
ENDIF
ELSEIF (LDSTAG.EQ.2) THEN !staggering in both parities
STAG = (EEXC - DENLO) / (DENHI - DENLO)
IF (STAG.LE.0.0) STAG = 0.0
IF (STAG.GE.1.0) STAG = 1.0
IF (SPIN.LT.0.25) THEN
FJ = FJ * (1.0 + 1.02 * (1.0 - STAG) )
ELSEIF (MOD(INT(SPIN+0.25),2).EQ.0) THEN
FJ = FJ * (1.0 + 0.227 * (1.0 - STAG) )
ELSE
FJ = FJ * (1.0 - 0.227 * (1.0 - STAG) )
ENDIF
ENDIF
!
! "Parity-dependence" term
!
IF (LDENP.EQ.0) THEN
PARDEP=0.5
ELSEIF (LDENP.EQ.2) THEN
PAIRS=DENPA0+DENPA1/AMASS**DENPA2 !see PRC67, 015803
ELSEIF (LDENP.EQ.1) THEN !see PRC67, 015803
IF (MOD(INT(AMASS+0.25),2).EQ.0) THEN
IF (MOD(INT(ZNUM+0.25),2).EQ.0) THEN
PAIRS= 1.34+75.22/AMASS**0.89 !E-E nucleus
ELSE
PAIRS=-0.90+75.22/AMASS**0.89 !O-O nucleus
ENDIF
ELSE
IF (MOD(INT(ZNUM+0.25),2).EQ.0) THEN
PAIRS=-0.08+75.22/AMASS**0.89 !E-O nucleus
ELSE
PAIRS=-0.42+75.22/AMASS**0.89 !O-E nucleus
ENDIF
ENDIF
ENDIF
IF (LDENP.GT.0) THEN
IF (IPAR.EQ.0) THEN
PARDEP=0.5*(1+1/(1+EXP(DENPPC*(EEXC-PAIRS))))
ELSE
PARDEP=0.5*(1-1/(1+EXP(DENPPC*(EEXC-PAIRS))))
ENDIF
ENDIF
! IF (IPAR.EQ.1) PARDEP=1.0-PARDEP !IPDEN zahozeno TODO
!
DENSITY=DENSITY*FJ*PARDEP
RETURN
END FUNCTION DENSITY
!***********************************************************************
REAL FUNCTION ALD(EX,SPIN,IP)
!***********************************************************************
!
! This subroutine provides cubic interpolation of values
! of level density - based on the functio AICC.
! At the lowest excitations (very low density) the linear interpolation
! is used while at higher energies a cubic interpolation is adopted
! Version from 16-MAY-09
!
real,DIMENSION(1:4):: XX,YY,A
real:: EX,SPIN
integer:: IP
INTEGER:: I,J,K,NLMIN
!
ALD = 0.0
! Low level densities treated in a special way
NLMIN=NLD
DO WHILE ((TABLD(NLMIN,ISUBSC(SPIN),IP).GT.0.0).AND.(NLMIN.GT.0))
NLMIN=NLMIN-1 !this can be anything from NLD down to 0
ENDDO
! IF ((ISUBSC(SPIN).EQ.0).AND.(IP.EQ.0)) THEN
! write(*,*) 'E_exc ',EX,' NLMIN ',NLMIN,' E_tab ',TABENLD(NLMIN),TABENLD(NLMIN+1),' LD_tab ',TABLD(NLMIN,ISUBSC(SPIN),IP)&
! ,TABLD(NLMIN+1,ISUBSC(SPIN),IP)
! ENDIF
IF (NLMIN.GE.(NLD-1)) THEN !this happens for highest spins which are non existent -> density is plain zero
! IF ((ISUBSC(SPIN).EQ.0).AND.(IP.EQ.0)) THEN
! write(*,*) 'lvl density comes out at #0 as ',ALD
! ENDIF
RETURN
ELSEIF ((NLMIN.EQ.0).OR.(EX.GT.TABENLD(NLMIN+2))) THEN ! NLMIN=0 means all densities are bigger than zero and any interpolation should be fine, otherwise we go two bins above the last zero density bin where the exp-log interpolation should be safe
IF (EX.LE.TABENLD(2)) THEN
K=0
ELSE
IF (EX.LE.TABENLD(NLD-1)) THEN
DO I=3,NLD-1
IF (EX.LE.TABENLD(I)) THEN
K=I-3
GO TO 1
ENDIF
ENDDO !I
ELSE
K=NLD-4
ENDIF
ENDIF
1 EXLOG=log(EX)
DO J=1,4
XX(J)=log(TABENLD(K+J))
YY(J)=log(TABLD(K+J,ISUBSC(SPIN),IP))
ENDDO !J
DO I=1,4
A(I)=YY(I)
DO J=1,4
IF (I.NE.J) A(I)=A(I)/(XX(J)-XX(I))
ENDDO !J
DO J=1,4
IF (I.NE.J) A(I)=A(I)*(XX(J)-EXLOG)
ENDDO !J
ALD=ALD+A(I)
ENDDO !I
ALD=exp(ALD)
! IF ((ISUBSC(SPIN).EQ.0).AND.(IP.EQ.0)) THEN
! write(*,*) 'lvl density comes out at #1 as ',ALD
! ENDIF
RETURN
ELSE !in regime near zero densities we use linear interpolation of two nearest bins
IF (EX.LE.TABENLD(1)) THEN !this should never happen, the tables should start at ~0 MeV while the E_crit should be at least few states higher
ALD = TABLD(1,ISUBSC(SPIN),IP)
! IF ((ISUBSC(SPIN).EQ.0).AND.(IP.EQ.0)) THEN
! write(*,*) 'lvl density comes out at #2 as ',ALD
! ENDIF
RETURN
ELSEIF (EX.GE.TABENLD(NLD)) THEN !this should never happen, the tables should go above the initial cascading energy
ALD = TABLD(NLD,ISUBSC(SPIN),IP)
! IF ((ISUBSC(SPIN).EQ.0).AND.(IP.EQ.0)) THEN
! write(*,*) 'lvl density comes out at #3 as ',ALD
! ENDIF
RETURN
ELSE
I=1
DO WHILE (EX.GT.TABENLD(I))
I=I+1
ENDDO
ALD = TABLD(I-1,ISUBSC(SPIN),IP) + (EX-TABENLD(I-1))*((TABLD(I,ISUBSC(SPIN),IP)-TABLD(I-1,ISUBSC(SPIN),IP))/&
(TABENLD(I)-TABENLD(I-1)))
! IF ((ISUBSC(SPIN).EQ.0).AND.(IP.EQ.0)) THEN
! write(*,*) 'lvl density comes out at #4 as ',ALD,' with I =',I
! ENDIF
RETURN
ENDIF
ENDIF
! IF ((ISUBSC(SPIN).EQ.0).AND.(IP.EQ.0)) THEN
! write(*,*) 'lvl density comes out at #5 as ',ALD
! ENDIF
RETURN
END FUNCTION ALD
!***********************************************************************
REAL FUNCTION APSF(EGX,MTYP)
!***********************************************************************
real,DIMENSION(1:4):: XX,YY,A
real:: EGX,EXLOG
INTEGER:: I,J,K,NLMIN
!
APSF = 0.0
! Low PSF treated in a special way
NLMIN=NPSF(MTYP)
DO WHILE ((TABPSF(MTYP,NLMIN).GT.0.0).AND.(NLMIN.GT.0))
NLMIN=NLMIN-1 !this is the highest bin where PSF is zero, can be anything from NPSF(MTYP) down to 0
ENDDO
IF (NLMIN.GE.(NPSF(MTYP)-1)) THEN !if all but last two are zero, return zero
RETURN
ELSEIF ((NLMIN.EQ.0).OR.(EGX.GT.TABENPSF(MTYP,NLMIN+2))) THEN ! NLMIN=0 means all PSFs are bigger than zero and any interpolation should be fine, otherwise we go two bins above the last zero PSF bin where the exp-log interpolation should be safe
IF (EGX.LE.TABENPSF(MTYP,2)) THEN
K=0
ELSE
IF (EGX.LE.TABENPSF(MTYP,NPSF(MTYP)-1)) THEN
DO I=3,NPSF(MTYP)-1
IF (EGX.LE.TABENPSF(MTYP,I)) THEN
K=I-3
GO TO 1
ENDIF
ENDDO !I
ELSE
K=NPSF(MTYP)-4
ENDIF
ENDIF
1 EXLOG=log(EGX)
DO J=1,4
XX(J)=log(TABENPSF(MTYP,K+J))
YY(J)=log(TABPSF(MTYP,K+J))
ENDDO !J
DO I=1,4
A(I)=YY(I)
DO J=1,4
IF (I.NE.J) A(I)=A(I)/(XX(J)-XX(I))
ENDDO !J
DO J=1,4
IF (I.NE.J) A(I)=A(I)*(XX(J)-EXLOG)
ENDDO !J
APSF=APSF+A(I)
ENDDO !I
APSF=exp(APSF)
RETURN
ELSE !in regime near zero PSF we use linear interpolation of two nearest bins
IF (EGX.LE.TABENPSF(MTYP,1)) THEN !this should never happen, the tables should start at ~0 MeV while the E_crit should be at least few states higher
APSF = TABPSF(MTYP,1)
RETURN
ELSEIF (EGX.GE.TABENPSF(MTYP,NPSF(MTYP))) THEN !this should never happen, the tables should go above the initial cascading energy
APSF = TABPSF(MTYP,NPSF(MTYP))
RETURN
ELSE
I=1
DO WHILE (EGX.GT.TABENPSF(MTYP,I))
I=I+1
ENDDO
APSF = TABPSF(MTYP,I-1) +(EGX-TABENPSF(MTYP,I-1))*((TABPSF(MTYP,I)-TABPSF(MTYP,I-1))/(TABENPSF(MTYP,I)-TABENPSF(MTYP,I-1)))
RETURN
ENDIF
ENDIF
RETURN
END FUNCTION APSF
!***********************************************************************
SUBROUTINE GENERATE_GOE_EIGEN_VAL(IR,N,IFLAG,U) !should be OK
!***********************************************************************
! Generates eigenvalues of random matrices - they are stored in
! the EIGENVAL,NEIGENVAL and are used for generating level in the
! subroutine LEVELSCH via calling GOE_EIGEN_VAL
!
INTEGER,PARAMETER:: MAXJC=49
DOUBLE PRECISION,PARAMETER:: DPI=3.141592653589793d0
INTEGER:: IP,IS,I,J,M,L,MM
REAL:: EIG0
REAL*8 A(N,N),RA(N),RAORD(N),X
integer:: IR,N,IFLAG
real:: U
!globalni EIGENVAL,NEIGENVAL
!
DO IP=0,1
DO IS=0,MAXJC
DO I=1,N
A(I,I)=DBLE(GAUSS(IR,U,IFLAG)/SQRT(2.*FLOAT(N-1)))
DO J=I+1,N
A(I,J)=DBLE(GAUSS(IR,U,IFLAG)/SQRT(4.*FLOAT(N-1)))
A(J,I)=A(I,J)
ENDDO !J
ENDDO !I
CALL RSM1(N,N,A,RA)
CALL SORT(N,RA,RAORD)
DO I = 1,N
RA(I) = RAORD(I)
ENDDO
M=-1
DO L=1,N
X=RA(L)
IF (DABS(X).lt.0.9d0) THEN !Only eigenval. in the middle are treated
M=M+1
EIGENVAL(M,IS,IP)=FLOAT(N-1)*(SNGL((X*DSQRT(1.d0-X**2)+DASIN(X))/DPI+.5d0))
ENDIF
ENDDO !L
NEIGENVAL(IS,IP)=M
EIG0=EIGENVAL(0,IS,IP)
DO MM=M,0,-1
EIGENVAL(MM,IS,IP)=EIGENVAL(MM,IS,IP)-EIG0
ENDDO !MM
ENDDO !IS
ENDDO !IP
RETURN
END SUBROUTINE GENERATE_GOE_EIGEN_VAL
!***********************************************************************
REAL FUNCTION GOE_EIGEN_VAL(N,IS,IP) !integer aritmetics?
!***********************************************************************
!
! Eigenvalues were generated at the beginning
! by SUBROUTINE GENERATE_GOE_EIGEN_VAL(IR,N,IFLAG,U)
!
INTEGER:: NN,K
integer:: N,IS,IP
!global NEIGENVAL,EIGENVAL
NN=NEIGENVAL(IS,IP)
K=N-(N/NN)*NN
GOE_EIGEN_VAL=EIGENVAL(K,IS,IP)+FLOAT((N/NN)*NN)
RETURN
END FUNCTION GOE_EIGEN_VAL
!***********************************************************************
REAL FUNCTION SGAMMA(EGAM,EINI,ITYP)
!
! Photon strengths for E1, M1+E2, M1 and E2 transitions. "Photon
! strength" does not mean "photon strength functio" here, but
! photon strength functio multiplied by EGAM**(2*L+1) and, in
! the case of M1+E2 transitions, summed over both XL-components.
!
! ITYP is equal to 1, 2, 3 or 4 (see ITYPE functio)
! EINI is the initial state energy in MeV
! EGAM is gamma-ray energy in MeV
!
! E1: NOPTE1= 0: Single-particle approximation
! 1: Classical Lorentzian GDER
! 2: GDER with an energy and temperature dependent
! damping width (J.Kopecky, R.Chrien, Nucl.Phys.
! A468,p.285)
! 3: correct EGLO model - see 6
! 4: Kadmenskij-Markushev-Furman original Strength functio
! (no high energy approximation according to Chrien)
! 5: The Chrien's Strength functio (Nucl. Phys. A468, 285
! (1987)) only. In 3: is this model used only for
! high energy region
! 6: The strength functio according to Chrien with
! phenomenological temperature dependent damping
! proposed by Kopecky (Distribution of Radiative Strength
! in Gd-156, 157 and 158 Nuclei)
! - I have found an error, correct EGLO is 3:
! 7: GDER with phenomenological temperature dependent
! damping width proposed by Kopecky
! 8: 4: with the first resonance of Lorentz type
! 9: 6: with the first resonance of Lorentz type
! 10: KMF (4:) for EG<4 MeV; lin. combination of KMF and BA
! for 4 MeV<EG<8 MeV; BA (1:) for EG>8 MeV
! 31-40: correspond to 1-10 for high EGAM; for low EGAM original
! values are multiplied by a factor (given in input data)
! in between the PSF is a linear combination ...
! motivation comes from Au
! 51: KMF (4:) without temperature-dependent term in damping
! width
! 52: EGLO (6:) without temperature-dependent term in damping
! width; temperature is taken into account only in the
! "second term" - FK*...
! 53: EELO (7:) without temperature-dependent term in damping
! width - i.e. no termperature dependence assumed
! 41: KMF according to Oslo group
!
! M1: NOPTM1= 0: Single-particle approximation
! 1: Classical lorentzian GDMR
! 3: Scissors (first) resonance is build up only on states
! with excitation energy lower than PAR_M1(1)
! 4: Classical lorentzian build on the "background"
! that is described by the SP (constant functio)
!
! ?: Enery of scissors resonance depends linearly on
! the energy of final state (and is build up only on states
! below certain excitation energy)
! ?: Scissors resonance is considered only for primary transitions
!
! ?: power dependence
!
! E2: NOPTE2= 0: Single-particle approximation
! 1: Classical Lorentzian GQER
!
!***********************************************************************
!
REAL,PARAMETER:: PIH= 8.673592583E-08,& ! 1/(3*(pi*hbar*c)**2)
PIHQ= 5.204155555E-08,& ! 1/(5*(pi*hbar*c)**2)
PI42=39.4784176 ! 4*pi**2
REAL:: SFCEE1,SFCEM1,SFCEE2,Q,QQ,TFIN,W,WPHEN,SLIM,x,FACTOR,ALPPL,ER0PL,WD,WDR,WR,FKs0,FNS,EFERMI,WWALL,Efinal
INTEGER:: I
integer:: ITYP
real:: EGAM,EINI
SGAMMA=0.
SFCEM1=0
SFCEE2=0
IF ((ITYP.GT.4).OR.(ITYP.LT.1).OR.(EGAM.LE.0.)) RETURN
!
!***** E1 component
!
IF (ITYP.EQ.1) THEN
!
IF (NOPTE1.EQ.0) THEN ! The single-particle approximation
SGAMMA=DEG*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.1) THEN ! Classical Lorentzian
Q=0.
DO I=1,NGIGE ! loop over both GDR peaks
QQ=SIG(I)*(EGAM*W0(I)**2/((EGAM**2-ER(I)**2)**2+(EGAM*W0(I))**2))
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.11) THEN ! Goriely tables
SGAMMA = APSF(EGAM,1)
SGAMMA = SGAMMA + EINI * PAR_E1(1) / (1.0+EXP(EGAM-PAR_E1(2)))
SGAMMA = SGAMMA * EGAM**3
SFCEE1=SGAMMA
RETURN
ELSEIF (NOPTE1.EQ.50) THEN ! Goriely tables
SGAMMA = APSF(EGAM,1)*EGAM**3
Q=0.
DO I=1,NGIGE ! loop over both GDR peaks
QQ=SIG(I)*(EGAM*W0(I)**2/((EGAM**2-ER(I)**2)**2+(EGAM*W0(I))**2))
Q=Q+QQ
ENDDO
SGAMMA = SGAMMA + PIH*Q*EGAM**3
SFCEE1=SGAMMA
RETURN
ELSEIF (NOPTE1.EQ.91) THEN !SLO with exponential low energy enhancement as requested by Artemis
Q=SIG(1)*EXP(-(EGAM-ER(1))*W0(1))
DO I=2,NGIGE
QQ=SIG(I)*(EGAM*W0(I)**2/((EGAM**2-ER(I)**2)**2+(EGAM*W0(I))**2))
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.2) THEN !ELO = GDER with E,T-dependent damping
TFIN=TERM(EINI-EGAM)
Q=0.
DO I=1,NGIGE
W=W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2 !energy and temperature dependent width
QQ=SIG(I)*W0(I)*(EGAM*W/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2))
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.3) THEN !Empirical generalization of temperature
! dependent damping according to Kopecky in Chrien model (EGLO)
TFIN=TERM(EINI-EGAM)
Q=0.
DO I=1,NGIGE
WPHEN=EK0+(1.-EK0)*(EGAM-EGZERO)/(ER(I)-EGZERO)
W=WPHEN*W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2 !energy and temperature dependent width
WPHENZ=EK0-(1.-EK0)*EGZERO/(ER(I)-EGZERO)
SLIM=WPHENZ*FERMC*PI42*TFIN**2*W0(I)/ER(I)**5 !the non-zero limit at Egam-->0
QQ=SIG(I)*W0(I)*(SLIM+EGAM*W/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2))
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.4) THEN ! Pure Fermi liquid theory (Kadmenskij)
TFIN=TERM(EINI-EGAM) ! (no high energy approximation)
Q=0.
DO I=1,NGIGE
W=W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
QQ=FERMC*SIG(I)*W0(I)*W*ER(I)/(EGAM**2-ER(I)**2)**2
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.5) THEN !GLO as called nowdays, Pure Chrien model (similar to !OPT=3,but no Kadmenskij for low EGAM) viz Kopecky
TFIN=TERM(EINI-EGAM)
Q=0.
DO I=1,NGIGE
W=W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2 !energy and temperature dependent width
SLIM=FERMC*PI42*TFIN**2*W0(I)/ER(I)**5 !the non-zero limit at Egam-->0
QQ=SIG(I)*W0(I)*(SLIM+EGAM*W/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2))
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.56) THEN !GLO with constant temperature and low-energy enhancement (for Artemis)
TFIN=TCONST
Q=SIG(1)*EXP(-W0(1)*(EGAM-ER(1)))
DO I=2,NGIGE
W=W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
SLIM=FERMC*PI42*TFIN**2*W0(I)/ER(I)**5
QQ=SIG(I)*W0(I)*(SLIM+EGAM*W/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2))
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.6) THEN !MGLO <-Empirical generalization of temperature dependent damping from EGLO(3)
TFIN=TERM(EINI-EGAM)
Q=0.
DO I=1,NGIGE
WPHEN=EK0+(1.-EK0)*(EGAM-EGZERO)/(ER(I)-EGZERO)
W=WPHEN*W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2 !energy and temperature dependent width
SLIM=FERMC*PI42*TFIN**2*W0(I)/ER(I)**5 !the non-zero limit at Egam-->0
QQ=SIG(I)*W0(I)*(SLIM+EGAM*W/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2))
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.7) THEN ! SMLO
IF (EGAM.LE.EINI) THEN
TFIN=SQRT((EINI-EGAM)/AMASS*10.0)
ELSE
TFIN=0.0
ENDIF
Q=0.
DO I=1,NGIGE
W=W0(I)*(EGAM*ER(I)+PI42*TFIN**2)/ER(I)**2
QQ=SIG(I)*W0(I)*W*EGAM / (1.0-EXP(-EGAM/TFIN))/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2)
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
SFCEE1=SGAMMA
RETURN
ELSEIF (NOPTE1.EQ.207) THEN !Empirical generelization of temperature dependent damping according to Kopecky aplied to TD model (EELO)
TFIN=TERM(EINI-EGAM)
Q=0.
DO I=1,NGIGE
WPHEN=EK0+(1.-EK0)*(EGAM-EGZERO)/(ER(I)-EGZERO)
W=WPHEN*W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2 !energy and temperature dependent width
QQ=SIG(I)*W0(I)*(EGAM*W/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2))
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.8) THEN ! Fermi liquid theory (Kadmenskij)
TFIN=TERM(EINI-EGAM) ! with 1st resonance of Lorentz. shape
Q=0.
QQ=SIG(1)*(EGAM*W0(1)**2/((EGAM**2-ER(1)**2)**2+(EGAM*W0(1))**2))
Q=Q+QQ
DO I=2,NGIGE
W=W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
QQ=FERMC*SIG(I)*W0(I)*W*ER(I)/(EGAM**2-ER(I)**2)**2
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.9) THEN !Our empirical generalization of temperature
! dependent damping according to Kopecky in Chrien model (MGLO)
! with the first resonance of Lorentzian type
TFIN=TERM(EINI-EGAM)
Q=0.
QQ=SIG(1)*(EGAM*W0(1)**2/((EGAM**2-ER(1)**2)**2+(EGAM*W0(1))**2))
Q=Q+QQ
DO I=2,NGIGE
WPHEN=EK0+(1.-EK0)*(EGAM-EGZERO)/(ER(I)-EGZERO)
W=WPHEN*W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2 !energy and temperature dependent width
SLIM=FERMC*PI42*TFIN**2*W0(I)/ER(I)**5 !the non-zero limit at Egam-->0
QQ=SIG(I)*W0(I)*(SLIM+EGAM*W/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2))
Q=Q+QQ
ENDDO
SGAMMA=PIH*Q*EGAM**3
RETURN
ELSEIF (NOPTE1.EQ.10) THEN ! KMF for low energies
TFIN=TERM(EINI-EGAM) ! Mix KMF and BA for higher energies
Q=0.
IF (EGAM.LE.PAR_E1(1)) THEN
DO I=1,NGIGE
W=W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
QQ=FERMC*SIG(I)*W0(I)*W*ER(I)/(EGAM**2-ER(I)**2)**2
Q=Q+QQ
ENDDO
ELSE
x=(EGAM-PAR_E1(1))/(PAR_E1(2)-PAR_E1(1)) ! Admixture of BA to KMF
IF (x.GT.1.) x=1.
DO I=1,NGIGE
QQ=SIG(I)*(EGAM*W0(I)**2/((EGAM**2-ER(I)**2)**2+(EGAM*W0(I))**2))
Q=Q+x*QQ
W=W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
QQ=FERMC*SIG(I)*W0(I)*W*ER(I)/(EGAM**2-ER(I)**2)**2
Q=Q+(1.-x)*QQ
ENDDO
ENDIF
SGAMMA=PIH*Q*EGAM**3
RETURN
!
ELSEIF (NOPTE1.EQ.31) THEN ! Classical Lor.; suppressed for small EGAM
Q=0.
DO I=1,NGIGE ! loop over both GDR peaks
QQ=SIG(I)*(EGAM*W0(I)**2/((EGAM**2-ER(I)**2)**2+(EGAM*W0(I))**2))
Q=Q+QQ
ENDDO
x=DIPSLP*EGAM+DIPZER
if (x.LT.PAR_E1(3)) x=PAR_E1(3)
if (x.GT.1.0) x=1.0
SGAMMA=PIH*Q*EGAM**3*x
RETURN
ELSEIF (NOPTE1.EQ.34) THEN ! Pure Fermi liquid theory (Kadmenskij)
! suppressed for small EGAM
TFIN=TERM(EINI-EGAM)
Q=0.
DO I=1,NGIGE
W=W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
QQ=FERMC*SIG(I)*W0(I)*W*ER(I)/(EGAM**2-ER(I)**2)**2
Q=Q+QQ
ENDDO
x=DIPSLP*EGAM+DIPZER
if (x.LT.PAR_E1(3)) x=PAR_E1(3)
if (x.GT.1.0) x=1.0
SGAMMA=PIH*Q*EGAM**3*x
RETURN
ELSEIF (NOPTE1.EQ.35) THEN ! Pure Fermi liquid theory (Kadmenskij)
! suppressed for small EGAM (34); no restriction for large Eg
TFIN=TERM(EINI-EGAM)
Q=0.
DO I=1,NGIGE
W=W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
QQ=FERMC*SIG(I)*W0(I)*W*ER(I)/(EGAM**2-ER(I)**2)**2
Q=Q+QQ
ENDDO
x=DIPSLP*EGAM+DIPZER
if (x.LT.PAR_E1(3)) x=PAR_E1(3)
! if (x.GT.1.0) x=1.0
SGAMMA=PIH*Q*EGAM**3*x
RETURN
ELSEIF (NOPTE1.EQ.36) THEN !TODO from which is this derived: EGLO (6 - incorrect); suppressed for small EGAM
TFIN=TERM(EINI-EGAM)
Q=0.
DO I=1,NGIGE
WPHEN=EK0+(1.-EK0)*(EGAM-EGZERO)/(ER(I)-EGZERO)
W=WPHEN*W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
SLIM=FERMC*PI42*TFIN**2*W0(I)/ER(I)**5
QQ=SIG(I)*W0(I)*(SLIM+EGAM*W/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2))
Q=Q+QQ
ENDDO
x=DIPSLP*EGAM+DIPZER
if (x.LT.PAR_E1(3)) x=PAR_E1(3)
if (x.GT.1.0) x=1.0
SGAMMA=PIH*Q*EGAM**3*x
RETURN
ELSEIF (NOPTE1.EQ.37) THEN !EELO; suppressed for small EGAM
TFIN=TERM(EINI-EGAM)
Q=0.
DO I=1,NGIGE
WPHEN=EK0+(1.-EK0)*(EGAM-EGZERO)/(ER(I)-EGZERO)
W=WPHEN*W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
QQ=SIG(I)*W0(I)*(EGAM*W/((EGAM**2-ER(I)**2)**2+(EGAM*W)**2))
Q=Q+QQ
ENDDO
x=DIPSLP*EGAM+DIPZER
if (x.LT.PAR_E1(3)) x=PAR_E1(3)
if (x.GT.1.0) x=1.0
SGAMMA=PIH*Q*EGAM**3*x
RETURN
! TODO change the PAR_E1(1) - talk to MK about the logic of this
ELSEIF (NOPTE1.EQ.73) THEN ! EGLO(3) with constant T
TFIN=TCONST
Q=0.
DO I=1,NGIGE
WPHEN=EK0+(1.-EK0)*(EGAM-EGZERO)/(ER(I)-EGZERO)
W=WPHEN*W0(I)*(EGAM**2+PI42*TFIN**2)/ER(I)**2
WPHENZ=EK0-(1.-EK0)*EGZERO/(ER(I)-EGZERO)