diff --git a/src/AGNI.jl b/src/AGNI.jl index 6b6a4d12..f0efa2b3 100755 --- a/src/AGNI.jl +++ b/src/AGNI.jl @@ -292,6 +292,7 @@ module AGNI conv_atol::Float64 = cfg["execution" ]["converge_atol"] conv_rtol::Float64 = cfg["execution" ]["converge_rtol"] max_steps::Int = cfg["execution" ]["max_steps"] + max_runtime::Float64 = cfg["execution" ]["max_runtime"] # plotting stuff plt_run::Bool = cfg["plots" ]["at_runtime"] @@ -484,7 +485,9 @@ module AGNI solver_success = solver.solve_energy!(atmos, sol_type=sol_type, conduct=incl_conduct, chem_type=chem_type, convect=incl_convect, latent=incl_latent, - sens_heat=incl_sens, max_steps=max_steps, conv_atol=conv_atol, + sens_heat=incl_sens, max_steps=max_steps, + max_runtime=max_runtime, + conv_atol=conv_atol, conv_rtol=conv_rtol, method=method_idx, dx_max=dx_max, linesearch=linesearch, modplot=modplot,save_frames=plt_ani) diff --git a/src/energy.jl b/src/energy.jl index a110fc9a..bea3bc8f 100644 --- a/src/energy.jl +++ b/src/energy.jl @@ -537,7 +537,7 @@ module energy function condense_diffuse!(atmos::atmosphere.Atmos_t) # Parameter - timescale::Float64 = 1e6 # seconds + timescale::Float64 = 4e6 # seconds # Reset flux and mask fill!(atmos.flux_l, 0.0) diff --git a/src/solver.jl b/src/solver.jl index 469cb0b4..9aa44721 100644 --- a/src/solver.jl +++ b/src/solver.jl @@ -153,7 +153,7 @@ module solver ls_tau::Float64 = 0.5 # backtracking step size ls_increase::Float64 = 1.01 # factor by which cost can increase ls_max_steps::Int = 10 # maximum steps - ls_min_scale::Float64 = 1.0e-3 # minimum scale + ls_min_scale::Float64 = 3.0e-4 # minimum scale # plateau plateau_n::Int = 5 # Plateau declared when plateau_i > plateau_n @@ -609,7 +609,7 @@ module solver # Linesearch # https://people.maths.ox.ac.uk/hauser/hauser_lecture2.pdf - if linesearch && (step > 1) + if linesearch #&& (step > 1) @debug " linesearch" # Reset @@ -710,9 +710,6 @@ module solver end # end solver loop - rm(path_plt, force=true) - rm(path_jac, force=true) - # ---------------------------------------------------------- # Extract solution # ---------------------------------------------------------- @@ -721,6 +718,8 @@ module solver if code == 0 @info " success in $step steps" atmos.is_converged = true + rm(path_plt, force=true) + rm(path_jac, force=true) elseif code == 1 @error " failure (maximum iterations)" elseif code == 2