Commit 7186f313 authored by ivar's avatar ivar
Browse files

error occurs when an observation is taken exactly at midnight UTC (00:00)....

error occurs when an observation is taken exactly at midnight UTC (00:00). This causes a problem to calculate the n value because hr and mi variables are empty. I made a quick fix by setting n value to 24 if an observation is taken at midnight.
parent ead46230
......@@ -556,12 +556,21 @@ flog.info('eventids: %s',eventids[mm], name='logger.b') #June 23
hr=substring(dd,12,13)
mi=substring(dd,15,16)
flog.info('dd: %s, length dd: %s,hr: %s, mi: %s',dd,length(dd),hr,mi,name='logger.b')
n = 24-floor(as.numeric(hr) + as.numeric(mi)/60)
if (nchar(dd,type='width') ==10)
{
n=24
flog.info('No hr and mi, set n to 24',name='logger.b')
}
print("XXXn")
print(n)
datevalid=dateall[1]+0.5*3600-(0:(ntimes-1))*3600
#ixflux=(1:ntimes)[(datevalid<=xx)][1:endtime] #time backward
#ixflux=(1:ntimes)[(datevalid<=xx)][1:(endtime+n)]
flog.info('n: %s, endtime: %s',n,endtime,name='logger.b')
ixflux <-array(n:(endtime+n-1),dim=c(240))
flog.info('ixflux endtime: %s,%s,%s',endtime,n,as.numeric(hr)+(as.numeric(hr)/60),name='logger.b')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment