Coder Social home page Coder Social logo

particulator's Introduction

Particulator
Neil Banas, 2018


QUICK START

For a simple example of a script that identifies a ROMS run, sets up a particle
experiment, and then tracks the particles, see
examples/example_romsCascadia.m

For more detail on the setup options, see the list of defaults at the start of 
par_release.m, and
examples/example_JdF_verticalOptions.m
examples/example_JdF.m
for further examples.



HOW IT WORKS

par_integrate.m is the particle-tracking code itself. The algorithm consists of reading in one timestep ("frame") of model output at a time, with only two frames held in RAM, and advancing a vector of particles through a series of internal steps between those frames. This approach assumes that reading model output from disk is a slow step, and that it is hard to improve upon the efficiency of the vector operations in matlab.

Output is saved at the same interval as the model input files. Timestepping uses the midpoint method (so that each internal step involves two Euler steps): see takeStep() in par_integrate.m. On each step, particles advance to a new (x,y,z,t) position, and then velocities, tracers, etc. are interpolated at the new location. Various shortcuts are taken to prevent bad values with a minimum of fuss: for example, vertical positions are simply clipped to fall between sigma (z/H) between -1 and 0, as opposed to reflective surface and bottom b.c.'s. When a step is calculated to carry a particle onto land, we simply don't take the step--leave the particle where it is, advance time, and hope that at the next timestep the flow will have changed. (This behaviour can be changed with the "avoidLand" flag in par_release.m.) Some of these shortcuts have been better tested than others.

Note that there are options both to interpolate tracers at the exact (x,y,z) location of the particles, and also to save entire vertical profiles of tracers at the (x,y) locations of the particles. (This is useful when using particle tracks as a basis for the ensemble-Lagrangian NPZ model of Banas et al., JGR, 2016, or other kinds of "plan view" applications.)

modelRun.m is the interface between par_integrate.m and particular hydrodynamic model runs. See modelRun_romsCascadia.m for the details of how ROMS output files are read in and interpolated. To add support for a new model (or a new flavour of ROMS output), DON'T modify par_integrate.m or modelRun.m (if you can at all help it), but rather write a new case, similar to modelRun_romsCascadia.m.

Once a modelRun has been created (let's call it "run"), and a particular frame of model output has been loaded into memory with run.loadFrame(), what was loaded in can be accessed directly as run.F1, bypassing the interp() functions. (This can be useful for debugging.)

It will be a while before I write a proper manual, but please let me know what other questions I should answer in this readme!

particulator's People

Contributors

neilbanas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.