Skip to content

Commit

Permalink
Sync lat/lon to host in rrtmgp interface for IOP
Browse files Browse the repository at this point in the history
lat/lon are used on both host and device in run_impl(), but when IOP is used we were changing the value without syncing to host.
  • Loading branch information
tcclevenger committed Sep 13, 2024
1 parent 56e881c commit a282adc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ void RRTMGPRadiation::set_grids(const std::shared_ptr<const GridsManager> grids_

if (m_iop) {
// For IOP runs, we need to use the lat/lon from the
// IOP files instead of the geometry data.
// IOP files instead of the geometry data. Deep copy
// to device and sync to host since both will be used.
m_lat = m_grid->get_geometry_data("lat").clone();
m_lat.deep_copy(m_iop->get_params().get<Real>("target_latitude"));
m_lat.sync_to_host();

m_lon = m_grid->get_geometry_data("lon").clone();
m_lon.deep_copy(m_iop->get_params().get<Real>("target_longitude"));
m_lon.sync_to_host();
} else {
m_lat = m_grid->get_geometry_data("lat");
m_lon = m_grid->get_geometry_data("lon");
Expand Down

0 comments on commit a282adc

Please sign in to comment.