Skip to content

Commit 979e344

Browse files
authored
Backward compatibility wrappers (#296)
1 parent 02a6cd9 commit 979e344

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

docs/src/API.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,24 @@ Thermodynamics.DataCollection
152152

153153
These functions are deprecated and will be removed in a future release.
154154

155+
### Backward Compatibility Wrappers
156+
157+
These wrappers exist for backward compatibility with older versions of the package.
158+
159+
```@docs
160+
specific_enthalpy
161+
specific_enthalpy_dry
162+
specific_enthalpy_vapor
163+
specific_enthalpy_liquid
164+
specific_enthalpy_ice
165+
dry_pottemp
166+
total_specific_enthalpy
167+
q_vap_saturation_generic
168+
latent_heat_liq_ice
169+
```
170+
171+
### Other Deprecated Functions
172+
155173
```@docs
156174
air_temperature_given_hq
157175
air_temperature_given_pρq

src/depr_state_methods.jl

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ export ice_specific_humidity
77
export mixing_ratios
88
export saturated
99

10+
# Backward compatibility exports
11+
export specific_enthalpy
12+
export specific_enthalpy_dry
13+
export specific_enthalpy_vapor
14+
export specific_enthalpy_liquid
15+
export specific_enthalpy_ice
16+
export dry_pottemp
17+
export total_specific_enthalpy
18+
export q_vap_saturation_generic
19+
export latent_heat_liq_ice
20+
1021
"""
1122
gas_constant_air(param_set, ts::ThermodynamicState)
1223
@@ -656,3 +667,78 @@ Create a PhasePartition for non-equilibrium thermodynamic state.
656667
q_vap_sat = vapor_specific_humidity(param_set, ts)
657668
return ∂q_vap_sat_∂T(param_set, λ, T, q_vap_sat)
658669
end
670+
671+
#####
672+
##### Backward compatibility wrappers
673+
#####
674+
# These wrappers map deprecated function names to their new equivalents
675+
# to ensure backward compatibility with ClimaAtmos, ClimaLand, and ClimaCoupler.
676+
677+
# specific_enthalpy_* → enthalpy_*
678+
"""
679+
specific_enthalpy(args...)
680+
681+
Deprecated: Use [`enthalpy`](@ref) instead.
682+
"""
683+
@inline specific_enthalpy(args...; kwargs...) = enthalpy(args...; kwargs...)
684+
685+
"""
686+
specific_enthalpy_dry(args...)
687+
688+
Deprecated: Use [`enthalpy_dry`](@ref) instead.
689+
"""
690+
@inline specific_enthalpy_dry(args...; kwargs...) = enthalpy_dry(args...; kwargs...)
691+
692+
"""
693+
specific_enthalpy_vapor(args...)
694+
695+
Deprecated: Use [`enthalpy_vapor`](@ref) instead.
696+
"""
697+
@inline specific_enthalpy_vapor(args...; kwargs...) = enthalpy_vapor(args...; kwargs...)
698+
699+
"""
700+
specific_enthalpy_liquid(args...)
701+
702+
Deprecated: Use [`enthalpy_liquid`](@ref) instead.
703+
"""
704+
@inline specific_enthalpy_liquid(args...; kwargs...) = enthalpy_liquid(args...; kwargs...)
705+
706+
"""
707+
specific_enthalpy_ice(args...)
708+
709+
Deprecated: Use [`enthalpy_ice`](@ref) instead.
710+
"""
711+
@inline specific_enthalpy_ice(args...; kwargs...) = enthalpy_ice(args...; kwargs...)
712+
713+
# dry_pottemp → potential_temperature
714+
"""
715+
dry_pottemp(args...)
716+
717+
Deprecated: Use [`potential_temperature`](@ref) instead.
718+
"""
719+
@inline dry_pottemp(args...; kwargs...) = potential_temperature(args...; kwargs...)
720+
721+
# total_specific_enthalpy → total_enthalpy
722+
"""
723+
total_specific_enthalpy(args...)
724+
725+
Deprecated: Use [`total_enthalpy`](@ref) instead.
726+
"""
727+
@inline total_specific_enthalpy(args...; kwargs...) = total_enthalpy(args...; kwargs...)
728+
729+
# q_vap_saturation_generic → q_vap_saturation
730+
"""
731+
q_vap_saturation_generic(args...)
732+
733+
Deprecated: Use [`q_vap_saturation`](@ref) instead.
734+
"""
735+
@inline q_vap_saturation_generic(args...; kwargs...) = q_vap_saturation(args...; kwargs...)
736+
737+
# latent_heat_liq_ice → humidity_weighted_latent_heat
738+
"""
739+
latent_heat_liq_ice(args...)
740+
741+
Deprecated: Use [`humidity_weighted_latent_heat`](@ref) instead.
742+
"""
743+
@inline latent_heat_liq_ice(args...; kwargs...) =
744+
humidity_weighted_latent_heat(args...; kwargs...)

0 commit comments

Comments
 (0)