File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
experiments/calibration/coarse_amip Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -91,11 +91,13 @@ function preprocess_monthly_averages(simdir, name)
91
91
monthly_avgs = ClimaAnalysis. Atmos. to_pressure_coordinates (monthly_avgs, pressure)
92
92
monthly_avgs = limit_pressure_dim_to_era5_range (monthly_avgs)
93
93
end
94
- # TODO : Replace NaNs with global mean
95
- monthly_avgs = ClimaAnalysis. replace (monthly_avgs, NaN => 0.0 )
94
+ # Line up dates for monthly averages
96
95
monthly_avgs = ClimaAnalysis. shift_to_start_of_previous_month (monthly_avgs)
97
96
# Remove spinup time
98
97
monthly_avgs = window (monthly_avgs, " time" ; left = spinup_time)
98
+ global_mean = monthly_avgs |> average_lat |> average_lon |> average_time
99
+ # Replace NaNs with global mean
100
+ monthly_avgs = ClimaAnalysis. replace (monthly_avgs, NaN => global_mean)
99
101
return monthly_avgs
100
102
end
101
103
You can’t perform that action at this time.
0 commit comments