-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppressing @info
statement during construction of AtmosSimulation
#3658
Comments
z_max: 60000.0
z_elem: 31
dz_bottom: 50.0
dt: "400secs"
t_end: "1days"
topography: "Earth"
rayleigh_sponge: true
implicit_diffusion: true
approximate_linear_solve_iters: 2
moist: "equil"
surface_setup: "PrescribedSurface" #DefaultMoninObukhov"
vert_diff: "DecayWithHeightDiffusion"
precip_model: "0M"
cloud_model: "grid_scale"
toml: [sphere_aquaplanet.toml] |
We already largely have this, in some way. We use the Julia Logging system, so you can filter logs as you want. Here's some docs https://clima.github.io/ClimaComms.jl/dev/logging/#How-do-I-filter-out-messages-from-certain-modules? What we don't have is a simple way to pass the logger to the simulation |
Ok I will see if I can experiment with this. We still want logging with I am not quite sure if what I would like to achieve can merely be achieved by filtering |
We can suppress @info only from atmos (as shown at the bottom of the documentation page) (and atmos pretty much only uses @info in the init) |
I agree, it would be nice to have a simple verbose option. For now, you can use this snippet to filter out logs from individual modules using Logging, LoggingExtras, ClimaAtmos
filter_climaatmos = log_args -> log_args._module != ClimaAtmos
logger = EarlyFilteredLogger(filter_climaatmos, Logging.current_logger())
global_logger(logger)
config = ClimaAtmos.AtmosConfig()
ClimaAtmos.get_simulation(config) |
Getting an error, with import ClimaAtmos as Atmos
using Printf
# Making ClimaAtmos a little less chatty
using Logging
using LoggingExtras
filter_climaatmos = log_args -> log_args._module != ClimaAtmos
logger = EarlyFilteredLogger(filter_climaatmos, Logging.current_logger())
global_logger(logger)
output_prefix = "aquaplanet"
config_dict = Dict(
"device" => "CUDADevice",
"z_max" => 60000.0,
"z_elem" => 31,
"h_elem" => 12, # h_elem = 30 => ~ 1 degree
"dz_bottom" => 50.0,
"dt" => "200secs",
"topography" => "NoWarp", # "Earth"
"rayleigh_sponge" => true,
"implicit_diffusion" => true,
"approximate_linear_solve_iters" => 2,
"moist" => "equil",
"surface_setup" => "PrescribedSurface", #DefaultMoninObukhov"
"vert_diff" => "DecayWithHeightDiffusion",
"precip_model" => "0M",
"cloud_model" => "grid_scale",
"log_progress" => false,
"output_dir" => output_prefix,
"toml" => ["sphere_aquaplanet.toml"]
)
atmosphere = Atmos.AtmosSimulation(config_dict) I get an error
|
I'd be nice to design a way to suppress
@info
statements during the construction ofAtmosSimulation
. In a scripting context it is nice for users to be able to pick the output they desire; ie@show simulation
, or properties thereof.In a development (or coupling) context the extensive output becomes a hindrance rather than merely a distraction: the long output drowns out important warnings and errors that occur on package import. As a result, developing packages that depend on ClimaAtmos is difficult.
This is the output I get with a fairly simple configuration (I think):
The text was updated successfully, but these errors were encountered: