Skip to content
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

Use output dates from atmos.integrator #725

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions experiments/AMIP/coupler_driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ config_dict = merge(parsed_args, config_dict)
config_dict_atmos = get_atmos_config(config_dict)

## merge dictionaries of command line arguments, coupler dictionary and component model dictionaries
## (if there are common keys, the last dictorionary in the `merge` arguments takes precedence)
## (if there are common keys, the last dictionary in the `merge` arguments takes precedence)
config_dict = merge(config_dict_atmos, config_dict)

## read in some parsed command line arguments, required by this script
Expand Down Expand Up @@ -858,20 +858,22 @@ if ClimaComms.iamroot(comms_ctx)
# Compare against observations
if t_end > 84600
@info "Error against observations"
output_dates = cs.dates.date0[] .+ Second.(atmos_sim.integrator.sol.t)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add a comment that dt_save_to_sol needs to be consistent with the required averaging. For most of our runs dt_save_to_sol is 10days but the seasonal average using this method would require 1days (for daily averaged data).


include("user_io/leaderboard.jl")
compare_vars = ["pr"]
function plot_biases(dates, output_name)
output_path = joinpath(COUPLER_ARTIFACTS_DIR, "bias_$(output_name).png")
Leaderboard.plot_biases(atmos_sim.integrator.p.output_dir, compare_vars, dates; output_path)
end
plot_biases(cs.dates.date, "total")
plot_biases(output_dates, "total")

MAM, JJA, SON, DJF = Leaderboard.split_by_season(cs.dates.date)
MAM, JJA, SON, DJF = Leaderboard.split_by_season(output_dates)

!isempty(MAM) && plot_biases(cs.dates.date, "MAM")
!isempty(JJA) && plot_biases(cs.dates.date, "JJA")
!isempty(SON) && plot_biases(cs.dates.date, "SON")
!isempty(DJF) && plot_biases(cs.dates.date, "DJF")
!isempty(MAM) && plot_biases(MAM, "MAM")
!isempty(JJA) && plot_biases(JJA, "JJA")
!isempty(SON) && plot_biases(SON, "SON")
!isempty(DJF) && plot_biases(DJF, "DJF")
end
end

Expand Down
Loading