Skip to content

Commit 2025d27

Browse files
committed
Remove host copy of uninitialized device memory
1 parent 81a9193 commit 2025d27

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/eamxx/src/physics/rrtmgp/simple_netcdf.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace simple_netcdf {
8181
std::vector<int> dimSizes(ndims);
8282
size_t dimsize;
8383
for (int i = 0; i < ndims; i++) {
84-
handle_error(nc_inq_dimlen(ncid, dimids[i], &dimsize), __FILE__, __LINE__);
84+
handle_error(nc_inq_dimlen(ncid, dimids[i], &dimsize), __FILE__, __LINE__);
8585
dimSizes[i] = dimsize;
8686
}
8787

@@ -95,7 +95,7 @@ namespace simple_netcdf {
9595

9696
// Read variable data
9797
if (myMem == memDevice) {
98-
auto arrHost = arr.createHostCopy();
98+
auto arrHost = arr.createHostObject();
9999
if (std::is_same<T,bool>::value) {
100100
// Create boolean array from integer arrays
101101
Array<int,rank,memHost,myStyle> tmp("tmp",dimSizes);
@@ -222,7 +222,7 @@ namespace simple_netcdf {
222222
handle_error(nc_put_var(ncid, varid, arr), __FILE__, __LINE__);
223223
}
224224

225-
template <class T, int rank, int myMem, int myStyle>
225+
template <class T, int rank, int myMem, int myStyle>
226226
void write(Array<T,rank,myMem,myStyle> const &arr, std::string varName, std::vector<std::string> dimNames) {
227227

228228
// Make sure length of dimension names is equal to rank of array

0 commit comments

Comments
 (0)