gadget-framework / gadget2

Gadget is the Globally applicable Area Disaggregated General Ecosystem Toolbox
GNU General Public License v2.0
18 stars 20 forks source link

Different naturalmortality in different years #23

Closed inspktrgadget closed 5 years ago

inspktrgadget commented 6 years ago

Does anyone know the correct syntax for specifying different values of natural mortality during different years and/or timesteps in Gadget? Or if it's even possible. I feel as though this should be capable by adding a "mortality file" to the stockfile as below, but am not quite sure about the syntax. The user guide only states that a vector of mortalities may be given:

Stockfile

stockname   zebrafish
livesonareas   1
...
maxlengthgroupgrowth    15
naturalmortality    mortfile
iseaten    0
...

mortfile

timedata    stockdata
2000         0.2
2001         0.2
...

Note that I came to the above file structure through trial and (gadget) error(s). When naturalmortality mortfile is specified, but say a vector of natural mortalities is given (a value for each age) then gadget spits an error that states Expected timedata or stockdata but found instead 0.2

vbartolino commented 6 years ago

You need to point to one timeVariable file for each age class. The timeVariable file should have the following structure:

mortalityAgeXX
data
;year   step    value
2000    1   ...
2000    2   ...
...
inspktrgadget commented 6 years ago

Thanks, Valerio.

I wonder is this something that should be added to the user guide?

vbartolino commented 6 years ago

Examples and graphics to visualise the functional forms of some of the processes represented in Gadget are certainly useful addition to the user guide, but in this specific case I do not think the guide needs much more explanation. Natural mortality for each age class is a parameter per se so if we want it to change in time every parameter has to be expressed as a separate timeVariable file.