Skip to content

Commit

Permalink
Amend netcdf_writer.jl
Browse files Browse the repository at this point in the history
This is a small PR removing 3 lines of code from netcdf_writer.jl,
these 3 lines are already inside a loop checking if space is horizontal,
and need to be evaluated only if it is not (if space is 3D).
In the case where space is 3D, we have a z coordinate, if space is
horizontal, we do not.
  • Loading branch information
AlexisRenchon committed May 17, 2024
1 parent 005fa25 commit 9eb9f8d
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/netcdf_writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,6 @@ function NetCDFWriter(
maybe_move_to_cpu(interpolate(remapper, coords_z))
end

maybe_move_to_cpu =
ClimaComms.device(coords_z) isa ClimaComms.CUDADevice &&
ClimaComms.iamroot(comms_ctx) ? Array : identity

interpolated_physical_z = maybe_move_to_cpu(interpolate(remapper, coords_z))

preallocated_arrays =
ClimaComms.iamroot(comms_ctx) ?
Dict{String, ClimaComms.array_type(space)}() : Dict{String, Nothing}()
Expand Down

0 comments on commit 9eb9f8d

Please sign in to comment.