13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/gs2crmod/read_netcdf.rb', line 13
def new_netcdf_file
if (open = @runner.run_list.keys.find_all{|id| @runner.run_list[id].cache[:new_netcdf_file]}).size > 200
open = open.sort_by{|id| @runner.run_list[id].cache[:new_netcdf_file_otime]}
@runner.run_list[open[0]].new_ncclose
end
if cache[:new_netcdf_file] and not [:Complete, :Failed].include? @status
new_ncclose
end
cache[:new_netcdf_file_otime] = Time.now.to_i
cache[:new_netcdf_file] ||= NumRu::NetCDF.open(new_netcdf_filename)
cache[:new_netcdf_file].sync
cache[:new_netcdf_file]
end
|