[Fortran] 纯文本查看 复制代码
! This program is for extracting reflectance at four wavelength
Parameter(line=364,sample=2048)
real NIESraw(line, sample),d1(line,sample),d2(line,sample)
real NIESwave(line,sample),NIESt(line)
real NIES(line, sample), ref(line,sample),waveNISE
character filename*20, filename2*100, dum*10
open(unit=22, file='filename.prn', status='old')
do 1 idate=1,2000
read(22,*,end=99) filename
filename2=filename !'Z:\kiryuT\spectro\data\UT_30m\'//filename
open(unit=20, file=filename2, status='old')
open(unit=30, file='refrectance.dat',status='unknown')
!!! discard the first 8 lines !!!!丂丂
do j=1,3
read(20,*)
end do
read(20,*) dum,(NIESt(i),i=2,line)
do j=1,4
read(20,*)
end do
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
do j=1,sample
read(20,*) (d1(i,j),i=1,line)
end do
do j=1,sample-5
do i=2,line
! if(NIESt(i).eq.5.0) then !NIES_20m bag correction
! NIESwave(i,j)=d1(1,j+5) !
! else !
NIESwave(i,j)=d1(1,j)
! end if !
NIESraw(i,j)=d1(i,j)/NIESt(i)
end do
end do
do i=2,line
!open(unit=23, file='factors3.csv', status='old')
do k=1,157
sumNIES=0.0
NNIES=0
wave=300.+float(k)*5.
do j=1,sample-5
if((NIESwave(i,j).ge.wave-2.5).and.(NIESwave(i,j).le.wave+2.5)) then
sumNIES=sumNIES+NIESraw(i,j)
NNIES=NNIES+1
end if
end do
NIES(i,k)=sumNIES/float(NNIES) !average
!read(23,*) f1 !f2,f3
!REF(i,k)=(UT(i,k))/(NIES(i,k)*f1)
end do
end do
do ll=1,35
time=(float(ll)/(6*24))*24.
write(30,100) filename, time
end do
do l=2,(line+6)/5
do k=1,157
REF(l,k)=NIES(5*(l-2)+3,k)/((NIES(5*(l-2)+2,k)+NIES(5*(l-2)+4,k))/2)
end do
!close(23)
time=(float(l-2)/(6*24)+0.25)*24.
write(30,100) filename,time,ref(l,46),ref(l,54),ref(l,76),ref(l,100),ref(l,90),ref(l,81),ref(l,120),ref(l,134)
write(*,100) filename,time,ref(l,46),ref(l,54),ref(l,76),ref(l,100),ref(l,90),ref(l,81),ref(l,120),ref(l,134)
100 format(A20,1x,10f14.8)
end do
do ll=1,36
time=(float(ll)/(6*24)+0.75)*24.
write(30,100) filename, time
end do
1 continue
99 end