Skip to content

Commit

Permalink
Merge pull request #395 from CliMA/ck/nc
Browse files Browse the repository at this point in the history
Change syntax to get NC data
  • Loading branch information
Sbozzolo authored Nov 10, 2023
2 parents 44c189e + 63e8830 commit 16f5e2b
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 115 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RRTMGP"
uuid = "a01a1ee8-cea4-48fc-987c-fc7878d79da1"
authors = ["Climate Modeling Alliance"]
version = "0.9.2"
version = "0.9.3"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
2 changes: 1 addition & 1 deletion examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
NCDatasets = "=0.12.17"
NCDatasets = "0.12.17, 0.13"
2 changes: 1 addition & 1 deletion gpuenv/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
NCDatasets = "=0.12.17"
NCDatasets = "0.12.17, 0.13"
142 changes: 71 additions & 71 deletions src/optics/LookUpTables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ function LookUpLW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}
n_contrib_lower = Int(ds.dim["contributors_lower"])
n_contrib_upper = Int(ds.dim["contributors_upper"])

p_ref_tropo = FT(ds["press_ref_trop"][:][1])
t_ref_absrb = FT(ds["absorption_coefficient_ref_T"][:][1])
p_ref_absrb = FT(ds["absorption_coefficient_ref_P"][:][1])
p_ref_tropo = FT(Array(ds["press_ref_trop"])[1])
t_ref_absrb = FT(Array(ds["absorption_coefficient_ref_T"])[1])
p_ref_absrb = FT(Array(ds["absorption_coefficient_ref_P"])[1])

gases_major = STA(undef, n_maj_absrb)
gases_minor = STA(undef, n_min_absrb)
Expand Down Expand Up @@ -229,7 +229,7 @@ function LookUpLW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}
idx_gases_minor_upper = DA(idx_gases_minor_upper)
idx_scaling_gas_upper = DA(idx_scaling_gas_upper)

key_species = ds["key_species"][:]
key_species = Array(ds["key_species"])
@inbounds for j in 1:size(key_species, 3)
for i in 1:size(key_species, 2)
if key_species[1, i, j] == 0 && key_species[2, i, j] == 0
Expand All @@ -240,27 +240,27 @@ function LookUpLW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}

key_species = IA3D(key_species)

kmajor = FTA4D(ds["kmajor"][:])
kminor_lower = FTA3D(ds["kminor_lower"][:])
kminor_upper = FTA3D(ds["kminor_upper"][:])
kminor_start_lower = IA1D(ds["kminor_start_lower"][:])
kminor_start_upper = IA1D(ds["kminor_start_upper"][:])
kmajor = FTA4D(Array(ds["kmajor"]))
kminor_lower = FTA3D(Array(ds["kminor_lower"]))
kminor_upper = FTA3D(Array(ds["kminor_upper"]))
kminor_start_lower = IA1D(Array(ds["kminor_start_lower"]))
kminor_start_upper = IA1D(Array(ds["kminor_start_upper"]))

planck_fraction = FTA4D(ds["plank_fraction"][:])
t_planck = FTA1D(ds["temperature_Planck"][:])
planck_fraction = FTA4D(Array(ds["plank_fraction"]))
t_planck = FTA1D(Array(ds["temperature_Planck"]))

totplnk = FTA2D(ds["totplnk"][:])
bnd_lims_gpt = Array{Int, 2}(ds["bnd_limits_gpt"][:])
bnd_lims_wn = FTA2D(ds["bnd_limits_wavenumber"][:])
totplnk = FTA2D(Array(ds["totplnk"]))
bnd_lims_gpt = Array{Int, 2}(Array(ds["bnd_limits_gpt"]))
bnd_lims_wn = FTA2D(Array(ds["bnd_limits_wavenumber"]))
#-----------------------
major_gpt2bnd = Array{UI8, 1}(undef, n_gpt)
@inbounds for i in 1:n_bnd
major_gpt2bnd[bnd_lims_gpt[1, i]:bnd_lims_gpt[2, i]] .= UI8(i)
end
#-----------------------
bnd_lims_gpt = IA2D(bnd_lims_gpt)
minor_lower_gpt_lims = Array{Int, 2}(ds["minor_limits_gpt_lower"][:])
minor_upper_gpt_lims = Array{Int, 2}(ds["minor_limits_gpt_upper"][:])
minor_lower_gpt_lims = Array{Int, 2}(Array(ds["minor_limits_gpt_lower"]))
minor_upper_gpt_lims = Array{Int, 2}(Array(ds["minor_limits_gpt_upper"]))
#-----------------------
minor_lower_bnd = zeros(UI8, n_min_absrb_lower)
minor_upper_bnd = zeros(UI8, n_min_absrb_upper)
Expand Down Expand Up @@ -319,14 +319,14 @@ function LookUpLW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}
minor_upper_gpt_lims = IA2D(minor_upper_gpt_lims)
#-----------------------

