r4atlantis / atlantisom

Atlantis operating model. Generates data sets from Atlantis scenarios.
https://r4atlantis.github.io/atlantisom
7 stars 6 forks source link

calc_Z survival at time step or year #25

Open kellijohnson-NOAA opened 8 years ago

kellijohnson-NOAA commented 8 years ago

@hodgsone and I are not sure if we should be calculating survival at every timestep or just for the year. the current example has output at somewhat random times and I have asked Bec for output in 73 day increments, such that there are five timesteps within a year. this should help alleviate some problems regarding matching the YOY file to the timesteps in the nums, but we still do not know the repercussions of calculating survival at timesteps rather than year. Currently 'calc_Z' does not align timesteps properly, but I think once we get that figured out we may have a complete function. @gavinfay thoughts?

kellijohnson-NOAA commented 8 years ago

calc_Z aligns timesteps correctly. @gavinfay can you check? Also I deal with negative survival, but then Z ends up being negative for a few timesteps of sharks, does this need to be dealt with?

gavinfay commented 8 years ago

calc_Z aligned timesteps correctly (as far as I could tell). Nice work. However, I managed to work out that the values in YOY.txt were the young of year waiting to recruit, rather than the number of new age 1's at that time step (most groups only spawn once per year so that was why there were repeated values 4-5 time steps). I was able to do a run with the NEUS model (now in new code base, blizzards are good for something) changing from 73 days to 365 days and lo and behold the numbers in YOY.txt didn't change. One could also tell that the recruits were only coming in some time steps thanks to the alignment of the numbers at age with the YOY time series - increases in N in a couple of time steps per year.

I adjusted calc_Z to make the recruits be the fraction of the YOY arriving during that time step, based on the input paramters on recruitment period, etc. Also required some additions to load_biolprm. This gives results that seem to be (largely) consistent with the changes in numbers at age. There are still some inconsistencies which I think may be due to the fact that we're averaging over time steps and the new recruits aren't having the full time step's worth of mortality or other such approximations. See what you think. Code is loopy - I'll try to comment it more and vectorize later this week if I get a chance. Thanks for all your work with this @kellijohnson and @hodgsone !