Skip to content

Commit

Permalink
horizontal_space netcdf writer
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisRenchon committed May 15, 2024
1 parent 43ca4f1 commit b85e136
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/netcdf_writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,21 @@ function NetCDFWriter(
hpts,
)
zcoords = Geometry.ZPoint.(vpts)

remapper = Remapper(space, hcoords, zcoords)
comms_ctx = ClimaComms.context(space)

coords_z = Fields.coordinate_field(space).z
if is_horizontal_space
interpolated_physical_z = []
else
coords_z = Fields.coordinate_field(space).z
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))
end

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

0 comments on commit b85e136

Please sign in to comment.