Appendix D: SPCTRL2 FORTRAN Source Code

(+ is “continuation code” an for expression requiring multiple lines; “C” represents a comment line.)

Подпись: PROGRAM SPCTRAL2 ( INPUT,OUTPUT,TAPE5=INPUT,TAPE6=OUTPUT, +TAPE1,TAPE2,TAPE3)

Подпись: C C. C. C. C. C C. C C C C C C C C C C C C C C C C C C C C C C. C C C C C C C C C C C C C C C C C C C. ..TAPE1 = INPUT PARAMETERS

..TAPE2 = EXTRATERRESTRIAL SPECTRAL IRRADIANCE, ABSORPTION COEFFICIENTS. ..TAPE3 = OUTPUT FILE..TAPE5 = TERMINAL SCREEN

..THIS CODE WAS WRITTEN BY RICHARD BIRD AND CALCULATES SPECTRAL IRRADIANCE OR PHOTON FLUX ON A TILTED OR HORIZONTAL SURFACE. MODIFICATIONS TO THE CODE TO CONVERT SPECTRAL IRRADIANCE TO PHOTON FLUX PER WAVELENGTH OR ELECTRON VOLT WERE MADE BY CAROL RIORDAN. COMMENTS AND PROGRAM INSTRUCTIONS WERE ADDED BY RIORDAN 8/84.

******** INPUT VARIABLES ********

AI = ANGLE OF INCIDENCE OF DIRECT BEAM ON FLAT SURFACE (DEG)

ALPHA= POWER ON ANGSTRON TURBIDITY EXPRESSION (1.14 FOR RURAL)

NDAY = JULIAN DAY

NW = NUMBER OF WAVELENGTHS FOR THIS RUN O3 = OZONE AMOUNT (ATM CM)

RHO = GROUND ALBEDO

TILT = TILT ANGLE OF SURFACE FROM THE HORIZONTAL (DEG)

SPR = SURFACE PRESSURE (MILLIBARS)

TAU5 = THE AEROSOL OPTICAL DEPTH AT 0.5 MICRONS (BASE E)

W = PRECIPITABLE WATER VAPOR (CM)

WV(I) & R(I) GROUND REFLECTIVITY AT SPECIFIC WAVELENGTHS Z = SOLAR ZENITH ANGLE (DEG)

***** TO RUN THIS PROGRAM *****

.. IN THE FIRST LINE OF INPUT ON TAPE1, CHOOSE FROM THE FOLLOWING OPTIONS:

COLLECTOR MODE

(MODE) 1=GLOBAL NORMAL AND DIRECT NORMAL (TRACKING FLAT PLATE/CONCENTRATOR)

2=GLOBAL TILT (FIXED FLAT PLATE)

3=GLOBAL HORIZONTAL

OUTPUT UNITS (NUNITS) 1=IRRADIANCE PER WAVELENGTH

2=PHOTON FLUX PER WAVELENGTH 3=PHOTON FLUX PER ELECTRON VOLT

NUMBER OF SPECTRA (NUMSPT)

CHECK THE INPUT PARAMETERS ON THE SECOND LINE OF TAPE1, ESPECIALLY TAU5, W, TILT, SPR, NDAY. Z AND AI ARE READ IN THE "DO 15 LOOP".

******* THE PROGRAM *****

DIMENSION WV(6),R(6)

..READ INPUT

READ(1,1,) MODE, NUNITS, NUMSPT

READ(1,2) TAU5,ALPHA, O3,W, TILT, SPR, NDAY, NW

READ(1,3) V(1),R(1),WV(2),R(2),WV(3),R(3),WV(4),R(4),WV(5),R(5), + WV(6),R(6)

C

C…THESE CONSTANTS ARE NEEDED TO CALCULATE PHOTON FLUX.

C

XH=6.626176*(10.**(-34.))

XC=2.99792458*(10.**8.)

EVOLT=1.6021892*(10.**(-19.))

CONST=(1./(XH*XC))*(10.**(-10.))

XC=XC*(10.**6.)

C

C…RADIANS PER DEGREE RPD=.0174533 C

C…ERV IS THE EARTH RADIUS VECTOR-CORRECTION FOR SUN DISTANCE TT=6.283185*(NDAY-1)/365.

