C PROGRAM ZONAL C CALCULATES MEAN GAMMA IN THE SPECIFIED COLATTITUDE RANGE implicit real*8(A-H,O-Z) DIMENSION YEAR(30),D0(30),E0(30),D(30,30),ED(30,30),P(30) # ,GAMM(30,20),EGAMM(30,20) C ************************************************************************ WRITE(*,*)' NPMAX,NY,NZO' READ(*,*) NPMAX,NY,NZO OPEN(UNIT=10,FILE='GBC',STATUS='OLD') OPEN(UNIT=11,FILE='EGBC',STATUS='OLD') OPEN(UNIT=12,FILE='GA',STATUS='OLD') OPEN(UNIT=13,FILE='EGA',STATUS='OLD') OPEN(UNIT=17,FILE='GAZO',STATUS='UNKNOWN') OPEN(UNIT=18,FILE='EGAZO',STATUS='UNKNOWN') DO J=1,NY IF(J.NE.1) THEN READ(10,*)YEAR(J),D0(J) READ(11,*)NSE,NPA,E0(J) ENDIF READ(12,*)YEAR(J),(D(J,K),K=1,18) READ(13,*)NSE,NMO,(ED(J,K),K=1,18) IF(J.NE.1) THEN FF=NPA-1 WRITE(*,*) FF E0(J)=E0(J)/SQRT(FF) ENDIF DO K=1,18 FFS=NMO-1 IF(NMO.LT.1) WRITE(*,*) NMO ED(J,K)=ED(J,K)/SQRT(FFS) ENDDO ENDDO D0(1)=0 E0(1)=0 DEDEG=90./NZO PI=3.14159265359 DO NZN=1,NZO DEGHIGH=NZN*DEDEG DEGLOW=DEGHIGH-DEDEG COLL=COS(DEGLOW*PI/180.) COLH=COS(DEGHIGH*PI/180.) COLLS=COLL**2 COLHS=COLH**2 PS=1.0 DO 52 N=1,NPMAX PS=-PS*(1.0-0.5/N) PPP=PS*(COLL-COLH) PP=PS DO 51 K=1,N PP=-PP*(N+K-0.5)*(N-K+1.0)/K/(K-0.5) PPP=PPP+PP*(COLL**(2*K+1)-COLH**(2*K+1))/(2.*K+1.) 51 CONTINUE P(N)=PPP/(COLL-COLH) C write(17,520) 2*n,ppp 520 FORMAT(I3,F10.3) 52 CONTINUE DO J=1,NY GAM=D0(J) EGAS=E0(J)**2 DO N=1,NPMAX GAM=GAM+D(J,N)*P(N) EGAS=EGAS+(ED(J,N)*P(N))**2 ENDDO GAMM(J,NZN)=GAM IF(EGAS.LT.0) WRITE(*,*) N EGAMM(J,NZN)=SQRT(EGAS) ENDDO ENDDO DO J=1,NY WRITE(17,60) YEAR(J),(GAMM(J,NZN),NZN=1,NZO) WRITE(18,60) YEAR(J),(EGAMM(J,NZN),NZN=1,NZO) ENDDO 60 FORMAT(F8.2,18F7.3) STOP END