diff --git a/components/eamxx/src/share/iop/intensive_observation_period.cpp b/components/eamxx/src/share/iop/intensive_observation_period.cpp index 657f7ad742a..6f8474f8d85 100644 --- a/components/eamxx/src/share/iop/intensive_observation_period.cpp +++ b/components/eamxx/src/share/iop/intensive_observation_period.cpp @@ -268,9 +268,9 @@ initialize_iop_file(const util::TimeStamp& run_t0, scorpio::read_var(iop_file,"lon",&iop_file_lon); const Real rel_lat_err = std::fabs(iop_file_lat - m_params.get("target_latitude"))/ - m_params.get("target_latitude"); + std::max(m_params.get("target_latitude"),(Real)0.1); const Real rel_lon_err = std::fabs(std::fmod(iop_file_lon + 360.0, 360.0)-m_params.get("target_longitude"))/ - m_params.get("target_longitude"); + std::max(m_params.get("target_longitude"),(Real)0.1); EKAT_REQUIRE_MSG(rel_lat_err < std::numeric_limits::epsilon(), "Error! IOP file variable \"lat\" does not match target_latitude from IOP parameters.\n"); EKAT_REQUIRE_MSG(rel_lon_err < std::numeric_limits::epsilon(), @@ -541,6 +541,14 @@ read_iop_file_data (const util::TimeStamp& current_ts) scorpio::read_var(iop_file,"Ps",ps_data,iop_file_time_idx); surface_pressure.sync_to_dev(); + // Read in IOP lev data + auto data = iop_file_pressure.get_view().data(); + scorpio::read_var(iop_file,"lev",data); + + // Convert to pressure to millibar (file gives pressure in Pa) + for (int ilev=0; ilev();