minor_lower_scales_with_density = IA1D(ds["minor_scales_with_density_lower"][:])
minor_upper_scales_with_density = IA1D(ds["minor_scales_with_density_upper"][:])
minor_lower_scales_with_density = IA1D(Array(ds["minor_scales_with_density_lower"]))
minor_upper_scales_with_density = IA1D(Array(ds["minor_scales_with_density_upper"]))

lower_scale_by_complement = IA1D(ds["scale_by_complement_lower"][:])
upper_scale_by_complement = IA1D(ds["scale_by_complement_upper"][:])
lower_scale_by_complement = IA1D(Array(ds["scale_by_complement_lower"]))
upper_scale_by_complement = IA1D(Array(ds["scale_by_complement_upper"]))

p_ref = Array{FT, 1}(ds["press_ref"][:])
t_ref = Array{FT, 1}(ds["temp_ref"][:])
p_ref = Array{FT, 1}(Array(ds["press_ref"]))
t_ref = Array{FT, 1}(Array(ds["temp_ref"]))

p_ref_min = minimum(p_ref)

Expand All @@ -335,7 +335,7 @@ function LookUpLW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}

p_ref = FTA1D(p_ref)
t_ref = FTA1D(t_ref)
vmr_ref = FTA3D(ds["vmr_ref"][:])
vmr_ref = FTA3D(Array(ds["vmr_ref"]))

n_η = size(kmajor, 2)

Expand Down Expand Up @@ -556,9 +556,9 @@ function LookUpSW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}
n_contrib_lower = Int(ds.dim["contributors_lower"])
n_contrib_upper = Int(ds.dim["contributors_upper"])

p_ref_tropo = FT(ds["press_ref_trop"][:][1])
t_ref_absrb = FT(ds["absorption_coefficient_ref_T"][:][1])
p_ref_absrb = FT(ds["absorption_coefficient_ref_P"][:][1])
p_ref_tropo = FT(Array(ds["press_ref_trop"])[1])
t_ref_absrb = FT(Array(ds["absorption_coefficient_ref_T"])[1])
p_ref_absrb = FT(Array(ds["absorption_coefficient_ref_P"])[1])

gases_major = STA(undef, n_maj_absrb)
gases_minor = STA(undef, n_min_absrb)
Expand Down Expand Up @@ -613,7 +613,7 @@ function LookUpSW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}
end
end

key_species = ds["key_species"][:]
key_species = Array(ds["key_species"])
@inbounds for j in 1:size(key_species, 3)
for i in 1:size(key_species, 2)
if key_species[1, i, j] == 0 && key_species[2, i, j] == 0
Expand All @@ -624,23 +624,23 @@ function LookUpSW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}

key_species = IA3D(key_species)

kmajor = FTA4D(ds["kmajor"][:])
kminor_lower = FTA3D(ds["kminor_lower"][:])
kminor_upper = FTA3D(ds["kminor_upper"][:])
kminor_start_lower = IA1D(ds["kminor_start_lower"][:])
kminor_start_upper = IA1D(ds["kminor_start_upper"][:])
kmajor = FTA4D(Array(ds["kmajor"]))
kminor_lower = FTA3D(Array(ds["kminor_lower"]))
kminor_upper = FTA3D(Array(ds["kminor_upper"]))
kminor_start_lower = IA1D(Array(ds["kminor_start_lower"]))
kminor_start_upper = IA1D(Array(ds["kminor_start_upper"]))