TT2=2.*TT

ERV=1.00011+.034221*COS(TT)+.00128*SIN(TT)

+ + .000719*COS(TT2)+.000077*SIN(TT2)

C

C…WRITE OUT INITIAL CONDITIONS IF(MODE. EQ. 1) WRITE(5,20)

IF(MODE. EQ. 2) WRITE(5,21)

IF(MODE. EQ. 3) WRITE(5,22)

WRITE(5,4) NUNITS, NUMSPT WRITE(5,5) NDAY, ERV WRITE(5,7) TAU5,ALPHA, W,O3

WRITE(5,8) WV(1),R(1),WV(2),R(2),WV(3),R(3),WV(4),R(4),

+ WV(5),R(5),WV(6),R(6)

C

C…OMEG AND OMEGP ARE USED IN THE SINGLE SCATTERING ALBEDO C CALCULATIONS. JUSTUS HAS A FORM OF OMEGL THAT VARIES WITH C RELATIVE HUMIDITY AS WELL AS WAVELENGTH.

C

OMEG=0.945

OMEGP=0.095

C

C…FS AND FSP ARE THE FORWARD/TOTAL SCATTERING RATIOS AS C A FUNCTION OF ZENITH ANGLE. AIR MASS FOR FSP IS FIXED IN THIS CODE, C FS IS IN THE "DO 15 LOOP". GG IS THE AEROSOL ASSYMETRY C FACTOR (0.65 USED FOR RURAL).

C

GG=0.65

ALG=ALOG(1.-GG)

AFS=ALG*(1.459+ALG*(0.1595+ALG*0.4129))

BFS=ALG*(0.0783+ALG*(-0.3824-ALG*0.5874))

FSP=1.-0.5*EXP((AFS+BFS/1.8)/1.8)

C

C…RR IS USED IN THE OZONE MASS EXPRESSION IN THE "DO 15 LOOP".

RR=22./6370.

C

C…THESE EXPRESSIONS DEPEND ON ZENITH AND INCIDENCE ANGLE AND C SHOULD BE INSIDE THE LOOP THAT CHANGES Z AND AI.

C

C…FOR GLOBAL NORMAL SPECTRA (MODE=1), INCIDENT ANGLE(AI)=0 AND C TILT= Z. FOR GLOBAL HORIZONTAL SPECTRA C (MODE=3), INCIDENCE ANGLE (AI)=Z AND TILT=0.

C

C…DO LOOP FOR SEVERAL SPECTRA (NUMSPT)

DO 15 KK=1, NUMSPT

READ(1,10) Z, AI IF (MODE. EQ. 1) AI=0.

IF (MODE. EQ. 1) TILT=Z

IF (MODE. EQ. 3) TILT=0.

IF (MODE. EQ. 3) AI=Z

COSTLT=COS(TILT*RPD)

CI=COS(AI*RPD)

ZCOS=COS(Z*RPD)

ZSIN=SIN(Z*RPD)

FS=1.-0.5*EXP((AFS+BFS*ZCOS)*ZCOS)

C

C…RELATIVE OPTICAL AIR MASS.

AM=1./(ZCOS+.15*(93.885-Z)**(-1.253))

C…PRESSURE CORRECTED AIR MASS.

AMP=AM*SPR/1013.

C

C…OZONE MASS.

AMO=(1.+RR)/(ZCOS**2.+2.*RR)**.5

C

C…WRITE OUT INITAL CONDITIONS TO TTERMINAL SCREEN C

WRITE(5,17) Z, TILT, AI WRITE(5,6) AM, SPR, AMP, AMO C

C…INITIALIZE THE INTERPOLATION COUNTER FOR RHO.

NR=2

C…REWIND THE TAPE WITH ET SPECTRUM AND ABSORPTION COEFFICIENTS FOR C EACH SPECTRUM.

REWIND 2 C

C…DO LOOP FOR NUMBER OF WAVELENGTHS (NW)

DO 14 I=1,NW

READ(2,9) WVL, H0,AW, AO, AU C

C…CORRECT EXTRATERRESTRIAL IRRADIANCE FOR EARTH RADIUS VECTOR.

H0=H0*ERV

C

C

