Hi! I am trying to learn how to implement a biological model in ROMS (not just using one of the predefined models), and I've understood that biological tracers play the part of state variables in such models. However, I would like to work with stage-distributed state variables, for instance a type of organism that develops through a number of stages. This could be implemented as a tracer with a fourth dimension, with my model code handling the transitions between stages, but I haven't yet seen any way of defining such a four dimensional tracer. If I wanted 10 stages I could define 10 different tracers (named stage1, stage2, ...), but this would be somewhat inconvenient both for coding and data processing (especially since the number of stages should be fairly easily tunable).
Am I thinking of this in the wrong way? Is there some way of defining a state variable with an additional dimension? I would appreciate suggestions or pointers to how to implement this type of model.
Stage distributed tracer
-
- Posts: 3
- Joined: Fri Feb 18, 2011 2:48 pm
- Location: SINTEF Fisheries and Aquaculture
Re: Stage distributed tracer
The bio models are all implemented using the tracer t array. It has five dimensions: three spatial, one time, and one tracer index. What you need to do is set the number of bio tracers (NBT) to the number of stages in your species, plus any other components it depends on. Look at one of the simpler NPZ models to see how the tracers are referred to - you set up an ID for each stage.
Start from a ROMS version recent enough to have a ROMS/Nonlinear/Biology directory and see what is done down there. If you follow along, ROMS will advect all your tracers for you. What you need to watch out for is creatures with additional behaviors. Do they swim up and down? Do they swim horizontally?
Start from a ROMS version recent enough to have a ROMS/Nonlinear/Biology directory and see what is done down there. If you follow along, ROMS will advect all your tracers for you. What you need to watch out for is creatures with additional behaviors. Do they swim up and down? Do they swim horizontally?
-
- Posts: 3
- Joined: Fri Feb 18, 2011 2:48 pm
- Location: SINTEF Fisheries and Aquaculture
Re: Stage distributed tracer
Thank you! That tells me I've understood correctly the use of tracers. But if I for instance reserve 10 indexes of the tracer matrix for my stages, will these have to be stored using 10 different variable names in the output NetCDF file, or is it possible to get them stored under a single name, with just an additional dimension (10) of numbers?
Re: Stage distributed tracer
Good question. What's done so far is having each be its own variable for purposes of I/O, but you could certainly do it the other way with the appropriate coding. You would need to change def_rst, wrt_rst, get_state, def_his, wrt_his, and so forth. I'm sure it would be easier to write a postprocessing script to read ROMS output and generate a file organized how you want it.
-
- Posts: 3
- Joined: Fri Feb 18, 2011 2:48 pm
- Location: SINTEF Fisheries and Aquaculture
Re: Stage distributed tracer
Thanks again! I understand. I'll find a way to do it either way, but it's nice to know I'm not missing some "built-in" way to do it.