bnd_lims_gpt = Array{Int, 2}(ds["bnd_limits_gpt"][:])
bnd_lims_wn = FTA2D(ds["bnd_limits_wavenumber"][:])
bnd_lims_gpt = Array{Int, 2}(Array(ds["bnd_limits_gpt"]))
bnd_lims_wn = FTA2D(Array(ds["bnd_limits_wavenumber"]))
#-----------------------
major_gpt2bnd = Array{UI8, 1}(undef, n_gpt)
@inbounds for i in 1:n_bnd
major_gpt2bnd[bnd_lims_gpt[1, i]:bnd_lims_gpt[2, i]] .= UI8(i)
end
#-----------------------
bnd_lims_gpt = IA2D(bnd_lims_gpt)
minor_lower_gpt_lims = Array{Int, 2}(ds["minor_limits_gpt_lower"][:])
minor_upper_gpt_lims = Array{Int, 2}(ds["minor_limits_gpt_upper"][:])
minor_lower_gpt_lims = Array{Int, 2}(Array(ds["minor_limits_gpt_lower"]))
minor_upper_gpt_lims = Array{Int, 2}(Array(ds["minor_limits_gpt_upper"]))
#-----------------------
minor_lower_bnd = zeros(UI8, n_min_absrb_lower)
minor_upper_bnd = zeros(UI8, n_min_absrb_upper)
Expand Down Expand Up @@ -698,13 +698,13 @@ function LookUpSW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}
minor_lower_gpt_lims = IA2D(minor_lower_gpt_lims)
minor_upper_gpt_lims = IA2D(minor_upper_gpt_lims)
#-----------------------
minor_lower_scales_with_density = IA1D(ds["minor_scales_with_density_lower"][:])
minor_upper_scales_with_density = IA1D(ds["minor_scales_with_density_upper"][:])
lower_scale_by_complement = IA1D(ds["scale_by_complement_lower"][:])
upper_scale_by_complement = IA1D(ds["scale_by_complement_upper"][:])
minor_lower_scales_with_density = IA1D(Array(ds["minor_scales_with_density_lower"]))
minor_upper_scales_with_density = IA1D(Array(ds["minor_scales_with_density_upper"]))
lower_scale_by_complement = IA1D(Array(ds["scale_by_complement_lower"]))
upper_scale_by_complement = IA1D(Array(ds["scale_by_complement_upper"]))

p_ref = Array{FT, 1}(ds["press_ref"][:])
t_ref = Array{FT, 1}(ds["temp_ref"][:])
p_ref = Array{FT, 1}(Array(ds["press_ref"]))
t_ref = Array{FT, 1}(Array(ds["temp_ref"]))

p_ref_min = minimum(p_ref)

Expand All @@ -713,14 +713,14 @@ function LookUpSW(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFloat, DA}

p_ref = FTA1D(p_ref)
t_ref = FTA1D(t_ref)
vmr_ref = FTA3D(ds["vmr_ref"][:])
vmr_ref = FTA3D(Array(ds["vmr_ref"]))

n_η = size(kmajor, 2)

rayl_lower = FTA3D(ds["rayl_lower"][:])
rayl_upper = FTA3D(ds["rayl_upper"][:])
rayl_lower = FTA3D(Array(ds["rayl_lower"]))
rayl_upper = FTA3D(Array(ds["rayl_upper"]))

solar_src = ds["solar_source"][:]
solar_src = Array(ds["solar_source"])
solar_src_tot = FT(sum(solar_src))
solar_src_scaled = FTA1D(solar_src ./ solar_src_tot)