C…OMEGL IS THE WAVELENGTH-DEPENDENT SINGLE SCATTERING ALBEDO C

OMEGL=OMEG*EXP(-OMEGP*(ALOG(WVL/0.4))**2.)

C

C…THE FOLLOWING STATEMENTS PRODUCE THE WAVELENGTH-DEPENDENT ALBEDO C

IF(WVL .GT. WV(NR)) NR=NR+1

SLP=(R(NR)-R(NR-1))/(WV(NR)-WV(NR-1))

RHO=SLP*(WVL-WV(NR-1))+R(NR-1)

C

C…CALCULATE TRANSMITTANCE

TR=EXP(-AMP/(WVL**4.*(115.6406-1.335/WVL**2.)))

TO=EXP(-AO*O3*AMO)

TW=EXP(-.2385*AW*W*AM/(1.+20.07*AW*W*AM)**.45)

TU=EXP(-1.41*AU*AMP/((1.+118.93*AU*AMP)**.45))

DELA=TAU5*(WVL/.5)**(-ALPHA)

TAS=EXP(-OMEGL*DELA*AM)

TAA=EXP(-(1.-OMEGL)*DELA*AM)

TA=EXP(-DELA*AM)

C

DIR=H0*TR*TO*TW*TU*TA

C…CALCULATE DIRECT COMPONENT OF IRRADIANCE ONTO SURFACE DIRSUR=DIR*CI

C

C…DRAY AND DAER HAVE BEEN MODIFIED BY BIRD. NOTE POWER ON TR TERM. C

DRAY=H0*ZCOS*TO*TW*TU*TAA*(1.-TR**.95)*.5

DAER=H0*ZCOS*TO*TW*TU*TAA*TR**1.5*(1.-TAS)*FS

TRP=EXP(-1.8/(WVL**4.*(115.6406-1.335/WVL**2)))

TWP=EXP(-.2385*AW*W*1.8/((1.+20.07*AW*W*1.8)**.45))

TUP=EXP(-1.41*AU*1.8/((1.+118.93*AU*1.8)**.45))

TASP=EXP(-OMEGL*DELA*1.8)

TAAP=EXP(-(1.-OMEGL)*DELA*1.8)

RHOA=TUP*TWP*TAAP*(.5*(1.-TRP)+(1.-FSP)*TRP*(1.-TASP))

DRGD=(DIR*ZCOS+(DRAY+DAER))*RHO*RHOA/(1.-RHO*RHOA)

DIF=DRAY+DAER+DRGD

C

C…CRC IS A UV CORRECTION FACTOR C

CRC=1.0

IF (WVL. LE. .45) CRC=(WVL+.55)**1.8

C

C…DIFFUSE ON A HORIZONTAL SURFACE DIF=DIF*CRC C

C…TOTAL ON A HORIZONTAL SURFACE DTOT=DIR*ZCOS+DIF

C…MAKE DIFS=DIF TO USE FORMAT 12 FOR GLOBAL HORIZONTAL CASE. DIFS=DIF

IF (MODE. EQ. 3) GOTO 79 C

C…GROUND REFLECTED COMPONENT

REFS=DTOT*RHO*(1.0-COSTLT)/2.0

C

C…THE THREE FOLLOWING STATEMENTS ARE THE HAY TILT ALGORITHM C

C…ANISOTROPY INDEX AII=DIR/H0 C

C…CIRCUMSOLAR AND ISOTROPIC COMPONENT (WEIGHTED BY DIF*AII AND C DIF*(1-AII).

DIFSC=DIF*AII*CI/ZCOS

DIFSI=DIF*(1.0-AII)*(1.0+COSTLT)/2.0

C

C…DIFFUSE ON TILTED SURFACE.

DIFS=DIFSC+DIFSI+REFS

C

C…TOTAL ON TILTED SURFACE.

DTOT=DIR*CI+DIFS

C

C…PHOTON FLUX CALCULATIONS.

C

C…WRITE SPECTRAL IRRADIANCE OR PHOTON FLUX OUTPUT TO TAPE3.

79 IF (NUNITS. EQ.1) GOTO 12 PFWVGL=DTOT*WVL*CONST ENERGY=(XH*XC)/WVL E=ENERGY/EVOLT PFEVGL=(PFWVGL*WVL)/E PFWVDN=DIR*WVL*CONST PFEVDN=(PFWVDN*WVL)/E C PFWVDS=DIRSUR*WV*CONST

C PFEVDS=(PFWVDS*WVL)/E

C……. DECIDE IF USING DIF OR DIFS

C PFWVDF=DIF*WVL*CONST

C PFEVDF=(PFWVDF*WVL)/E

IF (NUNITS. EQ. 2) GOTO 11 WRITE (3,18) E, PFEVGL, PFEVDN GOTO 13

11 WRITE (3,18) WVL, PFWVGL, PFWVDN GOTO 13

12 WRITE (3,16) WVL, DTOT, DIR, DIFS

13 CONTINUE

C

14 CONTINUE

15 CONTINUE C

C****** FORMAT STEMENTS *****

C

1 FORMAT(3I5)

2 FORMAT(6F6.3,2I5)

3 FORMAT(12F6.2)

4 FORMAT(2X,"NUNITS=",I6,3X,"NUMSPT=",I6/)

5 FORMAT(2X,"NDAY =",I7,3X, ERV =",F7.4)

6 FORMAT(2X,"AM =",F7.2,3X,"SPR =",F7.2,3X,"AMP =",F7.2,3X,

+"AMO =",F7.2)

7 FORMAT(2X,"TAU5 =",F7.2,3X,"ALPHA=",F7.2,3X,"W =",F7.2,

+3X,"O3 =",F7.3)

8FORMAT(2X,"W1=",F6.2,2X,"R1=",F6.2/2CX,"W2=",F6.2,2X, +"R2=",F6.2/2X,"W3=",F6.2,2X,"R3=",F6.2/2X,"W4=",F6.2,2X, +"R4=",F6.2/2X,"W5=",F6.2,2X,"R5=",F6.2/2X,"W6=",F6.2,2X, +"R6=",F6.2/)

9 FORMAT(5F10.4)

10 FORMAT(2F10.4)

16 FORMAT(F7.4,3F10.4)

17 FORMAT(2X,"Z =",F7.2,3X,"TILT =",F7.2,3X,"AI =",F7.2)

18 FORMAT(F10.5,2E10.4)

20 FORMAT(1X,"GLOBAL NORMAL AND DIRECT NORMAL")

21 FORMAT(1X,"GLOBAL TILT")

22 FORMAT(1X,"GLOBAL HORIZONTAL")

STOP

TABLE D.1

Fixed Spectral Data for SPCTRL2 Clear Sky Model

Wavelength Microns (um)

Wehrli ETR W/cm2/um

Water Absorption

O3

Absorption

Mixed

Gases

0.300

535.9

0

10

0

0.305

558.3

0

4.8

0

0.310

622

0

2.7

0

0.315

692.7

0

1.35

0

0.320

715.1

0

0.8

0

0.325

832.9

0

0.38

0

0.330

961.9

0

0.16

0

0.335

931.9

0

0.075

0

0.340

900.6

0

0.04

0

0.345

911.3

0

0.019

0

0.350

975.5

0

0.007

0

0.360

975.9

0

0

0

0.370

1119.9

0

0

0

0.380

1103.8

0

0

0

0.390

1033.8

0

0

0

0.400

1479.1

0

0

0

0.410

1701.3

0

0

0

0.420

1740.4

0

0

0

0.430

1587.2

0

0

0

————- END——————————————————

TABLE D.1 (Continued)

Fixed Spectral Data for SPCTRL2 Clear Sky Model

Wavelength Microns (um)

Wehrli ETR

W/cm2/um

Water Absorption

O3

Absorption

Mixed

Gases

0.440

1837

0

0

0

0.450

2005

0

0.003

0

0.460

2043

0

0.006

0

0.470

1987

0

0.009

0

0.480

2027

0

0.014

0

0.490

1896

0

0.021

0

0.500

1909

0

0.03

0

0.510

1927

0

0.04

0

0.520

1831

0

0.048

0

0.530

1891

0

0.063

0

0.540

1898

0

0.075

0

0.550

1892

0

0.085

0

0.570

1840

0

0.12

0

0.593

1768

0.075

0.119

0

0.610

1728

0

0.12

0

0.630

1658

0

0.09

0

0.656

1524

0

0.065

0

0.668

1531

0

0.051

0

0.690

1420

0.016

0.028

0.15

0.710

1399

0.0125

0.018

0

0.718

1374

1.8

0.015

0

0.724

1373

2.5

0.012

0

0.740

1298

0.061

0.01

0

0.753

1269

0.0008

0.008

0

0.758

1245

0.0001

0.007

0

0.763

1223

0.00001

0.006

4

0.768

1205

0.00001

0.005

0.35

0.780

1183

0.0006

0

0

0.800

1148

0.036

0

0

0.816

1091

1.6

0

0

0.824

1062

2.5

0

0

0.832

1038

0.5

0

0

0.840

1022

0.155

0

0

0.860

998.7

0.00001

0

0

0.880

947.2

0.0026

0

0

0.905

893.2

7

0

0

0.915

868.2

5

0

0

0.925

829.7

5

0

0

0.930

830.3

27

0

0

0.937

814

55

0

0

TABLE D.1 (Continued)

Fixed Spectral Data for SPCTRL2

Clear Sky Model

Wavelength Microns

Wehrli ETR

O3

Mixed

(um)

W/cm2/um

Water Absorption

Absorption

Gases

0.948

786.9

45

0

0

0.965

768.3

4

0

0

0.980

767

1.48

0

0

0.994

757.6

0.1

0

0

1.040

688.1

0.00001

0

0

1.070

640.7

0.001

0

0

1.100

606.2

3.2

0

0

1.120

585.9

115

0

0

1.130

570.2

70

0

0

1.145

564.1

75

0

0

1.161

544.2

10

0

0

1.170

533.4

5

0

0

1.200

501.6

2

0

0

1.240

477.5

0.002

0

0.05

1.270

442.7

0.002

0

0.3

1.290

440

0.1

0

0.02

1.320

416.8

4

0

0.0002

1.350

391.4

200

0

0.00011

1.395

358.9

1000

0

0.00001

1.443

327.5

185

0

0.05

1.463

317.5

80

0

0.011

1.477

307.3

80

0

0.005

1.497

300.4

12

0

0.0006

1.520

292.8

0.16

0

0

1.539

275.5

0.002

0

0.005

1.558

272.1

0.0005

0

0.13

1.578

259.3

0.0001

0

0.04

1.592

246.9

0.00001

0

0.06

1.610

244

0.0001

0

0.13

1.630

243.5

0.001

0

0.001

1.646

234.8

0.01

0

0.0014

1.678

220.5

0.036

0

0.0001

1.740

190.8

1.1

0

0.00001

1.800

171.1

130

0

0.00001

1.860

144.5

1000

0

0.0001

1.920

135.7

500

0

0.001

1.960

123

100

0

4.3

1.985

123.8

4

0

0.2

2.005

113

2.9

0

21

2.035

108.5

1

0

0.13

TABLE D.1 (Continued)

Fixed Spectral Data for SPCTRL2 Clear Sky Model

Wavelength Microns (um)

Wehrli ETR W/cm2/um

Water Absorption

O3

Absorption

Mixed

Gases

2.065

97.5

0.4

0

1

2.100

92.4

0.22

0

0.08

2.148

82.4

0.25

0

0.001

2.198

74.6

0.33

0

0.00038

2.270

68.3

0.5

0

0.001

2.360

63.8

4

0

0.0005

2.450

49.5

80

0

0.00015

2.500

48.5

310

0

0.00014

2.600

38.6

15000

0

0.00066

2.700

36.6

22000

0

100

2.800

32

8000

0

150

2.900

28.1

650

0

0.13

3.000

24.8

240

0

0.0095

3.100

22.1

230

0

0.001

3.200

19.6

100

0

0.8

3.300

17.5

120

0

1.9

3.400

15.7

19.5

0

1.3

3.500

14.1

3.6

0

0.075

3.600

12.7

3.1

0

0.01

3.700

11.5

2.5

0

0.00195

3.800

10.4

1.4

0

0.004

3.900

9.5

0.17

0

0.29

4.000

8.6

0.0045

0

0.025

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>