Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up model component compatibility tests #486

Closed
LenkaNovak opened this issue Nov 1, 2023 · 2 comments
Closed

Set up model component compatibility tests #486

LenkaNovak opened this issue Nov 1, 2023 · 2 comments

Comments

@LenkaNovak
Copy link
Collaborator

LenkaNovak commented Nov 1, 2023

For better CI, we want to set up unit tests in the dependent component model repos that exercise our adapter functions that are required by Interfacer and FluxCalculator, ConservationChecker, and Checkpointer. For now, these test will live in ClimaCoupler, but they should be independent of the coupler source code and able to be moved into component model repos. Namely, we want tests for the following methods:

Atmosphere requirements

get_field(atmos_sim::ClimaAtmosSimulation, ::Val{:field})
where field is in (:radiative_energy_flux, :liquid_precipitation, :snow_precipitation, :turbulent_energy_flux, :turbulent_moisture_flux,
:thermo_state_int, :height_int, :height_sfc, :uv_int, :air_density, :air_temperature, :cv_m, :gas_constant_air, :F_radiative_TOA, :energy, :water)
get_thermo_params(sim::AtmosModelSimulation) # this is required by the FluxCalculator, and should be generalized
get_surface_params(sim::AtmosModelSimulation) # this is required by the FluxCalculator, and should be extracted using SF.jl directly
update_field!(atmos_sim::ClimaAtmosSimulation, ::Val{:field}, field)
(:co2_gm, :surface_temperature, :albedo, :turbulent_fluxes)
step!(sim::AtmosModelSimulation, t)
reinit!(sim::AtmosModelSimulation)
atmos_turbulent_fluxes!(atmos_sim::ClimaAtmosSimulation, csf) # if using the CombinedStateFluxes (i.e. atmos functions to calculate turbulent fluxes)
get_model_state_vector(sim::ClimaAtmosSimulation) # required by Checkpointer

2. Surface model requirements

get_field(atmos_sim::ClimaAtmosSimulation, ::Val{:field})
(:surface_temperature, :surface_humidity, :roughness_momentum, :roughness_buoyancy, :beta, :albedo, :area_fraction, :air_density, :energy, :water)
update_field!(atmos_sim::ClimaAtmosSimulation, ::Val{:field}, field)
(:turbulent_energy_flux, :turbulent_moisture_flux, :radiative_energy_flux, :liquid_precipitation, :snow_precipitation, :air_density)
step!(sim::SurfaceModelSimulation, t)
reinit!(sim::SurfaceModelSimulation)
update_turbulent_fluxes_point!(sim::SurfaceModelSimulation, fields::NamedTuple, colidx::Fields.ColumnIndex) # if using PartitionedStateFluxes
get_model_state_vector(sim::SurfaceModelSimulation) # required by Checkpointer

Components

  • wait for the surface flux interface revamp
  • rename coupler field names to reflect units (unit checker will be considered at a later stage)
  • ensure that these tests all exist and are independent of coupler src code
@juliasloan25
Copy link
Member

@LenkaNovak the description here says we want to add these tests in the component models' individual repos, but all the things we would be testing are inside ClimaCoupler (ClimaAtmosSimulation, get_field, get_thermo_params, etc). Would it make more sense to add the tests in ClimaCoupler?

@juliasloan25
Copy link
Member

Following #644, we output warnings/errors if the functions we require aren't implemented. That fills the same role that the tests described in this issue would, so we can close this issue without implementing anything new

@juliasloan25 juliasloan25 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants