Skip to content

Commit

Permalink
eliminate global counter for multi-thread
Browse files Browse the repository at this point in the history
  • Loading branch information
ggebbie committed Mar 20, 2024
1 parent 3d635cc commit dc8820f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ECCOtour.jl
Original file line number Diff line number Diff line change
Expand Up @@ -958,13 +958,20 @@ end
print year and month given time index
assuming using ECCOv4r4
"""
function timestamp_monthly_v4r4(t)
function timestamp_monthly_v4r4(t::Integer)
tecco = times_ecco()
year = Int(floor(tecco[t]))
month = ((t-1)%12)+1
println("year ",year," month ",month)
return year,month
end
function timestamp_monthly_v4r4(datafile::String)
tsteps_permonth = 730.4
pattern = r"\.(.*?)\." # regex to extract between periods
tt = round(Int64,parse(Int64,match(pattern,datafile)[1])/tsteps_permonth)
year, month = timestamp_monthly_v4r4(tt)
return year,month
end

times_ecco() = range(1992 + 1/24,step=1/12,stop=2018)

Expand Down

0 comments on commit dc8820f

Please sign in to comment.