Expand Down Expand Up @@ -891,39 +891,39 @@ function LookUpCld(ds, ::Type{FT}, ::Type{DA}, use_lut::Bool = true) where {FT <

@assert nsizereg == 3 # RRTMGP pade approximation assumes exactly (3) size regimes

radliq_lwr = FT(ds["radliq_lwr"][:])
radliq_upr = FT(ds["radliq_upr"][:])
radliq_fac = FT(ds["radliq_fac"][:])
radliq_lwr = FT(Array(ds["radliq_lwr"]))
radliq_upr = FT(Array(ds["radliq_upr"]))
radliq_fac = FT(Array(ds["radliq_fac"]))

radice_lwr = FT(ds["radice_lwr"][:])
radice_upr = FT(ds["radice_upr"][:])
radice_fac = FT(ds["radice_fac"][:])
radice_lwr = FT(Array(ds["radice_lwr"]))
radice_upr = FT(Array(ds["radice_upr"]))
radice_fac = FT(Array(ds["radice_fac"]))

lut_extliq = FTA2D(ds["lut_extliq"][:])
lut_ssaliq = FTA2D(ds["lut_ssaliq"][:])
lut_asyliq = FTA2D(ds["lut_asyliq"][:])
lut_extliq = FTA2D(Array(ds["lut_extliq"]))
lut_ssaliq = FTA2D(Array(ds["lut_ssaliq"]))
lut_asyliq = FTA2D(Array(ds["lut_asyliq"]))

lut_extice = FTA3D(ds["lut_extice"][:])
lut_ssaice = FTA3D(ds["lut_ssaice"][:])
lut_asyice = FTA3D(ds["lut_asyice"][:])
lut_extice = FTA3D(Array(ds["lut_extice"]))
lut_ssaice = FTA3D(Array(ds["lut_ssaice"]))
lut_asyice = FTA3D(Array(ds["lut_asyice"]))

pade_extliq = FTA3D(ds["pade_extliq"][:])
pade_ssaliq = FTA3D(ds["pade_ssaliq"][:])
pade_asyliq = FTA3D(ds["pade_asyliq"][:])
pade_extliq = FTA3D(Array(ds["pade_extliq"]))
pade_ssaliq = FTA3D(Array(ds["pade_ssaliq"]))
pade_asyliq = FTA3D(Array(ds["pade_asyliq"]))

pade_extice = FTA4D(ds["pade_extice"][:])
pade_ssaice = FTA4D(ds["pade_ssaice"][:])
pade_asyice = FTA4D(ds["pade_asyice"][:])
pade_extice = FTA4D(Array(ds["pade_extice"]))
pade_ssaice = FTA4D(Array(ds["pade_ssaice"]))
pade_asyice = FTA4D(Array(ds["pade_asyice"]))

pade_sizreg_extliq = FTA1D(ds["pade_sizreg_extliq"][:])
pade_sizreg_ssaliq = FTA1D(ds["pade_sizreg_ssaliq"][:])
pade_sizreg_asyliq = FTA1D(ds["pade_sizreg_asyliq"][:])
pade_sizreg_extliq = FTA1D(Array(ds["pade_sizreg_extliq"]))
pade_sizreg_ssaliq = FTA1D(Array(ds["pade_sizreg_ssaliq"]))
pade_sizreg_asyliq = FTA1D(Array(ds["pade_sizreg_asyliq"]))

pade_sizreg_extice = FTA1D(ds["pade_sizreg_extice"][:])
pade_sizreg_ssaice = FTA1D(ds["pade_sizreg_ssaice"][:])
pade_sizreg_asyice = FTA1D(ds["pade_sizreg_asyice"][:])
pade_sizreg_extice = FTA1D(Array(ds["pade_sizreg_extice"]))
pade_sizreg_ssaice = FTA1D(Array(ds["pade_sizreg_ssaice"]))
pade_sizreg_asyice = FTA1D(Array(ds["pade_sizreg_asyice"]))

bnd_lims_wn = FTA2D(ds["bnd_limits_wavenumber"][:])
bnd_lims_wn = FTA2D(Array(ds["bnd_limits_wavenumber"]))

return (LookUpCld{Bool, FT, FTA1D, FTA2D, FTA3D, FTA4D}(
nband,
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
NCDatasets = "=0.12.17"
NCDatasets = "0.12.17, 0.13"
8 changes: 4 additions & 4 deletions test/clear_sky_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ function clear_sky(
flip_ind = nlev:-1:1

ds_flux_up_lw = Dataset(flux_up_file_lw, "r")
comp_flux_up_lw = ds_flux_up_lw["rlu"][:][flip_ind, :, exp_no]
comp_flux_up_lw = Array(ds_flux_up_lw["rlu"])[flip_ind, :, exp_no]
close(ds_flux_up_lw)

ds_flux_dn_lw = Dataset(flux_dn_file_lw, "r")
comp_flux_dn_lw = ds_flux_dn_lw["rld"][:][flip_ind, :, exp_no]
comp_flux_dn_lw = Array(ds_flux_dn_lw["rld"])[flip_ind, :, exp_no]
close(ds_flux_dn_lw)

flux_up_lw = Array(slv.flux_lw.flux_up)
Expand All @@ -136,11 +136,11 @@ function clear_sky(
#--------------------------------------------------------------
# comparing shortwave fluxes with data from RRTMGP FORTRAN code
ds_flux_up_sw = Dataset(flux_up_file_sw, "r")
comp_flux_up_sw = ds_flux_up_sw["rsu"][:][flip_ind, :, exp_no]
comp_flux_up_sw = Array(ds_flux_up_sw["rsu"])[flip_ind, :, exp_no]
close(ds_flux_up_sw)

ds_flux_dn_sw = Dataset(flux_dn_file_sw, "r")
comp_flux_dn_sw = ds_flux_dn_sw["rsd"][:][flip_ind, :, exp_no]
comp_flux_dn_sw = Array(ds_flux_dn_sw["rsd"])[flip_ind, :, exp_no]
close(ds_flux_dn_sw)

flux_up_sw = Array(slv.flux_sw.flux_up)
Expand Down
40 changes: 20 additions & 20 deletions test/read_all_sky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function ncol_ds_all_sky(use_lut)
lut_pade = use_lut ? :lut : :pade
flux_file = get_ref_filename(:comparison, :cloudysky, lut_pade = lut_pade)
ds_comp = Dataset(flux_file, "r")
return size(ds_comp["lw_flux_up"][:], 1)
return size(Array(ds_comp["lw_flux_up"]), 1)
end

function setup_allsky_as(
Expand Down Expand Up @@ -51,37 +51,37 @@ function setup_allsky_as(
irrad .= FT(lkp_sw.solar_src_tot)


p_lev = Array{FT}(reshape(ds_in["p_lev"][:][1, :], nlev, 1))
p_lev = Array{FT}(reshape(Array(ds_in["p_lev"])[1, :], nlev, 1))

bot_at_1 = p_lev[1, 1] > p_lev[end, 1]
lev_ind = bot_at_1 ? (1:nlev) : (nlev:-1:1)
lay_ind = bot_at_1 ? (1:nlay) : (nlay:-1:1)

p_lev = Array{FT}(reshape(ds_in["p_lev"][:][1, lev_ind], nlev, 1))
p_lay = Array{FT}(reshape(ds_in["p_lay"][:][1, lay_ind], nlay, 1))
t_lev = Array{FT}(reshape(ds_in["t_lev"][:][1, lev_ind], nlev, 1))
t_lay = Array{FT}(reshape(ds_in["t_lay"][:][1, lay_ind], nlay, 1))
p_lev = Array{FT}(reshape(Array(ds_in["p_lev"])[1, lev_ind], nlev, 1))
p_lay = Array{FT}(reshape(Array(ds_in["p_lay"])[1, lay_ind], nlay, 1))
t_lev = Array{FT}(reshape(Array(ds_in["t_lev"])[1, lev_ind], nlev, 1))
t_lay = Array{FT}(reshape(Array(ds_in["t_lay"])[1, lay_ind], nlay, 1))
t_sfc = Array{FT}(reshape([t_lev[1, 1]], 1))

p_lev = repeat(p_lev, 1, ncol)
p_lay = repeat(p_lay, 1, ncol)
t_lev = repeat(t_lev, 1, ncol)
t_lay = repeat(t_lay, 1, ncol)
t_sfc = repeat(t_sfc, ncol)
#col_dry = DA{FT,2}(transpose(ds_in["col_dry"][:][:, lay_ind]))
#col_dry = DA{FT,2}(transpose(Array(ds_in["col_dry"])[:, lay_ind]))
#col_dry from the dataset not used in the FORTRAN RRTMGP example

# Reading volume mixing ratios
vmrat = zeros(FT, nlay, ncol, ngas)

vmrat[:, 1, idx_gases["h2o"]] .= Array{FT}(ds_in["vmr_h2o"][:][1, lay_ind])
vmrat[:, 1, idx_gases["o3"]] .= Array{FT}(ds_in["vmr_o3"][:][1, lay_ind])
vmrat[:, 1, idx_gases["co2"]] .= Array{FT}(ds_in["vmr_co2"][:][1, lay_ind])
vmrat[:, 1, idx_gases["n2o"]] .= Array{FT}(ds_in["vmr_n2o"][:][1, lay_ind])
vmrat[:, 1, idx_gases["co"]] .= Array{FT}(ds_in["vmr_co"][:][1, lay_ind])
vmrat[:, 1, idx_gases["ch4"]] .= Array{FT}(ds_in["vmr_ch4"][:][1, lay_ind])
vmrat[:, 1, idx_gases["o2"]] .= Array{FT}(ds_in["vmr_o2"][:][1, lay_ind])
vmrat[:, 1, idx_gases["n2"]] .= Array{FT}(ds_in["vmr_n2"][:][1, lay_ind])
vmrat[:, 1, idx_gases["h2o"]] .= Array{FT}(Array(ds_in["vmr_h2o"])[1, lay_ind])
vmrat[:, 1, idx_gases["o3"]] .= Array{FT}(Array(ds_in["vmr_o3"])[1, lay_ind])
vmrat[:, 1, idx_gases["co2"]] .= Array{FT}(Array(ds_in["vmr_co2"])[1, lay_ind])
vmrat[:, 1, idx_gases["n2o"]] .= Array{FT}(Array(ds_in["vmr_n2o"])[1, lay_ind])
vmrat[:, 1, idx_gases["co"]] .= Array{FT}(Array(ds_in["vmr_co"])[1, lay_ind])
vmrat[:, 1, idx_gases["ch4"]] .= Array{FT}(Array(ds_in["vmr_ch4"])[1, lay_ind])
vmrat[:, 1, idx_gases["o2"]] .= Array{FT}(Array(ds_in["vmr_o2"])[1, lay_ind])
vmrat[:, 1, idx_gases["n2"]] .= Array{FT}(Array(ds_in["vmr_n2"])[1, lay_ind])

for icol in 2:ncol
vmrat[:, icol, :] .= vmrat[:, 1, :]
Expand Down Expand Up @@ -198,12 +198,12 @@ function load_comparison_data(use_lut, bot_at_1, ncol)
lut_pade = use_lut ? :lut : :pade
flux_file = get_ref_filename(:comparison, :cloudysky, lut_pade = lut_pade) # flux files for comparison (LUT)
ds_comp = Dataset(flux_file, "r")
ncol_ds = size(ds_comp["lw_flux_up"][:], 1)
ncol_ds = size(Array(ds_comp["lw_flux_up"]), 1)
nrepeat = cld(ncol, ncol_ds)
comp_flux_up_lw = repeat(_orient_data(transpose(ds_comp["lw_flux_up"][:]), bot_at_1), 1, nrepeat)
comp_flux_dn_lw = repeat(_orient_data(transpose(ds_comp["lw_flux_dn"][:]), bot_at_1), 1, nrepeat)
comp_flux_up_sw = repeat(_orient_data(transpose(ds_comp["sw_flux_up"][:]), bot_at_1), 1, nrepeat)
comp_flux_dn_sw = repeat(_orient_data(transpose(ds_comp["sw_flux_dn"][:]), bot_at_1), 1, nrepeat)
comp_flux_up_lw = repeat(_orient_data(transpose(Array(ds_comp["lw_flux_up"])), bot_at_1), 1, nrepeat)
comp_flux_dn_lw = repeat(_orient_data(transpose(Array(ds_comp["lw_flux_dn"])), bot_at_1), 1, nrepeat)
comp_flux_up_sw = repeat(_orient_data(transpose(Array(ds_comp["sw_flux_up"])), bot_at_1), 1, nrepeat)
comp_flux_dn_sw = repeat(_orient_data(transpose(Array(ds_comp["sw_flux_dn"])), bot_at_1), 1, nrepeat)
close(ds_comp)
nlev, ncol_ds = size(comp_flux_up_lw)
return comp_flux_up_lw[:, 1:ncol],
Expand Down
Loading

2 comments on commit 16f5e2b

@Sbozzolo
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95130

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.3 -m "<description of version>" 16f5e2b51a7bac644c6daab6de3a31b4be21b70b
git push origin v0.9.3

Please sign in to comment.