Initial commit
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
subroutine time_resolution(npoints,sampletime,
|
||||
& avetimeresolution,avetimesampled)
|
||||
implicit none
|
||||
integer npoints
|
||||
double precision sampletime(npoints),
|
||||
& avetimeresolution,avetimesampled
|
||||
|
||||
! sampletime: hour fraction
|
||||
! avetimeresolution: minutes
|
||||
! avetimesampled: hour fraction
|
||||
|
||||
integer i,j,nactual
|
||||
double precision term,copy(npoints),temp,sum
|
||||
|
||||
nactual=0
|
||||
do i=1,npoints
|
||||
if(sampletime(i).gt.-9000.0d0)then
|
||||
nactual=nactual+1
|
||||
copy(nactual)=sampletime(i)
|
||||
endif
|
||||
enddo
|
||||
if(nactual.eq.0)then
|
||||
avetimeresolution=-9999.0d0
|
||||
avetimesampled=-9999.0d0
|
||||
return
|
||||
endif
|
||||
do i=1,nactual
|
||||
do j=i,nactual
|
||||
if(copy(j).lt.copy(i))then
|
||||
temp=copy(i)
|
||||
copy(i)=copy(j)
|
||||
copy(j)=temp
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
|
||||
sum=copy(1)
|
||||
avetimeresolution=0.0d0
|
||||
do i=2,nactual
|
||||
sum=sum+copy(i)
|
||||
avetimeresolution=avetimeresolution+copy(i)-copy(i-1)
|
||||
enddo
|
||||
avetimesampled=sum/dble(nactual)
|
||||
if(nactual.eq.1)then
|
||||
avetimeresolution=-9999.0d0
|
||||
else
|
||||
avetimeresolution=60.0d0*
|
||||
& avetimeresolution/dble(nactual-1)
|
||||
endif
|
||||
return
|
||||
end
|
||||
Reference in New Issue
Block a user