Skip to content

Commit 42c11fc

Browse files
Merge #40
40: Fix inference r=charleskawczynski a=charleskawczynski This PR fixes inference in `TRMM_LBA_z` Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
2 parents 8808529 + 735fcae commit 42c11fc

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name = "AtmosphericProfilesLibrary"
22
uuid = "86bc3604-9858-485a-bdbe-831ec50de11d"
33
authors = ["Climate Modeling Alliance"]
4-
version = "0.1.3"
4+
version = "0.1.4"
55

66
[deps]
77
Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94"
8+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
89

910
[compat]
1011
Dierckx = "0.5"

src/profiles/TRMM_LBA.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import LinearAlgebra
2+
13
""" [Grabowski2006](@cite) """
24
function TRMM_LBA_z(::Type{FT}) where {FT}
35
z_in = FT[0.130, 0.464, 0.573, 1.100, 1.653, 2.216, 2.760,
@@ -222,9 +224,11 @@ function TRMM_LBA_radiation(::Type{FT}) where {FT}
222224
0.319, 0.201, 0.343, 0.148, 0, 0, 0, 0, 0],
223225
FT[-0.344, -0.75, -0.856, -0.757, -0.607, -0.409, -0.25, -0.156, -0.033, 0.076, 0.143, 0.246,
224226
0.316, 0.287, 0.293, 0.361, 0.345, 0.225, 0.082, 0.035, 0.071, 0.046, 0.172, 0.708,
225-
0.255, 0.21, 0.325, 0.146, 0, 0, 0, 0, 0]] ./ 86400
227+
0.255, 0.21, 0.325, 0.146, 0, 0, 0, 0, 0]]
226228

227-
rad_in = hcat(rad_in...)'
229+
rad_in = reduce(hcat, rad_in)::Matrix{FT}
230+
rad_in .= rad_in ./ 86400
231+
rad_in = (rad_in')::LinearAlgebra.Adjoint{FT, Matrix{FT}}
228232
profile = Dierckx.Spline2D(rad_time, z_in, rad_in; kx = 1, ky = 1)
229233
return profile
230234
end

0 commit comments

Comments
 (0)