Skip to content

Commit

Permalink
convert input data FT
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 committed Feb 15, 2024
1 parent 5fa4f59 commit 9849b9e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/shared_utilities/Regridder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,11 @@ function hdwrite_regridfile_rll_to_cgll(
)
end

# Check that input data has the expected float type and time dimension
if eltype(offline_outvector) <: AbstractFloat
@assert eltype(offline_outvector) == FT "Invalid float type in $datafile_rll for $varname"
# Convert input data float type if needed
if eltype(offline_outvector) <: AbstractFloat &&
eltype(offline_outvector) != FT
@warn "Converting $varname data in $datafile_cgll from $(eltype(offline_outvector)) to $FT"
offline_outvector = Array{FT}(offline_outvector)
end
@assert length(times) == size(offline_outvector, 2) "Inconsistent time dimension in $datafile_cgll for $varname"

Expand Down

0 comments on commit 9849b9e

Please sign in to comment.