@@ -582,20 +582,18 @@ end
582
582
"""
583
583
function TwoStreamParameters(FT::AbstractFloat;
584
584
ld = (_) -> 0.5,
585
- ρ_PAR_leaf = 0.3,
586
- τ_PAR_leaf = 0.2,
587
- ρ_NIR_leaf = 0.4,
588
- τ_NIR_leaf = 0.25,
585
+ spectral_discretization = TwoBandSpectralDiscretization{FT}(),
586
+ ρ_leaf = (0.3, 0.4),
587
+ τ_leaf = (0.2, 0.25),
589
588
Ω = 1,
590
589
n_layers = UInt64(20),
591
590
kwargs...
592
591
)
593
592
function TwoStreamParameters(toml_dict;
594
593
ld = (_) -> 0.5,
595
- ρ_PAR_leaf = 0.3,
596
- τ_PAR_leaf = 0.2,
597
- ρ_NIR_leaf = 0.4,
598
- τ_NIR_leaf = 0.25,
594
+ spectral_discretization = TwoBandSpectralDiscretization{FT}(),
595
+ ρ_leaf = (0.3, 0.4),
596
+ τ_leaf = (0.2, 0.25),
599
597
Ω = 1,
600
598
n_layers = UInt64(20),
601
599
kwargs...
@@ -610,6 +608,7 @@ TwoStreamParameters(::Type{FT}; kwargs...) where {FT <: AbstractFloat} =
610
608
function TwoStreamParameters (
611
609
toml_dict:: CP.AbstractTOMLDict ;
612
610
G_Function = ConstantGFunction (CP. float_type (toml_dict)(0.5 )),
611
+ spectral_discretization = nothing ,
613
612
ρ_leaf:: F = (0.3 , 0.4 ),
614
613
τ_leaf:: F = (0.2 , 0.25 ),
615
614
Ω = 1 ,
@@ -627,8 +626,12 @@ function TwoStreamParameters(
627
626
# automatic conversion not possible to Union types
628
627
ρ_leaf = FT .(ρ_leaf)
629
628
τ_leaf = FT .(τ_leaf)
630
- return TwoStreamParameters {FT, typeof(G_Function), typeof(ρ_PAR_leaf)} (;
629
+ if (isnothing (spectral_discretization))
630
+ spectral_discretization = TwoBandSpectralDiscretization {FT} ()
631
+ end
632
+ return TwoStreamParameters {FT, typeof(spectral_discretization), typeof(G_Function), typeof(Ω), typeof(ρ_leaf)} (;
631
633
G_Function,
634
+ spectral_discretization,
632
635
ρ_leaf,
633
636
τ_leaf,
634
637
Ω,
@@ -661,6 +664,7 @@ BeerLambertParameters(::Type{FT}; kwargs...) where {FT <: AbstractFloat} =
661
664
function BeerLambertParameters (
662
665
toml_dict:: CP.AbstractTOMLDict ;
663
666
G_Function = ConstantGFunction (CP. float_type (toml_dict)(0.5 )),
667
+ spectral_discretization = nothing ,
664
668
ρ_leaf:: F = (0.1 , 0.4 ),
665
669
Ω = 1 ,
666
670
kwargs... ,
@@ -675,7 +679,10 @@ function BeerLambertParameters(
675
679
# default value for keyword args must be converted manually
676
680
# automatic conversion not possible to Union types
677
681
ρ_leaf = FT .(ρ_leaf)
678
- return BeerLambertParameters {FT, typeof(G_Function), typeof(ρ_leaf)} (;
682
+ if (isnothing (spectral_discretization))
683
+ spectral_discretization = TwoBandSpectralDiscretization {FT} ()
684
+ end
685
+ return BeerLambertParameters {FT, typeof(spectral_discretization), typeof(G_Function), typeof(ρ_leaf)} (;
679
686
G_Function,
680
687
ρ_leaf,
681
688
Ω,
0 commit comments