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

OceanSeaIceModel for coupled ocean-sea-ice simulations with prescribed atmospheric state and radiative fluxes #49

Merged
merged 195 commits into from
Apr 30, 2024

Conversation

glwagner
Copy link
Member

@glwagner glwagner commented Oct 5, 2023

This PR implements a new model type called OceanSeaIceModel, which provides a user interface for coupled ocean-sea-ice simulations with a prescribed atmospheric state and radiative fluxes.

cc @simone-silvestri

@glwagner
Copy link
Member Author

glwagner commented Oct 5, 2023

I also added an alias OceanOnlyModel for cases where isnothing(IceOceanModel.ice). This will facilitate regional simulations with no ice component.

@simone-silvestri
Copy link
Collaborator

I think we need to ensure consistency between models and forcings:

  1. make sure there is a salinity and a temperature tracer in the ocean model (let's think in another PR about how to extend it for no-salinity simulations)
  2. top boundary conditions for temperature/salinity are flux boundary conditions and that the forcing is defined on the same grid

@simone-silvestri
Copy link
Collaborator

Also, I'll start to implement compute_air_sea_fluxes! for OceanOnly then we need to enable 3-way interaction.
(atmosphere should talk to ocean where there is no ice and ice there thickness > 0).
So another thing to ensure is that the BC of ocean to atmosphere and ice to atmosphere are consistent

@simone-silvestri
Copy link
Collaborator

I just realized that the feedback of the ice in the ocean is instantaneous, i.e. there is no flux that acts as a boundary condition for the ocean because the change is actuated instantaneously.

It is kind of an "adjustment". Maybe we should change the name of the functions to reflect it, compute_flux! might be misleading.

@glwagner
Copy link
Member Author

I just realized that the feedback of the ice in the ocean is instantaneous, i.e. there is no flux that acts as a boundary condition for the ocean because the change is actuated instantaneously.

It is kind of an "adjustment". Maybe we should change the name of the functions to reflect it, compute_flux! might be misleading.

That is true, but the function does compute a flux which is passed into the ice model. Also, the "adjustment" is not mathematically distinguishable from a flux. In other words from the ocean perspective, there is an "implied flux". From the sea ice perspective, the flux is explicit.

The situation is also a little more nuanced. That function implements a particular parameterization for the "ocean-driven melting" case (eg the "ice bath" model) that is most simply implemented as adjustment and thus implicit flux. However we want generalize it to other parameterizations which do involve explicit fluxes. So it will compute fluxes in the future...

Let's discuss, this is a huge effort and so the code will be in a state of change for some time. We do need to flesh out the scaffolding though.

@glwagner
Copy link
Member Author

I think we need to ensure consistency between models and forcings:

  1. make sure there is a salinity and a temperature tracer in the ocean model (let's think in another PR about how to extend it for no-salinity simulations)
  2. top boundary conditions for temperature/salinity are flux boundary conditions and that the forcing is defined on the same grid

Yes I think for the time being we should simply assume that the model has both temperature and salinity. Certainly, there is a place for idealized simulations with only one of the two, but I think it would be better to generalize later rather than build in the complexity now.

@glwagner glwagner changed the title IceOceanModel for coupled ocean-sea-ice simulations with prescribed atmospheric state and radiative fluxes OceanSeaIceModel for coupled ocean-sea-ice simulations with prescribed atmospheric state and radiative fluxes Oct 11, 2023
@glwagner
Copy link
Member Author

Should we reuse getbc rather than defining a new getflux?

@navidcy
Copy link
Collaborator

navidcy commented Apr 11, 2024

When on_native_grid = true, totally_in_memory = false, and backend = OnDisk() nothing is returned

@simone-silvestri
Copy link
Collaborator

if the backend is OnDisk then totally_in_memory = false and the returning atmosphere is still

    user_fts = FieldTimeSeries(jld2_filename, fts_name; architecture, backend, time_indexing)
    return user_fts

@navidcy
Copy link
Collaborator

navidcy commented Apr 11, 2024

if the backend is OnDisk then totally_in_memory = false and the returning atmosphere is still

    user_fts = FieldTimeSeries(jld2_filename, fts_name; architecture, backend, time_indexing)
    return user_fts

OK, then perhaps the logic is OK but there must be a bug because in this case

on_disk_fts = FieldTimeSeries{LX, LY, Nothing}(fts.grid;

breaks because

JRA55 and data wrangling utilities: Error During Test at /Users/navid/Research/ClimaOcean-v3.jl/test/test_jra55.jl:3
  Got exception outside of a @test
  UndefVarError: `fts` not defined
  Stacktrace:
    [1] JRA55_field_time_series(variable_name::Symbol; architecture::CPU, grid::Nothing, location::Nothing, url::Nothing, filename::Nothing, shortname::Nothing, latitude::Nothing, longitude::Nothing, backend::OnDisk, time_indexing::Oceananigans.OutputReaders.Cyclical{Nothing}, preprocess_chunk_size::Int64, preprocess_architecture::CPU, time_indices::UnitRange{Int64})
...

Should fts.grid in that line be replaced with JRA55_native_grid?

@simone-silvestri
Copy link
Collaborator

I think this might be ready to merge when tests pass

@navidcy
Copy link
Collaborator

navidcy commented Apr 24, 2024

Great thanks for that!
I'll try to fix things if there are still pending issues

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 956 lines in your changes are missing coverage. Please review.

Project coverage is 0.00%. Comparing base (edee002) to head (1179247).

Files Patch % Lines
src/DataWrangling/JRA55.jl 0.00% 201 Missing ⚠️
...s/CrossRealmFluxes/ocean_sea_ice_surface_fluxes.jl 0.00% 182 Missing ⚠️
...sRealmFluxes/similarity_theory_turbulent_fluxes.jl 0.00% 180 Missing ⚠️
src/OceanSeaIceModels/PrescribedAtmospheres.jl 0.00% 86 Missing ⚠️
src/quarter_degree_global_simulation.jl 0.00% 80 Missing ⚠️
...IceModels/CrossRealmFluxes/sea_ice_ocean_fluxes.jl 0.00% 66 Missing ⚠️
...nSeaIceModels/CrossRealmFluxes/CrossRealmFluxes.jl 0.00% 31 Missing ⚠️
src/OceanSeaIceModels/ocean_sea_ice_model.jl 0.00% 31 Missing ⚠️
src/OceanSimulations/OceanSimulations.jl 0.00% 26 Missing ⚠️
...OceanSeaIceModels/time_step_ocean_sea_ice_model.jl 0.00% 25 Missing ⚠️
... and 5 more
Additional details and impacted files
@@          Coverage Diff           @@
##            main     #49    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files         10      23    +13     
  Lines        428    1335   +907     
======================================
- Misses       428    1335   +907     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@simone-silvestri simone-silvestri merged commit 89a549d into main Apr 30, 2024
9 checks passed
@glwagner
Copy link
Member Author

This PR makes progress towards #28

@glwagner glwagner deleted the glw-ss/ice-ocean-model branch June 25, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants