Skip to content

Commit a875fa0

Browse files
authored
Merge branch 'eamxx/fix_initialization' (PR E3SM-Project#7654)
For a multi-year NetCDF file, we also need to add the time offset index. This issue was producing NBFB results, as noted in PR E3SM-Project#7638. Without this fix, the model was incorrectly reading the data from the very first year in a multi-year file. For example, for oxidants and LINOZ files, the model was incorrectly reading the data from the year 1850 as its initial time sample (instead of 2015). The second time sample (as we need two time samples to interpolate linearly) was correctly picked up from 2015. With this fix, both time samples are now correctly read from the intended year (2015 in this example), ensuring proper interpolation and model behavior. [NBFB for EAMxx]
2 parents cffe2b1 + 4105641 commit a875fa0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,10 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
619619
const int curr_month = start_of_step_ts().get_month() - 1; // 0-based
620620
if (config_.linoz.compute) {
621621
scream::mam_coupling::update_tracer_data_from_file(
622-
LinozDataReader_, curr_month, *LinozHorizInterp_, linoz_data_);
622+
LinozDataReader_, curr_month+linoz_data_.offset_time_index_, *LinozHorizInterp_, linoz_data_);
623623
}
624624
scream::mam_coupling::update_tracer_data_from_file(
625-
TracerDataReader_, curr_month, *TracerHorizInterp_, tracer_data_);
625+
TracerDataReader_, curr_month+tracer_data_.offset_time_index_, *TracerHorizInterp_, tracer_data_);
626626

627627
for(int i = 0; i < static_cast<int>(extfrc_lst_.size()); ++i) {
628628
scream::mam_coupling::update_tracer_data_from_file(

0 commit comments

Comments
 (0)