New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to Clima-compatible data structures #152
Comments
Some notes from todays discussion: Compatibility todosTop items
function foo(a)
b = zeros(size(a))
for i = 1:length(a)
b[i]+=rand()
end
return b
end
# non-allocating, but still mutating
function foo!(a, b)
for i = 1:length(a)
b[i]+=rand()
end
return b
end
# stack-allocated, much better
foo(a) = map(a_i->rand(), a) Additional + details
norm = zeros(FT, sum(NProgMoms))
n_dist = length(NProgMoms)
for (i, n_mom) in enumerate(NProgMoms)
for j in 1:n_mom
norm[get_dist_moment_ind(NProgMoms, i, j)] = norms[1] * norms[2]^(j - 1)
end
end
struct CoalescenceTensor{FT} <: KernelTensor{FT}
c::Array{FT} to struct CoalescenceTensor{FT, AFT <: AbstractArray{FT}} <: KernelTensor{FT}
c::AFT
julia> typeof((;a=1, b=2.0))
@NamedTuple{a::Int64, b::Float64}
```julia
- Remove `n, θ = get_params(dist)[2]` -> `(;n, θ) = dist`
- Remove
```julia
function get_params(dist::PrimitiveParticleDistribution{FT}) where {FT <: Real}
params = Array{Symbol, 1}(collect(propertynames(dist)))
values = Array{FT, 1}([getproperty(dist, p) for p in params])
return params, values
end entirely |
Re: making Coalescence.jl GPU compatible...
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like we need to take a several steps to make Cloudy compatible with ClimaAtmos...
Next steps will include:
The text was updated successfully, but these errors were encountered: