-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathirad.f90
4456 lines (3980 loc) · 173 KB
/
irad.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
MODULE RADCONS
! Radiation Parameters
USE PRECISION_PARAMETERS
IMPLICIT NONE
LOGICAL :: WIDE_BAND_MODEL,CH4_BANDS
INTEGER :: TIME_STEP_INCREMENT,NMIEANG
REAL(EB) :: RADTMP,PATH_LENGTH,RADIATIVE_FRACTION
REAL(EB), ALLOCATABLE, DIMENSION(:) :: BBFRAC,WL_LOW,WL_HIGH
REAL(EB), ALLOCATABLE, DIMENSION(:,:) :: WQABS, WQSCA
INTEGER :: NRDMIE, NLMBDMIE, NDG=50
REAL(EB) DGROUP_A, DGROUP_B, WEIGH_CYL
REAL(EB), ALLOCATABLE, DIMENSION(:,:) :: DLN
REAL(EB), ALLOCATABLE, DIMENSION(:) :: RSA, DLX, DLY, DLZ, DLB
REAL(EB) :: DPHI0, FOUR_SIGMA, RPI_SIGMA, LTSTEP, RTMPMAX, RTMPMIN
INTEGER, ALLOCATABLE, DIMENSION(:,:) :: DLM
INTEGER, ALLOCATABLE, DIMENSION(:) :: NRP
INTEGER :: NRT,NCO,UIIDIM,NLAMBDAT,NKAPPAT,NKAPPAZ
!**********************************************************************************************************
!
! BBFRAC Fraction of blackbody radiation
! DLX Mean X-component of the control angle ray vector
! DLY Mean Y-component of the control angle ray vector
! DLZ Mean Z-component of the control angle ray vector
! DLB Mean Bottom-component of rayn vector (cylindrical case)
! DLM Mirroring indexes
! DLN Wall normal matrix
! DPHI0 Opening angle of the cylindrical domain
! E_WALL Wall emissivity
! ILW Radiation intensities on solid mirrors and mesh interfaces.
! Intensity integrals (band specific or angle increment) for solid and open walls
! INRAD_W Incident radiative heat flux on a cell (QRADIN = E_WALL*INRAD_W)
! R50 Array of PARTICLE radii corresponding to the median diameters of the distributions used in the generation
! of WQABS and WQSCA arrays.
! NDG Number of PARTICLE radii in WQABS and WQSCA arrays
! NLMBDMIE Number of wave lengths in Mie calculations
! NMIEANG Number of angle bins in forward scattering integration
! NRA Total number of radiation control angles
! NRDMIE Number of PARTICLE radii in Mie calculations
! NRT Number of radiation theta angles
! NRP Number of radiation phi angles on each theta band
! NSB Number of spectral bands (1=gray, 6=wide band, 9=wide band w. CH4)
! OUTRAD_W Emitted intensity from a wall (OUTRAD_W = QRADOUT/PI)
! PHIUP Upper limit of solid angle component PHI
! PHILOW Lower limit of solid angle component PHI
! RADTMP Radiation temperature for absorption properties (Mie)
! QRADIN Absorbed radiative heat flux into a surface cell (solid wall or open)
! QRADOUT Emitted radiative heat flux from a surface (solid wall or open)
! RSA Array of solid angles
! RTMPMAX Maximum temperature for tabulation of radiative properties
! RTMPMIN Minimum temperature for tabulation of radiative properties
! THETAUP Upper limit of solid angle component THETA
! THETALOW Lower limit of solid angle component THETA
! UII Integrated intensity
! UIID Parts of UII if WIDE_BAND_MODEL = TRUE, UIID contains the band specific intensity
! if WIDE_BAND_MODEL/= TRUE, UIID contains the ANGLE_INCREMENTs of intensity
! WEIGH_CYL In cylindrical coordinates, all intensities represent two actual control angles
! WL_LOW Lower wavelength limit of the spectral bands
! WL_HIGH Upper wavelength limit of the spectral bands
! WQABS Absorption efficiency factor array
! WQSCA Scattering efficiency factor array
!
! PATH_LENGTH Mean path length for the gray gas abs. coef.
! ANGLE_INCREMENT How many angles are skipped on each update
! NUMBER_RADIATION_ANGLES Input for NRA
! NUMBER_SPECTRAL_BANDS Input for NSB
! TIME_STEP_INCREMENT How often is the radiation solver called
!
!************************************************************************************************************
END MODULE RADCONS
MODULE RADCALV
! Module wrapper for RadCal subroutine
USE PRECISION_PARAMETERS
USE GLOBAL_CONSTANTS, ONLY: AL2O3,RADCAL_FUEL
IMPLICIT NONE
PRIVATE
CHARACTER(255), PARAMETER :: iradid='$Id: irad.f90 9587 2011-12-13 14:01:16Z drjfloyd $'
CHARACTER(255), PARAMETER :: iradrev='$Revision: 9587 $'
CHARACTER(255), PARAMETER :: iraddate='$Date: 2011-12-13 06:01:16 -0800 (Tue, 13 Dec 2011) $'
PUBLIC OMMAX,OMMIN,DD,SPECIE,SVF,PLANCK,P,RCT,RCALLOC,INIT_RADCAL,RADCAL,RCDEALLOC,GET_REV_irad
REAL(EB), ALLOCATABLE, DIMENSION(:,:) :: GAMMA,SD15, SD,SD7,SD3
REAL(EB), ALLOCATABLE, DIMENSION(:) :: SPECIE,QW,TTAU,XT,AB,AMBDA,ATOT,BCNT,P,UUU,GC,X
REAL(EB) :: OMMIN,OMMAX,TWALL,RCT,AC,AD,DD,XPART,TAU,SVF,TAUS,XTOT,XSTAR
INTEGER :: NOM
CONTAINS
SUBROUTINE GET_REV_irad(MODULE_REV,MODULE_DATE)
INTEGER,INTENT(INOUT) :: MODULE_REV
CHARACTER(255),INTENT(INOUT) :: MODULE_DATE
WRITE(MODULE_DATE,'(A)') iradrev(INDEX(iradrev,':')+1:LEN_TRIM(iradrev)-2)
READ (MODULE_DATE,'(I5)') MODULE_REV
WRITE(MODULE_DATE,'(A)') iraddate
END SUBROUTINE GET_REV_irad
SUBROUTINE INIT_RADCAL
USE RADCONS, ONLY: RADTMP
TWALL = RADTMP
IF(OMMAX<1100._EB) THEN
NOM=INT((OMMAX-OMMIN)/5._EB)
ELSEIF(OMMIN>5000._EB) THEN
NOM=INT((OMMAX-OMMIN)/50._EB)
ELSEIF(OMMIN<1100._EB.AND.OMMAX>5000._EB) THEN
NOM=INT((1100._EB-OMMIN)/5._EB)+INT((5000._EB-1100._EB)/25._EB) +INT((OMMAX-5000._EB)/50._EB)
ELSEIF(OMMIN<1100._EB) THEN
NOM=INT((1100._EB-OMMIN)/5._EB)+INT((OMMAX-1100._EB)/25._EB)
ELSEIF(OMMAX>5000._EB) THEN
NOM=INT((5000._EB-OMMIN)/25._EB)+INT((OMMAX-5000._EB)/50._EB)
ELSE
NOM=INT((OMMAX-OMMIN)/25._EB)
ENDIF
END SUBROUTINE INIT_RADCAL
SUBROUTINE RADCAL(AMEAN,AP0)
USE RADCONS, ONLY:RPI_SIGMA
INTEGER :: I,II,KK,NM,N,MM,KMAX,KMIN
REAL(EB) :: DOM,ABGAS,PTOT,TEMP,UK,XD,YD,XX,ENN,ARG,ARGNEW,RSL,RSS,ABLONG,ABSHRT,ABIL,ABIS,OMEGA,WL,DAMBDA,AP0, &
SDWEAK,GDINV,GDDINV,YC,Y,AIWALL,AMEAN,XC,AOM,Q,LTERM,AZORCT,RCT4
! [NOTE: THE TOTAL INTENSITY CALCULATED IS THAT WHICH LEAVES INTERVAL J=1.
! P(I,J) IS PARTIAL PRESSURE, ATM, OF SPECIES I IN INTERVAL J.
! I=1,2,3,4,5, OR 6 IMPLIES SPECIES IS CO2, H2O, CH4, CO, O2, OR N2, RESP.]
DOM=5.0_EB
OMEGA=OMMIN-DOM
NM=NOM-1
AZORCT = 273._EB/RCT
RCT4 = RCT**4
! LOOP 1000 COMPUTES EACH SPECTRAL CONTRIBUTION
L1000: DO KK=1,NOM
OMEGA=OMEGA+DOM
IF(OMEGA>1100._EB) OMEGA=OMEGA+20._EB
IF(OMEGA>5000._EB) OMEGA=OMEGA+25._EB
AMBDA(KK)=10000._EB/OMEGA
ABGAS=0._EB
! LOOP 200 COMPUTES THE CONTRIBUTION OF EACH SPECIES TO TAU
! IF SPECIE(I) IS SET TO 0., THAT PARTICULAR RADIATING SPECIES IS NOT PRESENT. THE SPECIES CONSIDERED ARE
! I SPECIES
! 1 CO2
! 2 H2O
! 3 CH4
! 4 CO
! 5 PARTICULATES
L200: DO I=1,4
IF(SPECIE(I) <= ZERO_P) CYCLE L200
! LOOP 100 IS FOR EACH ELEMENT ALONG PATH
! (CALCULATION PROCEEDS IN ACCORDANCE WITH THE SLG MODEL, TABLE 5-18, IN NASA SP-3080._EB)
IF(KK<=1) THEN
UUU(I)=AZORCT*P(I)*100.*DD
GC(I)=0._EB
PTOT=0._EB
DO II=1,6
PTOT=P(II)+PTOT
GC(I)=GC(I)+GAMMA(I,II)*P(II)*SQRT(AZORCT)
ENDDO
GC(I)=GC(I)+GAMMA(I,7)*P(I)*AZORCT
ENDIF
IF(P(I)<=ZERO_P) THEN
XSTAR=1.E-34_EB
AC=1._EB
AD=1._EB
X(I)=XSTAR
ELSE
TEMP=RCT
SELECT CASE (I)
CASE (1)
CALL CO2(OMEGA,TEMP,GC(1),SDWEAK,GDINV,GDDINV)
CASE (2)
CALL H2O(OMEGA,TEMP,GC(2),SDWEAK,GDINV,GDDINV)
CASE (3)
IF (RADCAL_FUEL=='METHANE') CALL FUEL(OMEGA,TEMP,P(3),PTOT,GC(3),SDWEAK,GDINV,GDDINV)
CASE (4)
CALL CO(OMEGA,TEMP,GC(4),SDWEAK,GDINV,GDDINV)
END SELECT
UK=SDWEAK*UUU(I)
XSTAR=UK+1.E-34_EB
ABGAS=UK/DD+ABGAS
AD=GDDINV
AC=GDINV
IF(XSTAR>=1.E-6_EB) THEN
XD=1.7_EB*AD*SQRT(DLOG(1._EB+(XSTAR/(1.7_EB*AD))**2))
YD=1._EB-(XD/XSTAR)**2
XC=XSTAR/SQRT(1._EB+0.25_EB*XSTAR/AC)
! THE FOLLOWING LOOP COMPUTES THE OPTICAL THICKNESS, XC, FOR METHANE USING
! THE GODSON EQUATION AND AN APPROXIMATION TO THE LADENBERG-REICHE
! FUNCTION AS RECOMMENDED BY BROSMER AND TIEN (JQSRT 33,P 521). THE
! ERROR FUNCTION IS FOUND FROM ITS SERIES EXPANSION.
IF((I==3).AND.(XC<=10)) THEN
AOM=XC
XX=.5_EB*SQRTPI*XC
IF(XX<=3._EB) THEN
ENN=1._EB
DO N=1,30
ENN=ENN*REAL(N,EB)
MM=2*N+1
ARG=1.128379_EB*(-1._EB)**N*((.88622693_EB*XC)**MM)/(REAL(MM,EB)*ENN)
ARGNEW=ARG+AOM
! IF(ABS(ARG/ARGNEW)<.000001)N=30
AOM=ARGNEW
ENDDO
ELSE
AOM=1._EB-EXP(-XX**2)/(SQRTPI*XX)
ENDIF
IF (AOM>=1._EB) AOM=.9999999_EB
XC=-DLOG(1._EB-AOM)
ENDIF
YC=1._EB-(XC/XSTAR)**2
Y=MAX(1._EB/YC**2+1._EB/YD**2-1._EB,1._EB)
X(I)=XSTAR*((1._EB-(Y**(-.5_EB)))**.5_EB)
ELSE
X(I)=XSTAR
ENDIF
ENDIF
END DO L200
! DETERMINE OPTICAL DEPTH OF SOOT
IF (SPECIE(5)<=ZERO_P) THEN
XPART=0._EB
ELSE
CALL POD(OMEGA)
ENDIF
AB(KK)=ABGAS+XPART/DD
! Evaluate the combined spectral transmettance and radiance
XTOT=0._EB
DO I=1,4
IF(SPECIE(I)<=ZERO_P) X(I)=0._EB
XTOT=X(I)+XTOT
ENDDO
XTOT=XTOT+XPART
IF(XTOT>=99._EB) THEN
TAU=0._EB
ELSE
TAU=EXP(-XTOT)
ENDIF
QW(KK)=-(TAU-1._EB)*PLANCK(RCT,AMBDA(KK))
XT(KK)=XTOT
TTAU(KK)=TAU
QW(KK)=QW(KK)+TTAU(KK)*PLANCK(TWALL,AMBDA(KK))
ENDDO L1000
! INTEGRATE THE RADIANCE OVER THE SPECTRUM
Q=QW(1)*(AMBDA(1)-AMBDA(2))
DO KK=2,NM
Q=Q+QW(KK)*(AMBDA(KK-1)-AMBDA(KK+1))/2._EB
ENDDO
Q=Q+QW(NOM)*(AMBDA(NOM-1)-AMBDA(NOM))
! DETERMINE SOOT RADIANCE FOR SHORT AND LONG WAVELENGTHS.
RSL=0._EB
RSS=0._EB
ABLONG=0._EB
ABSHRT=0._EB
ABIL=0._EB
ABIS=0._EB
IF(.NOT.(SPECIE(5)<=ZERO_P .AND. TWALL<=ZERO_P)) THEN
KMAX=INT(OMMIN)
DO KK=5,KMAX,5
OMEGA=FLOAT(KK)
WL=10000._EB/OMEGA
DAMBDA=10000._EB/(OMEGA-2.5_EB)-10000._EB/(OMEGA+2.5_EB)
CALL POD(OMEGA)
IF(XPART>=33._EB) THEN
TAUS=0._EB
ELSE
TAUS=EXP(-XPART)
ENDIF
RSL=RSL-(TAUS-1._EB)*PLANCK(RCT,WL)*DAMBDA
ABLONG=ABLONG+XPART/DD*PLANCK(RCT,WL)*DAMBDA/RPI_SIGMA/RCT4
ABIL=ABIL+XPART/DD*PLANCK(TWALL,WL)*DAMBDA/RPI_SIGMA/(TWALL+.000001_EB)**4
RSL=RSL+TAUS*PLANCK(TWALL,WL)*DAMBDA
ENDDO
KMIN=INT(OMMAX)
DO KK=KMIN,25000,100
OMEGA=FLOAT(KK)
WL=10000._EB/OMEGA
DAMBDA=10000._EB/(OMEGA-50._EB)-10000._EB/(OMEGA+50._EB)
CALL POD(OMEGA)
IF(XPART>=33._EB) THEN
TAUS=0._EB
ELSE
TAUS=EXP(-XPART)
ENDIF
RSS=RSS-(TAUS-1._EB)*PLANCK(RCT,WL)*DAMBDA
ABSHRT=ABSHRT+XPART/DD*PLANCK(RCT,WL)*DAMBDA/RPI_SIGMA/RCT4
ABIS=ABIS+XPART/DD*PLANCK(TWALL,WL)*DAMBDA/RPI_SIGMA/(TWALL+.000001_EB)**4
RSS=RSS+TAUS*PLANCK(TWALL,WL)*DAMBDA
ENDDO
ENDIF
Q=Q+RSS+RSL
! THE FOLLOWING SECTION COMPUTES THE MEAN ABSORPTION COEFFICIENTS IF THE SYSTEM IS HOMOGENEOUS (IE., NPT=1).
NM=NOM-1
AIWALL=AB(1)*(AMBDA(1)-AMBDA(2))/2._EB*PLANCK(TWALL,AMBDA(1))
AP0=AB(1)*(AMBDA(1)-AMBDA(2))/2._EB*PLANCK(RCT,AMBDA(1))
DO KK=2,NM
AIWALL=AIWALL+AB(KK)*(AMBDA(KK-1)-AMBDA(KK+1))/2._EB *PLANCK(TWALL,AMBDA(KK))
AP0=AP0+AB(KK)*(AMBDA(KK-1)-AMBDA(KK+1))/2._EB*PLANCK(RCT,AMBDA(KK))
ENDDO
AP0=(AP0+AB(NOM)*(AMBDA(NM)-AMBDA(NOM))/2._EB *PLANCK(RCT,AMBDA(NOM)))/RPI_SIGMA/RCT4
IF(ABS(TWALL-RCT)<=SPACING(TWALL) .OR. TWALL<=ZERO_P) THEN
AIWALL=AP0
LTERM = MAX(1E-20_EB,(Q/RPI_SIGMA-RCT4)/(-RCT4))
AMEAN=-1._EB/DD*DLOG(LTERM)
ELSE
AIWALL=(AIWALL+AB(NOM)*(AMBDA(NM)-AMBDA(NOM))/2._EB*PLANCK(TWALL,AMBDA(NOM)))/RPI_SIGMA/TWALL**4
LTERM = MAX(1E-20_EB,(Q/RPI_SIGMA-RCT4)/(TWALL**4-RCT4))
AMEAN=-1._EB/DD*DLOG(LTERM)
ENDIF
END SUBROUTINE RADCAL
SUBROUTINE CO2(OMEGA,TEMP,GC1,SDWEAK,GDINV,GDDINV)
INTEGER I,J,K,L
REAL(EB) OMEGA,TEMP,GC1,SDWEAK,GDINV,GDDINV,AA,BB,CC,QQ,EE,FF,GG, &
SMINUS,SPLUS,SDSTRG,GD,OM1,OM2,OM3,T0,Q2,BE,COM1, &
COM2,COM3,X13,X23,X33,XBAR,OM12,ALPHA,OMPRIM,V3,GAM, &
OMVV3,DELTA,V,OMVBAR,F1,F2,UNFLO1,UNFLO2,UNFLO3,TEST, &
VBAR1,OMA,OMB,TTEMP,TT,T1,TW,WW,TEMP1,TEMP2,TEMP3,WM, &
DINV,A,B,D,G,W1,DINV1,DINV2,DINV3,Q2OT,T0OT,Q2OT0
IF(OMEGA>5725._EB) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSE
WM=44._EB
GD=5.94E-6_EB*OMEGA*SQRT(TEMP/(273._EB*WM))
IF(OMEGA>4550._EB) THEN
!CONTRIBUTION TO 2.0 MICRON BAND FROM (000)-(041),(000)-(121),AND (000)
! -(201) TRANS.
OM1=1354.91_EB
OM2=673.0_EB
OM3=2396.49_EB
BCNT(1)=4860.5_EB
BCNT(2)=4983.5_EB
BCNT(3)=5109.0_EB
T0=300._EB
T0OT = T0/TEMP
Q2=1.4388_EB
Q2OT = -Q2/TEMP
BE=0.391635_EB
COM1=4._EB*OM2+OM3
COM2=OM1+2._EB*OM2+OM3
COM3=2._EB*OM1+OM3
ATOT(3)=0.426_EB*T0OT*(1._EB-EXP(Q2OT*COM3))/ (1._EB-EXP(Q2OT*OM1))**2/(1._EB-EXP(Q2OT*OM3))
ATOT(2)=1.01_EB *T0OT*(1._EB-EXP(Q2OT*COM2))/(1._EB-EXP(Q2OT*OM1))/(1._EB-EXP(Q2OT*OM2))**2/ &
(1._EB-EXP(Q2OT*OM3))
ATOT(1)=0.272_EB*T0OT*(1._EB-EXP(Q2OT*COM1))/(1._EB-EXP(Q2OT*OM2))**4/(1._EB-EXP(Q2OT*OM3))
SDWEAK=0.0_EB
DO K=1,3
SDWEAK=SDWEAK+ATOT(K)*(-Q2OT)/(4._EB*BE)*ABS(OMEGA-BCNT(K))*EXP(Q2OT/(4._EB*BE)*(OMEGA-BCNT(K))**2)
ENDDO
DINV=1._EB/(4._EB*BE)
GDINV=GC1*DINV
GDDINV=GD*DINV
!***EXPRESS S/D AT STP, AS IS IN NASA SP-3080
SDWEAK=SDWEAK*TEMP/273._EB
ELSEIF((OMEGA<=4550._EB).AND.(OMEGA>3800._EB)) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSEIF((OMEGA<=3800._EB).AND.(OMEGA>3050._EB)) THEN
B=.391635_EB
A=.0030875_EB
X13=-19.37_EB
X23=-12.53_EB
X33=-12.63_EB
OM1=1354.91_EB
OM2=673._EB
OM3=2396.49_EB
T0=300._EB
T0OT = T0/TEMP
Q2=1.4388_EB
Q2OT = -Q2/TEMP
Q2OT0 = -Q2/T0
XBAR=.5_EB*(.5_EB*X13+X23)
OM12=.5_EB*(.5_EB*OM1+OM2)
SDWEAK=0._EB
SDSTRG=0._EB
IF(OMEGA<=2395._EB) THEN
ALPHA=2700._EB
OMPRIM=OM3
AA=ALPHA*B*Q2/(A*(1._EB-EXP(OM3*Q2OT0))*(1._EB-EXP(OM12*Q2OT0))**3*(1._EB+EXP(OM12*Q2OT0))*(1._EB-EXP(OMPRIM*Q2OT0)))
BB=(1._EB-EXP(Q2OT*OMEGA))*(1._EB-EXP(Q2OT*OM3))*(1._EB-EXP(OM12*Q2OT))**3*(1._EB+EXP(OM12*Q2OT)) &
*(1._EB-EXP(Q2OT*OMPRIM))
CC=AA*BB*OMEGA*T0/TEMP**2
L202: DO J=1,20
V=FLOAT(J-1)
IF(J/2*2==J)G=(V+1._EB)*(V+3._EB)/4._EB
IF(J/2*2/=J)G=(V+2._EB)*(V+2._EB)/4._EB
L201: DO K=1,10
V3=FLOAT(K-1)
QQ=(V3+1._EB)*G*EXP(-(V3*OM3+V*OM12)*Q2OT)
GAM=B-A*(V3+1._EB)
OMVV3=OM3+.5_EB*X13+X23+2._EB*X33+XBAR*V+2._EB*X33*V3
DELTA=A*(OMEGA-OMVV3)
IF(GAM*GAM<=DELTA) CYCLE L202
D=2._EB*(GAM*GAM-DELTA)**.5_EB
OMVBAR=OMVV3*(1._EB-EXP(-OMVV3*Q2OT))
F1=GAM-D/2
F2=GAM+D/2._EB
EE=Q2*GAM/(A*A*TEMP)
UNFLO1=EE*DELTA*(1._EB+.5_EB*A/GAM)
IF(UNFLO1<=-78.) CYCLE L202
UNFLO2=EE*2._EB*GAM*F1
IF(UNFLO2>=78.) CYCLE L202
FF=EXP(EE*DELTA*(1._EB+.5_EB*A/GAM))
SMINUS=CC*QQ/OMVBAR*ABS(F1)*FF*EXP(-EE*2._EB*GAM*F1)
UNFLO3=EE*2._EB*GAM*F2
IF(UNFLO3>=78.) THEN
SPLUS=0.
ELSE
SPLUS=CC*QQ/OMVBAR*ABS(F2)*FF*EXP(-EE*2._EB*GAM*F2)
ENDIF
GG=SDWEAK
SDWEAK=(SMINUS+SPLUS)/D+SDWEAK
TEST=(SDWEAK-GG)/SDWEAK
IF(TEST<.0001) CYCLE L202
SDSTRG=(.5_EB*G)**.5_EB*(SQRT(SMINUS)+SQRT(SPLUS))/D+SDSTRG
ENDDO L201
ENDDO L202
IF(SDWEAK<=ZERO_P) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSE
DINV=SDSTRG*SDSTRG/SDWEAK
GDINV=GC1*DINV
GDDINV=GD*DINV
!*** EXPRESS S/D AT STP, AS IS K IN NASA SP-3080
SDWEAK=SDWEAK*TEMP/273.
ENDIF
ELSE
!CALCULATE ABSORPTION COEF. AND LINE SPACING PARAMETER FOR 2.7 MICRON BAND
L=1
!CONTRIBUTION TO 2.7 MICRON BAND FROM (000)-(021) AND (010)-(031) TRANS.
ALPHA=28.5_EB
OMPRIM=2._EB*OM2+OM3
L120: DO
AA=ALPHA*B*Q2/(A*(1._EB-EXP(OM3*Q2OT0))*(1._EB-EXP(OM12*Q2OT0))**3*(1._EB+EXP(OM12*Q2OT0))*(1._EB-EXP(OMPRIM*Q2OT0)))
BB=(1._EB-EXP(Q2OT*OMEGA))*(1._EB-EXP(Q2OT*OM3))* (1._EB-EXP(OM12*Q2OT))**3*(1._EB+EXP(OM12*Q2OT)) &
*(1._EB-EXP(Q2OT*OMPRIM))
CC=AA*BB*OMEGA*T0/TEMP**2
L102: DO J=1,20
V=FLOAT(J-1)
IF(J/2*2==J)G=(V+1._EB)*(V+3._EB)/4._EB
IF(J/2*2/=J)G=(V+2._EB)*(V+2._EB)/4._EB
VBAR1=-1._EB+(V+3._EB)*(V+4._EB)/(V+2.)/6._EB
IF(J/2*2==J)VBAR1=-1._EB+(V+5._EB)/6._EB
L101: DO K=1,10
V3=FLOAT(K-1)
QQ=(V3+1)*G*EXP((V3*OM3+V*OM12)*Q2OT)*(VBAR1+1._EB)
GAM=B-A*(V3+1._EB)
IF(L==2) THEN
OMVV3=3728._EB-5._EB*V-47._EB*V3
IF(V<=ZERO_P) OMVV3=3715._EB-47._EB*V3
ELSE
OMVV3=3598._EB-18._EB*V-47._EB*V3
IF(V<=ZERO_P) OMVV3=3613._EB-47._EB*V3
ENDIF
DELTA=A*(OMEGA-OMVV3)
IF(GAM*GAM<=DELTA) CYCLE L102
D=2._EB*(GAM*GAM-DELTA)**.5_EB
OMVBAR=OMVV3*(1._EB-EXP(OMVV3*Q2OT))
F1=GAM-D/2._EB
F2=GAM+D/2._EB
EE=Q2*GAM/(A*A*TEMP)
UNFLO1=EE*DELTA*(1._EB+.5_EB*A/GAM)
IF(UNFLO1<=-78._EB) CYCLE L102
UNFLO2=EE*2._EB*GAM*F1
IF(UNFLO2>=78._EB) CYCLE L102
FF=EXP(EE*DELTA*(1._EB+.5_EB*A/GAM))
SMINUS=CC*QQ/OMVBAR*ABS(F1)*FF*EXP(-EE*2._EB*GAM*F1)
UNFLO3=EE*2._EB*GAM*F2
IF(UNFLO3>=78._EB) THEN
SPLUS=0._EB
ELSE
SPLUS=CC*QQ/OMVBAR*ABS(F2)*FF*EXP(-EE*2._EB*GAM*F2)
ENDIF
GG=SDWEAK
SDWEAK=(SMINUS+SPLUS)/D+SDWEAK
TEST=(SDWEAK-GG)/SDWEAK
IF(TEST<.0001_EB) CYCLE L102
SDSTRG=SQRT(.5_EB*G)*(SQRT(SMINUS)+SQRT(SPLUS))/D+SDSTRG
ENDDO L101
ENDDO L102
IF(L==2) EXIT L120
!CONTRIBUTION TO 2.7 MICRON BAND FROM (000)-(101) AND (010)-(111) TRANS.
ALPHA=42.3_EB
OMPRIM=OM1+OM3
L=2
ENDDO L120
!CALCULATE ABSORPTION COEF AND LINE SPACING PARAMETER FOR 4.3 MICRON BAND
IF(SDWEAK<=ZERO_P) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSE
DINV=SDSTRG*SDSTRG/SDWEAK
GDINV=GC1*DINV
GDDINV=GD*DINV
!***EXPRESS S/D AT STP, AS IS K IN NASA SP-3080
SDWEAK=SDWEAK*TEMP/273.
ENDIF
ENDIF
ELSEIF((OMEGA<=3050._EB).AND.(OMEGA>2474.)) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSEIF((OMEGA<=2474.).AND.(OMEGA>1975.)) THEN
B=.391635_EB
A=.0030875_EB
X13=-19.37_EB
X23=-12.53_EB
X33=-12.63_EB
OM1=1354.91_EB
OM2=673._EB
OM3=2396.49_EB
T0=300._EB
Q2=1.4388_EB
XBAR=.5_EB*(.5_EB*X13+X23)
OM12=.5_EB*(.5_EB*OM1+OM2)
SDWEAK=0._EB
SDSTRG=0._EB
IF(OMEGA<=2395._EB) THEN
ALPHA=2700._EB
OMPRIM=OM3
AA=ALPHA*B*Q2/(A*(1._EB-EXP(-OM3*Q2/T0))*(1._EB-EXP(-OM12*Q2 /T0))**3*(1._EB+EXP(-OM12*Q2/T0))*(1._EB-EXP(-OMPRIM*Q2/T0)))
BB=(1._EB-EXP(-Q2*OMEGA/TEMP))*(1._EB-EXP(-Q2*OM3/TEMP))*(1._EB-EXP(-OM12*Q2/TEMP))**3*(1._EB+EXP(-OM12*Q2/TEMP)) &
*(1._EB-EXP(-Q2*OMPRIM/TEMP))
CC=AA*BB*OMEGA/TEMP*T0/TEMP
L202A: DO J=1,20
V=FLOAT(J-1)
IF(J/2*2==J)G=(V+1._EB)*(V+3._EB)/4._EB
IF(J/2*2/=J)G=(V+2._EB)*(V+2._EB)/4._EB
L201A: DO K=1,10
V3=FLOAT(K-1)
QQ=(V3+1._EB)*G*EXP(-(V3*OM3+V*OM12)*Q2/TEMP)
GAM=B-A*(V3+1._EB)
OMVV3=OM3+.5_EB*X13+X23+2._EB*X33+XBAR*V+2._EB*X33*V3
DELTA=A*(OMEGA-OMVV3)
IF(GAM*GAM<=DELTA) CYCLE L202A
D=2._EB*(GAM*GAM-DELTA)**.5_EB
OMVBAR=OMVV3*(1._EB-EXP(-OMVV3*Q2/TEMP))
F1=GAM-D/2._EB
F2=GAM+D/2._EB
EE=Q2*GAM/(A*A*TEMP)
UNFLO1=EE*DELTA*(1._EB+.5_EB*A/GAM)
IF(UNFLO1<=-78.) CYCLE L202A
UNFLO2=EE*2._EB*GAM*F1
IF(UNFLO2>=78.) CYCLE L202A
FF=EXP(EE*DELTA*(1._EB+.5_EB*A/GAM))
SMINUS=CC*QQ/OMVBAR*ABS(F1)*FF*EXP(-EE*2._EB*GAM*F1)
UNFLO3=EE*2._EB*GAM*F2
IF(UNFLO3>=78._EB) THEN
SPLUS=0._EB
ELSE
SPLUS=CC*QQ/OMVBAR*ABS(F2)*FF*EXP(-EE*2._EB*GAM*F2)
ENDIF
GG=SDWEAK
SDWEAK=(SMINUS+SPLUS)/D+SDWEAK
TEST=(SDWEAK-GG)/SDWEAK
IF(TEST<.0001_EB) CYCLE L202A
SDSTRG=(.5_EB*G)**.5_EB*(SMINUS**.5+SPLUS**.5)/D+SDSTRG
ENDDO L201A
ENDDO L202A
IF(SDWEAK<=ZERO_P) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSE
DINV=SDSTRG*SDSTRG/SDWEAK
GDINV=GC1*DINV
GDDINV=GD*DINV
!*** EXPRESS S/D AT STP, AS IS K IN NASA SP-3080
SDWEAK=SDWEAK*TEMP/273._EB
ENDIF
ELSE
!CALCULATE ABSORPTION COEF. AND LINE SPACING PARAMETER FOR 2.7 MICRON BAND
L=1
!CONTRIBUTION TO 2.7 MICRON BAND FROM (000)-(021) AND (010)-(031) TRANS.
ALPHA=28.5_EB
OMPRIM=2._EB*OM2+OM3
L120A: DO
AA=ALPHA*B*Q2/(A*(1._EB-EXP(-OM3*Q2/T0))*(1._EB-EXP(-OM12*Q2 /T0))**3*(1._EB+EXP(-OM12*Q2/T0))*(1._EB-EXP(-OMPRIM*Q2/T0)))
BB=(1._EB-EXP(-Q2*OMEGA/TEMP))*(1._EB-EXP(-Q2*OM3/TEMP))* (1._EB-EXP(-OM12*Q2/TEMP))**3*(1._EB+EXP(-OM12*Q2/TEMP)) &
*(1._EB-EXP(-Q2*OMPRIM/TEMP))
CC=AA*BB*OMEGA/TEMP*T0/TEMP
L102A: DO J=1,20
V=FLOAT(J-1)
IF(J/2*2==J)G=(V+1._EB)*(V+3._EB)/4._EB
IF(J/2*2/=J)G=(V+2._EB)*(V+2._EB)/4._EB
VBAR1=-1._EB+(V+3._EB)*(V+4._EB)/(V+2._EB)/6._EB
IF(J/2*2==J)VBAR1=-1._EB+(V+5._EB)/6._EB
L101A: DO K=1,10
V3=FLOAT(K-1)
QQ=(V3+1)*G*EXP(-(V3*OM3+V*OM12)*Q2/TEMP)*(VBAR1+1._EB)
GAM=B-A*(V3+1._EB)
IF(L==2) THEN
OMVV3=3728._EB-5._EB*V-47._EB*V3
IF(V<=ZERO_P)OMVV3=3715._EB-47._EB*V3
ELSE
OMVV3=3598._EB-18._EB*V-47._EB*V3
IF(V<=ZERO_P)OMVV3=3613._EB-47._EB*V3
ENDIF
DELTA=A*(OMEGA-OMVV3)
IF(GAM*GAM<=DELTA) CYCLE L102A
D=2._EB*(GAM*GAM-DELTA)**.5_EB
OMVBAR=OMVV3*(1._EB-EXP(-OMVV3*Q2/TEMP))
F1=GAM-D/2._EB
F2=GAM+D/2._EB
EE=Q2*GAM/(A*A*TEMP)
UNFLO1=EE*DELTA*(1._EB+.5_EB*A/GAM)
IF(UNFLO1<=-78._EB) CYCLE L102A
UNFLO2=EE*2._EB*GAM*F1
IF(UNFLO2>=78._EB) CYCLE L102A
FF=EXP(EE*DELTA*(1._EB+.5_EB*A/GAM))
SMINUS=CC*QQ/OMVBAR*ABS(F1)*FF*EXP(-EE*2._EB*GAM*F1)
UNFLO3=EE*2._EB*GAM*F2
IF(UNFLO3>=78._EB) THEN
SPLUS=0._EB
ELSE
SPLUS=CC*QQ/OMVBAR*ABS(F2)*FF*EXP(-EE*2._EB*GAM*F2)
ENDIF
GG=SDWEAK
SDWEAK=(SMINUS+SPLUS)/D+SDWEAK
TEST=(SDWEAK-GG)/SDWEAK
IF(TEST<.0001) CYCLE L102A
SDSTRG=(.5_EB*G)**.5_EB*(SMINUS**.5+SPLUS**.5)/D+SDSTRG
ENDDO L101A
ENDDO L102A
IF(L==2) EXIT L120A
!CONTRIBUTION TO 2.7 MICRON BAND FROM (000)-(101) AND (010)-(111) TRANS.
ALPHA=42.3_EB
OMPRIM=OM1+OM3
L=2
ENDDO L120A
!CALCULATE ABSORPTION COEF AND LINE SPACING PARAMETER FOR 4.3 MICRON BAND
IF(SDWEAK<=ZERO_P) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSE
DINV=SDSTRG*SDSTRG/SDWEAK
GDINV=GC1*DINV
GDDINV=GD*DINV
!***EXPRESS S/D AT STP, AS IS K IN NASA SP-3080
SDWEAK=SDWEAK*TEMP/273._EB
ENDIF
ENDIF
ELSEIF((OMEGA<=1975._EB).AND.(OMEGA>1100._EB)) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSEIF((OMEGA<=1100._EB).AND.(OMEGA>880._EB)) THEN
!CONTRIBUTION TO 10.0 MICRON BAND FROM (100)-(001) AND (020)-(001) TRANS.
OM1=1354.91_EB
OM2=673._EB
OM3=2396.49_EB
Q2=1.4388_EB
BCNT(1)=960.8_EB
BCNT(2)=1063.6_EB
OMA=OM3
OMB=(OM1+2._EB*OM2)/2._EB
T0=300._EB
ATOT(1)=0.0219_EB
ATOT(2)=0.0532_EB
BE=0.391635_EB
DO K=1,2
ATOT(K)=T0/TEMP*ATOT(K)*EXP(Q2*OMB*(1._EB/T0-1._EB/TEMP)) *(1._EB-EXP(-Q2*(OMA-OMB)/TEMP))/(1._EB-EXP(-Q2*OMA/TEMP)) &
/(1._EB-EXP(-OMB*Q2/TEMP))
ENDDO
SDWEAK=0._EB
DO I=1,2
SDWEAK=SDWEAK+ATOT(I)*Q2/(4._EB*BE*TEMP)*ABS(OMEGA-BCNT(I)) *EXP(-Q2/(4._EB*BE*TEMP)*(OMEGA-BCNT(I))**2)
ENDDO
DINV=1._EB/4._EB/BE
GDINV=GC1*DINV
GDDINV=GD*DINV
!***EXPRESS S/D AT STP, AS IS IN NASA SP-3080
SDWEAK=SDWEAK*TEMP/273.
ELSEIF((OMEGA<=880._EB).AND.(OMEGA>500._EB)) THEN
!CONTRIBUTION TO 15.0 MICRON BAND FROM (000)-(010) TRANS.
TTEMP=TEMP
J=(OMEGA-495._EB)/5._EB
W1=495._EB+5._EB*REAL(J,EB)
WW=(OMEGA-W1)/5
IF(TEMP>=2400._EB) TEMP = 2399.99_EB
IF(TEMP < 300._EB) TEMP = 300.00_EB
I = TEMP/300._EB
SELECT CASE(I)
CASE(3)
I=2
TT=(TEMP-600._EB)/600._EB
CASE(6:7)
I=5
TT=(TEMP-1800._EB)/600._EB
CASE DEFAULT
T1=REAL(I,EB)*300._EB
TT=(TEMP-T1)/300._EB
IF (I>=4) I=I-1
END SELECT
TW=TT*WW
SDWEAK=SD15(I,J)*(1._EB-TT-WW+TW)+SD15(I+1,J)*(TT-TW) +SD15(I,J+1)*(WW-TW)+SD15(I+1,J+1)*TW
IF(SDWEAK<=ZERO_P) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSE
!CALCULATE LINE SPACING PARAMETER FOR 15.0 MICRON BAND
DINV1=1.2_EB
DINV2=8.0_EB
DINV3=30.0_EB
TEMP1=300.0_EB
TEMP2=550.0_EB
TEMP3=830.0_EB
DINV=DINV1*(TEMP-TEMP2)*(TEMP-TEMP3)/(TEMP1-TEMP2) /(TEMP1-TEMP3)+DINV2*(TEMP-TEMP1)*(TEMP-TEMP3)&
/(TEMP2-TEMP1)/(TEMP2-TEMP3)+DINV3*(TEMP-TEMP1) *(TEMP-TEMP2)/(TEMP3-TEMP1)/(TEMP3-TEMP2)
GDINV=GC1*DINV
GDDINV=GD*DINV
ENDIF
TEMP = TTEMP ! Line added by Jason Floyd, Aug 30, 2002
ELSE
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ENDIF
ENDIF
END SUBROUTINE CO2
SUBROUTINE H2O(OMEGA,TEMP,GC2,SDWEAK,GDINV,GDDINV)
INTEGER I,J
REAL(EB) OMEGA,TEMP,GC2,SDWEAK,GDINV,GDDINV,WM,W1,WW,T1,TT,TW, D,B,DINV,TTEMP,GD
IF (OMEGA>=9300..OR.OMEGA<50._EB) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSE
WM=18._EB
GD=5.94E-6_EB*OMEGA*(TEMP/(273._EB*WM))**.5_EB
J=(OMEGA-25._EB)/25._EB
TTEMP=TEMP
IF(TEMP>=2500._EB) TEMP=2499.99_EB
IF(TEMP<300._EB) TEMP=300._EB
I=TEMP/500._EB +1
IF(I==2.AND.TEMP<600._EB) I=1
W1=25._EB+25._EB*FLOAT(J)
WW=(OMEGA-W1)/25._EB
IF(I>2) THEN
T1=FLOAT(I-1)*500._EB
TT=(TEMP-T1)/500._EB
ELSE
IF(I==1) TT=(TEMP-300._EB)/300._EB
IF(I==2) TT=(TEMP-600._EB)/400._EB
ENDIF
TW=TT*WW
SDWEAK=SD(I,J)*(1._EB-TT-WW+TW)+SD(I+1,J)*(TT-TW)+SD(I,J+1) *(WW-TW)+SD(I+1,J+1)*TW
D=-2.294_EB+.3004E-02_EB*TEMP-.366E-06_EB*TEMP**2
B=SIN(.0036_EB*OMEGA-8.043_EB)
DINV=EXP(.7941_EB*B+D)
! DINV=EXP(0.00106*TEMP-1.21)
GDINV=GC2*DINV
GDDINV=GD*DINV
TEMP=TTEMP
ENDIF
END SUBROUTINE H2O
SUBROUTINE CO(OMEGA,TEMP,GC4,SDWEAK,GDINV,GDDINV)
INTEGER J
REAL(EB) OMEGA,TEMP,GC4,SDWEAK,GDINV,GDDINV,AA,BB,CC,QQ,EE,FF,GG, &
SMINUS,SPLUS,SDSTRG,B,ALPHA,A,OME,WX,WY,OMPRIM,T0, &
Q2,WM,GD,V,GAM,OMV,DELTA,D,OMVBAR,F1,F2,TEST,DINV,Q2OT,TOAZ
IF(OMEGA<1600._EB .OR. OMEGA>2400._EB) THEN
SDWEAK=0._EB
GDINV=1._EB
GDDINV=1._EB
ELSE
B=1.93139_EB
ALPHA=260._EB
A=.017485_EB
OME=2170.21_EB
WX=13.461_EB
WY=.0308_EB
OMPRIM=OME-2._EB*WX+3.25_EB*WY
T0=300._EB
Q2=1.4388_EB
TOAZ = TEMP/273._EB
Q2OT = Q2/TEMP
WM=28._EB
GD=5.94E-6_EB*OMEGA*SQRT(TOAZ/WM)
SDWEAK=1.E-99_EB
SDSTRG=1.E-99_EB
AA=ALPHA*B*Q2/(A*(1._EB-EXP(-OMPRIM*Q2/T0))**2)
BB=(1._EB-EXP(-OMEGA*Q2OT))*(1._EB-EXP(-OMPRIM*Q2OT))**2
CC=AA*BB*OMEGA*T0/TEMP**2
L101: DO J=1,20
V=FLOAT(J-1)
QQ=(V+1._EB)*EXP(-V*OME*Q2OT)
GAM=B-A*(V+1._EB)
OMV=OME-2._EB*(V+1._EB)*WX+(3._EB*(V+1._EB)*(V+1._EB)+.25_EB)*WY
DELTA=A*(OMEGA-OMV)
IF(GAM**2<=DELTA) EXIT L101
D=2._EB*SQRT(GAM*GAM-DELTA)
OMVBAR=OMV*(1._EB-EXP(-OMV*Q2OT))
F1=GAM-0.5_EB*D
F2=GAM+0.5_EB*D
EE=Q2*GAM/(A*A*TEMP)
FF=EXP(EE*DELTA*(1._EB+.5_EB*A/GAM))
SMINUS=CC*QQ/OMVBAR*ABS(F1)*FF*EXP(-EE*2._EB*GAM*F1)
SPLUS=CC*QQ/OMVBAR*ABS(F2)*FF*EXP(-EE*2._EB*GAM*F2)
GG=SDWEAK
SDWEAK=(SMINUS+SPLUS)/D+SDWEAK
TEST=(SDWEAK-GG)/SDWEAK
IF(TEST<.0001_EB) EXIT L101
SDSTRG=(SQRT(SMINUS)+SQRT(SPLUS))/D+SDSTRG
ENDDO L101
DINV=SDSTRG*SDSTRG/SDWEAK
GDINV=GC4*DINV
GDDINV=GD*DINV
!***EXPRESS S/D AT STP, AS IS K IN NASA SP-3080
SDWEAK=SDWEAK*TOAZ
ENDIF
END SUBROUTINE CO
SUBROUTINE POD(OMEGA)
! POD CALCULATES PARTICLE OPTICAL DEPTH, XPART, OF THE VOLUME FRACTION OF SOOT PARTICLES IN GAS CLOUD. RIN AND RIK ARE
! THE REAL AND IMAGINARY PARTS OF THE INDEX OF REFRACTION. THE PARTICLES ARE ASSUMED TO BE IN THE RAYLEIGH LIMIT.
REAL(EB) OMEGA,ABCO,FF_FAC,FF,LAMBDA!,RIN,RIK
LAMBDA=10000._EB/OMEGA
! ABSORPTION COEF. IS BASED UPON MEASUREMENTS OF WIDMANN AND MULHOLLAND
IF (AL2O3) THEN
IF (RCT > 2570._EB) THEN
FF_FAC = 0.017_EB
ELSEIF (RCT < 500._EB) THEN
FF_FAC = 5.E-6_EB
ELSE
FF_FAC = 0.00073_EB
ENDIF
ELSE
FF_FAC = 8.9_EB
ENDIF
FF=FF_FAC/LAMBDA
ABCO=FF*SVF*1.E6_EB
XPART=ABCO*DD
END SUBROUTINE POD
SUBROUTINE FUEL(OMEGA,TEMP,PCH4,PTOT,GC3,SDWEAK,GDINV,GDDINV)
INTEGER I,J
REAL(EB) OMEGA,TEMP,PCH4,PTOT,GC3,SDWEAK,GDINV,GDDINV,BE,Q2, &
WM,GD,OM1,OM2,OM3,OM4,COM1,COM2,COM3,COM4,DINV,PE,W1,SDB, &
SDA,SDC,Q2OT,AZOT,TOAZ
IF(OMEGA>5000._EB .OR. OMEGA<1125._EB) THEN
SDWEAK=0.0_EB
GDINV=1._EB
GDDINV=1._EB
ELSE
BE=5.2412_EB
Q2=1.4388_EB
WM=16._EB
Q2OT = -Q2/TEMP
AZOT = 273._EB/TEMP
TOAZ = TEMP/273._EB
GD=5.94E-6_EB*OMEGA*SQRT(TOAZ)/4._EB
IF(OMEGA>=3400._EB) THEN
! CONTRIBUTION TO 2.4 MICRON BAND FROM (0000)-(0110), (0000)-(0011),
! (0000)-(1001), AND (0000)-(0102) TRANS. THE INTEGRATED BAND INTENSITIES
! OF VINCENT-GEISSE (ANNALES DE PHYSIQUE SER.12, V. 10, 1955) HAVE
! BEEN MULTIPLIED BY A FACTOR OF 4 AND THE LINE SPACING IS THAT
! OF V4 FROM GRAY AND PENNER (JQSRT V. 5, 1965).
OM1=2914.2_EB
OM2=1526.0_EB
OM3=3020.3_EB
OM4=1306.2_EB
BCNT(1)=4123.0_EB
BCNT(2)=4216.3_EB
BCNT(3)=4313.2_EB
BCNT(4)=4546.0_EB
COM1=OM2+2._EB*OM4
COM2=OM1+OM4
COM3=OM3+OM4
COM4=OM2+OM3
ATOT(1)=.64_EB*273._EB/TEMP**(1._EB-EXP(Q2OT*COM1))/((1._EB-EXP(Q2OT*OM2))*(1._EB-EXP(Q2OT*OM4))**2)
ATOT(2)=17.6_EB*AZOT*(1._EB-EXP(Q2OT*COM2))/((1._EB-EXP(Q2OT*OM1))*(1._EB-EXP(Q2OT*OM4)))
ATOT(3)=14.8_EB*AZOT*(1._EB-EXP(Q2OT*COM3))/((1._EB-EXP(Q2OT*OM3))*(1._EB-EXP(Q2OT*OM4)))
ATOT(4)=5.04_EB*AZOT*(1._EB-EXP(Q2OT*COM4))/((1._EB-EXP(Q2OT*OM2))*(1._EB-EXP(Q2OT*OM3)))
DINV=1._EB/5.74_EB
GDINV=GC3*DINV
GDDINV=GD*DINV
SDWEAK=0.0_EB
DO I=1,4
SDWEAK=SDWEAK+2._EB*(OMEGA-BCNT(I))**2*(-Q2OT*BE)**1.5_EB *ATOT(I)/SQRTPI*DINV**3*EXP(Q2OT*BE*DINV**2 &
*(OMEGA-BCNT(I))**2)
ENDDO
SDWEAK=SDWEAK*TOAZ
ELSE
PE=PTOT+.3_EB*PCH4
IF(OMEGA>=2625._EB) THEN
! CONTRIBUTION TO 3.3 MICRON BAND FROM (0000)-(0010) TRANS.
! REFER TO BROSMER AND TIEN, JQSRT V. 33, P. 521
GDINV=.00734_EB*PE*SQRT(AZOT)*EXP(1.02_EB*(TOAZ-1._EB))
GDDINV=GD/9.4_EB
J=(OMEGA-2600._EB)/25._EB
W1=2600._EB+25._EB*FLOAT(J)
SDB=SD3(2,J)+(OMEGA-W1)/25._EB*(SD3(2,J+1)-SD3(2,J))
IF(TEMP>600._EB) THEN
SDC=SD3(3,J)+(OMEGA-W1)/25._EB*(SD3(3,J+1)-SD3(3,J))
SDWEAK=SDB+(TEMP-600._EB)/250._EB*(SDC-SDB)
IF(SDWEAK<0._EB)SDWEAK=0._EB
ELSE
SDA=SD3(1,J)+(OMEGA-W1)/25._EB*(SD3(1,J+1)-SD3(1,J))
SDWEAK=SDA+(TEMP-290._EB)/310._EB*(SDB-SDA)
IF(SDWEAK<0._EB)SDWEAK=0._EB
ENDIF
ELSEIF(OMEGA>1450._EB) THEN
SDWEAK=0.0_EB
GDINV=1._EB
GDDINV=1._EB