diff --git a/src/JulES.jl b/src/JulES.jl index a761ce2..7b41518 100644 --- a/src/JulES.jl +++ b/src/JulES.jl @@ -13,13 +13,14 @@ using YAML using HDF5 # Used by ifm -using CSV -using Random -using OrdinaryDiffEq -using Lux -using ComponentArrays -using Interpolations -using JLD2 +#using CSV +#using Random +#using OrdinaryDiffEq +#using Lux +#using ComponentArrays +#using Interpolations +#using JLD2 + # Used by Nerual inflow model but not HBV # using DiffEqFlux # using SciMLSensitivity diff --git a/src/run_jules_wrapper.jl b/src/run_jules_wrapper.jl index 448102d..256b8d1 100644 --- a/src/run_jules_wrapper.jl +++ b/src/run_jules_wrapper.jl @@ -39,6 +39,19 @@ function getdataset(config, names, filename_clearing, filename_aggregated) ) end +function load_ifm_dep() + mod = @__MODULE__ + @everywhere begin + @eval $mod using CSV + @eval $mod using Random + @eval $mod using OrdinaryDiffEq + @eval $mod using Lux + @eval $mod using ComponentArrays + @eval $mod using Interpolations + @eval $mod using JLD2 + end +end + function run_jules( config_path, datayear, @@ -59,8 +72,10 @@ function run_jules( ) input = JulES.DefaultJulESInput(config, dataset, datayear, weatheryear) - - @time data = JulES.run_serial(input) + + has_ifm_results(input) && load_ifm_dep() + + @time data = JulES.run_serial(input) println("Total serial time above") println("Save output")