Skip to content

Commit 0f7741f

Browse files
authored
Merge pull request #1257 from CliMA/js/ft-type-param
force type specialization in constructors
2 parents f684693 + 0e3a528 commit 0f7741f

File tree

23 files changed

+47
-58
lines changed

23 files changed

+47
-58
lines changed

docs/src/tutorials/standalone/Canopy/canopy_tutorial.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ shared_params = SharedCanopyParameters{FT, typeof(earth_param_set)}(
141141

142142
ψ_soil = FT(0.0)
143143
T_soil = FT(298.0)
144-
soil_driver = PrescribedGroundConditions(
145-
FT;
144+
soil_driver = PrescribedGroundConditions{FT}(;
146145
α_PAR = FT(0.2),
147146
α_NIR = FT(0.4),
148147
T = TimeVaryingInput(t -> T_soil),

experiments/benchmarks/richards.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function setup_prob(t0, tf, Δt; nelements = (101, 15))
9999
atmos = ClimaLand.PrescribedPrecipitation{FT, typeof(precip)}(precip),
100100
)
101101

102-
model = ClimaLand.Soil.RichardsModel(FT, domain, forcing)
102+
model = ClimaLand.Soil.RichardsModel{FT}(domain, forcing)
103103

104104
Y, p, cds = initialize(model)
105105
z = ClimaCore.Fields.coordinate_field(cds.subsurface).z

experiments/integrated/fluxnet/snow_soil/simulation.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## Ma, S., Baldocchi, D. D., Xu, L., Hehn, T. (2007)
33
## Inter-Annual Variability In Carbon Dioxide Exchange Of An
44
## Oak/Grass Savanna And Open Grassland In California, Agricultural
5-
## And Forest Meteorology, 147(3-4), 157-171. https://doi.org/10.1016/j.agrformet.2007.07.008
5+
## And Forest Meteorology, 147(3-4), 157-171. https://doi.org/10.1016/j.agrformet.2007.07.008
66
## CLM 5.0 Tech Note: https://www2.cesm.ucar.edu/models/cesm2/land/CLM50_Tech_Note.pdf
77
# Bonan, G. Climate change and terrestrial ecosystem modeling. Cambridge University Press, 2019.
88

@@ -93,8 +93,7 @@ S_s = FT(1e-3)
9393
z_0m = FT(0.01)
9494
z_0b = FT(0.001)
9595
emissivity = FT(0.98)
96-
soil_model = Soil.EnergyHydrology(
97-
FT,
96+
soil_model = Soil.EnergyHydrology{FT}(
9897
domain,
9998
forcing,
10099
earth_param_set;
@@ -121,7 +120,7 @@ snow_model = Snow.SnowModel(
121120
density,
122121
)
123122

124-
land = ClimaLand.SoilSnowModel(; snow = snow_model, soil = soil_model)
123+
land = ClimaLand.SoilSnowModel{FT}(; snow = snow_model, soil = soil_model)
125124
Y, p, cds = initialize(land)
126125
exp_tendency! = make_exp_tendency(land)
127126
imp_tendency! = make_imp_tendency(land)

experiments/long_runs/soil.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ forcing = ClimaLand.prescribed_forcing_era5(
8484
max_wind_speed = 25.0,
8585
time_interpolation_method,
8686
)
87-
model = ClimaLand.Soil.EnergyHydrology(FT, domain, forcing, params)
87+
model = ClimaLand.Soil.EnergyHydrology{FT}(domain, forcing, params)
8888
diagnostics = ClimaLand.default_diagnostics(
8989
model,
9090
start_date;

experiments/standalone/Vegetation/no_vegetation.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ shared_params = SharedCanopyParameters{FT, typeof(earth_param_set)}(
5454
earth_param_set,
5555
);
5656

57-
soil_driver = PrescribedGroundConditions(
58-
FT;
57+
soil_driver = PrescribedGroundConditions{FT}(;
5958
α_PAR = FT(0.2),
6059
α_NIR = FT(0.4),
6160
ϵ = FT(0.99),

experiments/standalone/Vegetation/timestep_test.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ shared_params = SharedCanopyParameters{FT, typeof(earth_param_set)}(
9393
earth_param_set,
9494
);
9595

96-
soil_driver = PrescribedGroundConditions(
97-
FT;
96+
soil_driver = PrescribedGroundConditions{FT}(;
9897
α_PAR = FT(0.2),
9998
α_NIR = FT(0.4),
10099
ϵ = FT(0.99),

experiments/standalone/Vegetation/varying_lai.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ shared_params = SharedCanopyParameters{FT, typeof(earth_param_set)}(
5454
earth_param_set,
5555
);
5656

57-
soil_driver = PrescribedGroundConditions(
58-
FT;
57+
soil_driver = PrescribedGroundConditions{FT}(;
5958
α_PAR = FT(0.2),
6059
α_NIR = FT(0.4),
6160
ϵ = FT(0.99),

experiments/standalone/Vegetation/varying_lai_with_stem.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ shared_params = SharedCanopyParameters{FT, typeof(earth_param_set)}(
5454
earth_param_set,
5555
);
5656

57-
soil_driver = PrescribedGroundConditions(
58-
FT;
57+
soil_driver = PrescribedGroundConditions{FT}(;
5958
α_PAR = FT(0.2),
6059
α_NIR = FT(0.4),
6160
ϵ = FT(0.99),

src/integrated/land.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ end
186186
"""
187187
ClimaLand.land_components(land::LandModel)
188188
189-
Returns the components of the `LandModel`.
189+
Returns the components of the `LandModel`.
190190
191191
Currently, this method is required in order to preserve an ordering in how
192192
we update the component models' auxiliary states. The canopy update_aux! step
@@ -383,7 +383,7 @@ function lsm_radiant_energy_fluxes!(
383383
canopy_radiation::Canopy.AbstractRadiationModel{FT},
384384
Y,
385385
t,
386-
) where {(FT)}
386+
) where {FT}
387387
canopy = land.canopy
388388
canopy_bc = canopy.boundary_conditions
389389
radiation = canopy_bc.radiation
@@ -535,7 +535,7 @@ end
535535
compute_liquid_influx(p,
536536
model,
537537
prognostic_land_components::Val{(:canopy, :snow, :soil, :soilco2)},
538-
)
538+
)
539539
540540
Returns the liquid water volume flux at the surface of the soil; uses
541541
the same method as the soil+snow integrated model.

src/integrated/soil_canopy_model.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function lsm_radiant_energy_fluxes!(
292292
canopy_radiation::Canopy.AbstractRadiationModel{FT},
293293
Y,
294294
t,
295-
) where {(FT)}
295+
) where {FT}
296296
canopy = land.canopy
297297
earth_param_set = canopy.parameters.earth_param_set
298298
= LP.Stefan(earth_param_set)
@@ -450,7 +450,7 @@ end
450450
compute_liquid_influx(p,
451451
model,
452452
prognostic_land_components::Val{(:canopy, :soil, :soilco2)},
453-
)
453+
)
454454
455455
Returns the liquid water volume flux at the surface of the soil; in
456456
a model without snow as a prognostic variable, the influx is

0 commit comments

Comments
 (0)