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

O2.3.5 Enable global runs (on GPU) #398

Closed
7 tasks done
juliasloan25 opened this issue Nov 18, 2023 · 6 comments
Closed
7 tasks done

O2.3.5 Enable global runs (on GPU) #398

juliasloan25 opened this issue Nov 18, 2023 · 6 comments
Assignees
Labels
SDI Software Design Issue

Comments

@juliasloan25
Copy link
Member

juliasloan25 commented Nov 18, 2023

Is your feature request related to a problem? Please describe.
We want to be able to run ClimaLSM globally. To do this, there are a few structural changes we need to make first.

Main changes

  1. need global prescribed atmosphere
  2. forcings over the globe read in from files
  3. spatially-varying quantities over the globe

1. unified interface for site and global prescribed atmosphere types (see #451)

  • we have: a PrescribedAtmosphere type (src/shared_utilities/drivers.jl) which can be used at a point. This holds things like atmospheric CO2, wind speed, pressure, etc
  • we need: a way to extend this struct to run either at the site-level or globally
  • potential solution:
    • Interpolators module implementing unified interface for all cases (analytic drivers, site-level drivers from data, global drivers from data, (prescribed atmos driver?)). This will isolate the differences between each case to the back-end internals, and avoids the need for a new PrescribedAtmos type

2. forcings over the globe - store these in p and update via callback (see #370)

  • we have: forcings stored in PrescribedAtmosphere
  • we need: to move some forcings to p. When we update these, we'll dispatch off of the PrescrAtmos type, to read in fields over the sphere when running global and just evaluate a function when running at a column.
  • the reason for this change is that, in the global case, the forcings will be Fields over the sphere that we want to allocate for once and update over time, instead of allocating on-the-fly as we do with column simulations currently
  • potential solution:
    • add field p.forcings containing sw_in, lw_in, P, T, q, etc
    • add function update_forcings to update these values. This will dispatch off of PrescrAtmos type (as described above)
    • call update_forcings before update_aux and update_interactions to update in correct order

3. spatially-varying parameters read in over time globally (See #126)

  • we have: albedo as a first example (BulkAlbedoSpatial and BulkAlbedoTemporal types)
  • we need: analogous types for other quantities

4. Handle file IO

prescribed atmos/forcings/parameters infrastructure

  1. API GPU breaking change enhancement
  2. enhancement
    juliasloan25
  3. enhancement
    kmdeck

GPU compatibility + performance

  1. GPU SDI
    Sbozzolo
  2. enhancement
    Sbozzolo
  3. 8 of 9
    Sbozzolo

Add target run

  1. 4 of 4
    kmdeck
@juliasloan25 juliasloan25 added the enhancement New feature or request label Nov 18, 2023
@kmdeck
Copy link
Member

kmdeck commented Nov 20, 2023

Hi Julia,

thanks for putting this together. Some small comments/questions:

more major question

  • If we have ~10 fields changing in time, every hour, for 1 year, over ~ half the globe at 50kmx50km, we would have 1024365*(4pi6376^2/50^2)/2 = 9 billion numbers, or 0.5 TB of data if they are Float64. Our timestep might be at best ~10-30 minutes, so we dont have a clear separation between the timestep and how often we need to read in data. So both reading in all the data and storing it in advance and reading in once per hour of simulation time are both tricky. Before implementing, it might be good to make sure we understand what other land models do, and to run by @Sbozzolo

@kmdeck
Copy link
Member

kmdeck commented Nov 20, 2023

SLIM is a model quite like our bucket model which can be run in standalone or coupled: https://github.com/marysa/SimpleLand

@braghiere
Copy link
Member

Can we add info about the ocean mask here? I.e., a way to save time in calculations by avoiding running the land model over the oceans. The advantage of the land models in comparison to atmos or oceans is that we can run the model in single grid cells.

@juliasloan25
Copy link
Member Author

I asked @simonbyrne about this, and he said there isn't yet a plan to add this in to ClimaCore, and that implementing this will depend on what type of grid ClimaLSM uses going forward

@braghiere
Copy link
Member

What do you mean by type of grid? It is usually regular grids, i.e., 0.25deg, 0.50 deg, 1.0deg, 2.0deg, lats and lons have same shape and the globe is divided into squares.

@kmdeck
Copy link
Member

kmdeck commented Dec 13, 2023

many details point 2 can be found here #370 (SDI)

@juliasloan25 juliasloan25 added SDI Software Design Issue and removed enhancement New feature or request labels Jan 8, 2024
@kmdeck kmdeck self-assigned this Feb 5, 2024
@juliasloan25 juliasloan25 changed the title enable global runs O2.3.5 Enable global runs (on GPU) Apr 24, 2024
@juliasloan25 juliasloan25 added this to the O2.3.5 Global run on GPU milestone Apr 24, 2024
@kmdeck kmdeck mentioned this issue Jul 2, 2024
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDI Software Design Issue
Projects
None yet
Development

No branches or pull requests

4 participants