[Fortran] 纯文本查看 复制代码
program solard
implicit none
REAL TMAX, TMIN, E, TTHIRTY
INTEGER I, YEAR, DOY ,a
INTEGER ,parameter:: ndays=730
REAL B,delta,sita,R,womiga0,womiga1,womiga2,womiga3
REAL tuo0,alfa,C,b0,PAI,FAI,PZ,P0,Tfmax,q1
real b1,b2,I0,D
real, allocatable::Q0(:)
real, allocatable::Qh(:)
real, allocatable::TTMAX(:)
! NDAYS=730
tuo0=0.87
alfa=-0.000061
C=1.5
b0=0.031
b1=0.201
b2=0.185
I0=1367.0
D=86400
PAI=3.14159
FAI=38.33/(180*PAI)
PZ=90810
P0=101325
!!!DO I=1,NDAYS
OPEN (UNIT = 9, FILE = '\B90V3\DAT\SOLARDFILE.DAT')
!! rewind(9)
!! READ (9, *) YEAR, DOY, TMAX, TMIN, E, TTHIRTY
!! enddo
Allocate( Q0( ndays ) )
Allocate( Qh( ndays ) )
Allocate( TTMAX( ndays ) )
DO I=1,NDAYS
!TTHIRTY 30日平均温差
READ (9, *) YEAR, DOY, TMAX, TMIN, E, TTHIRTY !////// 加到这里
delta=23.45*PAI/(180*sin(2*PAI*(284+i)/365))
sita=2*PAI*i/365
R=1.000109+0.033494*cos(sita)+0.001472*sin(sita)
R=R+0.000768*cos(2*sita)+0.000079*sin(2*sita)
womiga0=ABS(acos(-tan(delta)*tan(fai)))
q1=womiga0*sin(fai)*sin(delta)+cos(fai)*cos(delta)*sin(womiga0)
q0(i)=q1*I0*D/(PAI*R*R)
womiga3=0
DO A=1,100
womiga1=-womiga0+womiga0/100+womiga0*a/50
womiga2=sin(fai)*sin(delta)+cos(fai)*cos(delta)*cos(womiga1)
womiga3=womiga3+(womiga2*tuo0**(PZ/(P0*womiga2)))*womiga0/50
ENDDO
Ttmax(i)=womiga3/(q0(i)*2*PAI*R*R/I0/D)+alfa*e*1000;
B=b0+b1*exp(-b2* TTHIRTY);
Tfmax=1.0-0.9*exp(-B*(Tmax-Tmin)**(C));
Qh(i)=q0(i)*Ttmax(i)*Tfmax/1000000;
ENDDO
open(2,file='QH.dat')
do I=1,ndays-1
write(2,'(i4,2x,f15.1,f6.1,f15.1)') I,Q0(I),TTMAX(I),QH(I)
enddo
CLOSE(2)
END