Leeds-MONC / monc

MONC (Leeds fork)
BSD 3-Clause "New" or "Revised" License
5 stars 18 forks source link

Implementing space and time interpolation for HIGHTUNE-based forcing #27

Open leifdenby opened 4 years ago

leifdenby commented 4 years ago

Question from @stevenleeds on Teams (27/10/2020):

There are 3 strategies here: 1) Read the forcings from NetCDF every time step, this seems inefficient though. 2) Keep the forcings for the entire run in memory, at their original height levels. Interpolate in vertical every time-step. 3) Interpolate to the right vertical levels on initialisation. Do you have a preference in this regard. I am tempted to go with 2 or 3, this only becomes an issue for long (supersite) cases in terms of reducing memory usage (the full forcings are stored in memory on every node). However, we can deal with this later if it should ever become a limitation, and is the easiest way to get something working quickly.

Related to #26

leifdenby commented 4 years ago

I would go with 2) or 3) as well. You're planning on doing piece-wise linear interpolation in space and time, right? In that case it might be simplest to do 3) that way you only need the 1D piecewise linear interpolation which MONC already has an implementation of: http://homepages.see.leeds.ac.uk/~earlcd/MONC/doc/releases/vn0.8/namespaceinterpolation__mod.html, then you could first interpolation onto height levels on initiation and then interpolate in time during runtime.

Also, MONC doesn't have any form of dynamic grid functionality (I don't think?) so there's no risk of the grid-levels changing over time, so it seems sensible to have the call that requests forcing information only provide the time, e.g. something like

pure function get_forcing(state_variable, time)

Maybe we should hash out together what the functions/subroutines will be called? Could make it easier to work out how to structure this.

sjboeing commented 4 years ago

Sounds good. I will continue working on this simply using arrays for now. We can do the linear interpolation to get something working now, though ideally we would again use Steffen interpolation in hte longer run (although if the forcing files are high resolution it is not so important).

sjboeing commented 3 years ago

First work on this, using strategy #3, is under #34.