Weird recruitiment issue

83 views
Skip to first unread message

Robert Gamble - NOAA Federal

unread,
Mar 12, 2020, 2:04:45 PM3/12/20
to Atlantis ecosystem model
So, I was trying to figure out what a number of our species have in common in our model.  These species all stop recruiting Age 0's and show drops after 2 days for the juvenile stages.  And they have very little in common life history wise.

I looked at the log files and noticed the following for the sections that show Spawn Day, Age Day, Start Day and End Day.

All species we're having issues with have a Spawn Day after the Age, Start and End Days.  The Age Day appears to be the Spawn Day + Recruit Time flags (at least for the species with no issues).  The Start Day is 1 day later.  The End Day appears to be Spawn Day + Recruit Time + Recruit Period.

The species with issues have an Age, Start and End Day less than the Spawn Day.  Also, the Age Day always starts at Day 1 even if Spawn Day + Recruit Time is less than 365.  What seems to be happening here is that if Spawn Day + Recruit Time + Recruit Period > 365, it automatically sets the Age Day = 1 and Start Day = 2.  It still appears to calculate End Day correctly. 

So, Herring's spawn day is 290.  Recruit Time is 30.  Recruit Period is 60.  The Age, Start and End Days are 1, 2, 15 respectively.  The End Day is correct but the other two aren't.

The other 'problem species' have similar numbers.  All the other species have a spawn day that's less than the other numbers.

Example: Mackerel
Spawn Day = 210, Recruit Time = 30, Recruit Period = 60.  Age Day = 239, Start Day = 240, End Day = 300 (All as should be)

I can fudge this for now, by shifting the spawn date for the problem species, but just figured I'd let people know about this if you're getting an odd issue for your recruitment (it should be noted that we're currently using constant recruitment mode 1).

Fulton, Beth (O&A, Hobart)

unread,
Mar 12, 2020, 6:19:47 PM3/12/20
to Robert Gamble - NOAA Federal, Atlantis ecosystem model

G’day Rob

 

I am working on this its because we changed how we set up the recruitment calendar and it sounds like the synch is out of step. I am testing a fix working with Isaac’s model but will get a patch out as soon as possible

 

Thanks for the info, it all helps

 

Beth

--
You received this message because you are subscribed to the Google Groups "Atlantis ecosystem model" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlantis-ecosystem...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/atlantis-ecosystem-model/CAM8_J-Ufv%3D6QXL3rCQdYPMyWvm6ckmRBvEWLzQwSvGZqs0VTKw%40mail.gmail.com.

Mariska Weijerman - NOAA Federal

unread,
Mar 20, 2020, 7:56:35 PM3/20/20
to Fulton, Beth (O&A, Hobart), Robert Gamble - NOAA Federal, Atlantis ecosystem model
Hi Rob,

In my case even weirder - Atalntis was running fine but crashed bc of a nutrient flux problem, so I changed the mum_PL and then  Atlantis quits on time=0, telling me that the first spawning date for my monk seals makes no sense. So I reversed the changes, tried running it agian but now I keep getting the same message.

Since the Spawnday was < age, start & endday I changed that to be bigger:
Spawnday = 200; age day = 34, Start day =35 and endday =95 vertembryo = 6
 so good
but then
spawnday =565; age day 399. Start day 400 and endday 460 vertembryo = 0
and crash with same message.

Until Beth has figured it out, how did you fudge it?

Thanks
Mariska



--
Dr Mariska Weijerman
Ecosystem Modeler



NOAA IRC
Attn: NMFS/PIFSC/ESD/Mariska Weijerman
1845 Wasp Boulevard, Building 176
Mail Rm 2247
Honolulu, HI 96818

Robert Gamble - NOAA Federal

unread,
Mar 20, 2020, 8:23:07 PM3/20/20
to Mariska Weijerman - NOAA Federal, Fulton, Beth (O&A, Hobart), Atlantis ecosystem model
I basically moved all species' spawn day early enough in the year to avoid the issue.  Ecologically it's not great, but for the most part I'm not sure how much of an effect it has on our system - it didn't seem to have that much.  I added up the numbers and made sure the total was less than 365.

Mariska Weijerman - NOAA Federal

unread,
Mar 20, 2020, 8:47:30 PM3/20/20
to Robert Gamble - NOAA Federal, Beth Fulton, Atlantis ecosystem model
I seem to have a different issue and it is particularly weird that it was running fine and only after changing an unrelated param (which I had been doing the entire morning) it suddenly decided to stop working. Atlantis does seem to have a mind of its own and doesn't seem to like me very much :-(

Atlantis crashed if my spawnday < start day etc and it crashed when it is > start day etc with the same message :-(

MS-7 SpawnDay: 90 AgeDay: 289 StartDay: 290 EndDay: 300  VERTembryo-0 0.000000e+000
First spawning date for MS (90) makes no sense

MS-7 SpawnDay: 200 AgeDay: 34 StartDay: 35 EndDay: 45  VERTembryo-0 6.126847e+000
First spawning date for MS (200) makes no sense

Fulton, Beth (O&A, Hobart)

unread,
Mar 21, 2020, 6:16:03 AM3/21/20
to Mariska Weijerman - NOAA Federal, Robert Gamble - NOAA Federal, Atlantis ecosystem model

G’day

 

That sounds more like a memory bug.

 

When these kind of error messages come up do a quick find in the code and see what the test actually is. In this case

 

    if ((EMBRYO[sp].next_spawn_any_age < 0) || (EMBRYO[sp].next_spawn_any_age > ((365.0 * bm->tstop) / 86400.0)))

        quit("First spawning date for %s (%d) makes no sense\n", FunctGroupArray[sp].groupCode, EMBRYO[sp].next_spawn_any_age);

 

The fact that you answer is coming back as 90 or 200 indicates its likely memory as both 90 and 200  shouldn’t satisfy this criteria without a really weird tstop.

 

I’ll expand the message to see what that is too. Once I’ve gotten through sorting Isaac and Rob’s weirdness I’ll do you and Ceclie in parallel. In reality I am hoping sorting Isaac and Rob will significantly help (or even automatically solve it for everyone else, but I have hoped that before!!!)

 

Beth

https://lh4.googleusercontent.com/9RwDWb-i3b4QLgYRxutP0-Wew1JF6iU62GkWDhdeFvyAnM6bekMEyMbVM2VQ3fn6-xAPu0Mmk0WsDFV5xLvqUkcEWpTloYltbeKJWVIbMLjf3xToX4E3K4JsTl_Gw9nl

 

NOAA IRC

Attn: NMFS/PIFSC/ESD/Mariska Weijerman

1845 Wasp Boulevard, Building 176

Mail Rm 2247

Honolulu, HI 96818


 

--

Dr Mariska Weijerman

Ecosystem Modeler

 

https://lh4.googleusercontent.com/9RwDWb-i3b4QLgYRxutP0-Wew1JF6iU62GkWDhdeFvyAnM6bekMEyMbVM2VQ3fn6-xAPu0Mmk0WsDFV5xLvqUkcEWpTloYltbeKJWVIbMLjf3xToX4E3K4JsTl_Gw9nl

matteo.sinerchia

unread,
Nov 20, 2024, 5:35:45 AM11/20/24
to Atlantis ecosystem model
Hi,

I migrated an old version of  model to unix (version 6718m). After the format conversion with flip and so on, the model was running but a lot of text was written to the log.txt. So I removed a print statement in the code, recompiled and started to get the same error Mariska described:

First spawning date for ENG (60) makes no sense - note testing against 0 and 1.541956e+00 as tstop is : 3.650000e+02

The part of code is the one Beth identified:

if ((EMBRYO[sp].next_spawn_any_age < 0) || (EMBRYO[sp].next_spawn_any_age > ((365.0 * bm->tstop) / 86400.0)))

        quit("First spawning date for %s (%d) makes no sense\n", FunctGroupArray[sp].groupCode, EMBRYO[sp].next_spawn_any_age);

Did you manage to solve this particular issue?

Cheers,
Matteo.

jaco...@gmail.com

unread,
Nov 20, 2024, 9:13:15 AM11/20/24
to Atlantis ecosystem model
Is this a migratory species that starts outside the model?

matteo.sinerchia

unread,
Nov 20, 2024, 11:02:20 AM11/20/24
to Atlantis ecosystem model
Hi Jacob, no. 

jaco...@gmail.com

unread,
Nov 21, 2024, 5:02:32 AM11/21/24
to Atlantis ecosystem model
What day of the year does that  functional group  spawn? Have you tried turning that functional group off and running the model?

matteo.sinerchia

unread,
Nov 26, 2024, 8:38:57 AM11/26/24
to Atlantis ecosystem model

Hi Jacob,


the ENG_Spawn_Time was set to 60 and I got this error:

First spawning date for ENG (60) makes no sense - note testing against 0 and 1.541956e+00 as tstop is : 3.650000e+02


I have tried switching off the ENG, anchovy, group that is the first group in the fg list .csv, but I get the same error for the second group in the list SAR, sardine.

Interestingly changing the SAR_Spawn_Time (0,1,2,3,10,20,150) I get different numbers in brackets, which corrsponds to the variable EMBRYO[sp].next_spawn_any_age:


SAR_Time_Spawn 0: First spawning date for SAR (2) makes no sense - note testing against 0 and 1.541956e+00 as tstop is : 3.650000e+02


SAR_Time_Spawn 1: First spawning date for SAR (2) makes no sense - note testing against 0 and 1.541956e+00 as tstop is : 3.650000e+02


SAR_Time_Spawn 2: First spawning date for SAR (2) makes no sense - note testing against 0 and 1.541956e+00 as tstop is : 3.650000e+02


SAR_Time_Spawn 3: First spawning date for SAR (3) makes no sense - note testing against 0 and 1.541956e+00 as tstop is : 3.650000e+02


SAR_Time_Spawn 10: First spawning date for SAR (10) makes no sense - note testing against 0 and 1.541956e+00 as tstop is : 3.650000e+02


SAR_Time_Spawn 20: First spawning date for SAR (20) makes no sense - note testing against 0 and 1.541956e+00 as tstop is : 3.650000e+02


SAR_Time_Spawn 150: First spawning date for SAR (150) makes no sense - note testing against 0 and 1.541956e+00 as tstop is : 3.650000e+02


With SAR_Time_Spawn = 0,1,2 the EMBRYO[sp].next_spawn_any_age is 2.

With SAR_Time_Spawn = 3,10, 20,150 EMBRYO[sp].next_spawn_any_age changes to the value of SAR_Time_Spawn (3,10,20,150).


I am trying to get my round the if statement logic:

if ((EMBRYO[sp].next_spawn_any_age < 0) || (EMBRYO[sp].next_spawn_any_age > ((365.0 * bm->tstop) / 86400.0)))




I have also check for memory bugs using valgrind and this is the final part of the output:

==177643== 8,192 bytes in 1 blocks are still reachable in loss record 289 of 289

==177643==    at 0x4846828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)

==177643==    by 0x18F939: hash_create (in /usr/bin/bash)

==177643==    by 0x162274: initialize_shell_variables (in /usr/bin/bash)

==177643==    by 0x13E67A: ??? (in /usr/bin/bash)

==177643==    by 0x13B26D: main (in /usr/bin/bash)

==177643==

==177643== LEAK SUMMARY:

==177643==    definitely lost: 0 bytes in 0 blocks

==177643==    indirectly lost: 0 bytes in 0 blocks

==177643==      possibly lost: 0 bytes in 0 blocks

==177643==    still reachable: 63,864 bytes in 645 blocks

==177643==         suppressed: 0 bytes in 0 blocks

==177643==

==177643== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


As far as I can tell from the output, there shoud not be any memory leakage.

Thanks a lot for your help,
Matteo.

jaco...@gmail.com

unread,
Nov 26, 2024, 8:41:42 AM11/26/24
to Atlantis ecosystem model
I do not know what is going on, but can try to help. What was the previous model base and what OS was that running on?

Fulton, Beth (Environment, Hobart)

unread,
Nov 26, 2024, 5:26:15 PM11/26/24
to Atlantis ecosystem model

G’day

 

Ok finally wading my way through more email than should be humanely allowed. Starting at the beginning an unpacking

 

  1. Mariska original question, so a quick rehash on how reproduction works (assuming you have random stuff turned off)

Spawn_Now = calendar day as noted in the prm file

Startday =  Spawn_Now + Recruit_Time

EndDay = StartDay + RecruitPeriod

Age_Now = Startday -1

If things wrap over the end of a year (day 365 in the calendar) then it has to account for that by taking 365 away from the relevant times and noting “wraps = 1”

It then creates a diary of when the group will spawn, age and settle every year of the model. If it is a “wrapping” species or if it is one with a long recruit_time so there has to be larvae coming from a spawning prior to model start it needs to have these ready to go too.

The very original version of Atlantis didn’t have the big long queue of babies coming and tried to handle wrapping as it went year to year but some of the crazy life histories out there forced a rewrite.

The biggest issues occur around

  1. How the number of larvae in the water at the start of the model are calculated vs how its done once the model is running. I use a pretty simple form of the form and it can show strong differences to the more dynamic values, especially if your adult fish change size a lot from the initial conditions
  2. There is external migration in the mix
  3. You try and do things on day 365 or 1 or you have animals spawning on the same day they age, settle or migrate. I have tried to deal with this by shuffling dates a day or two when first setting up the calendar

 

  1. Memory leak sorted (we think)

There was also a memory leak back in the trunk version of 2020, but that has been trapped and fixed. Any weird shit “change parameter” and it crashes stuff will be due to a memory leak or overwrite. They are a freakin sod to find as memory is done differently windws to mac to unix so being able to reproduce them is very hard. Nevertheless I do think that issue is sorted now, but let me know if its still tripping you up and the hunt can begin again.

 

  1. Matteo ENG issue

So now back to Matteo. The test tripping this up is

if ((EMBRYO[sp].next_spawn_any_age < 0) || (EMBRYO[sp].next_spawn_any_age > ((365.0 * bm->tstop) / 86400.0)))

        quit("First spawning date for %s (%d) makes no sense - note testing against 0 and %e as tstop is : %e\n", FunctGroupArray[sp].groupCode, EMBRYO[sp].next_spawn_any_age, ((365.0 * bm->tstop) / 86400.0), bm->tstop);

So what was your tstop from the run.prm? At present the code thinks for your model its 365 seconds (thus a day of 60 puts the first spawn after the end of the model which makes no sense).

 

Cheers

Beth

 

matteo.sinerchia

unread,
Nov 27, 2024, 6:08:05 AM11/27/24
to Atlantis ecosystem model
Hi,

thanks a lot Beth for answering and for the recap.
I am a bit confused with what is happening. 
The model I am running is a version of the Strait of Sicily in which I included an additional temperature response (get_TCorr() in atq10.c) from lab experiments, the stuff I presented at the last Summit.
Simulations were originally 120 years long and tstop was 43800 days.
That was run on Windows with version 6464 of the model.
I have now moved to Unix with the latest version of the code. 
In order to reuse that model I included all the new parameters required and flip -uv * all files.
Apart for the huge log.txt the model was running.
Since I commented out a printf, it started to give errors.

I set it to 1 year with tstop 365 to reduce the output.
tstop is still expressed as days from the start of the simulation, right?
So why would the model think that 365 is in seconds?

I have tried to set back tstop to 43800 (120 years), and I got another error not related to spawning but aging of seabirds:

First aging date for SB (201) makes no sense - note testing against 0 and 1.850347e+02 as tstop is : 4.380000e+04.
Cheers,
Matteo.

Fulton, Beth (Environment, Hobart)

unread,
Nov 27, 2024, 6:34:51 AM11/27/24
to Atlantis ecosystem model

G’day Matteo,

 

Sounds like there might be some bracket alignment issues going on. Any possibility you can put your files somewhere I can access so we can try to run it under a stable version of the code to try to figure out what’s up?

 

Beth

 

From: <atlantis-eco...@googlegroups.com> on behalf of "matteo.sinerchia" <cnrfis...@gmail.com>


Date: Wednesday 27 November 2024 at 10:08 pm
To: Atlantis ecosystem model <atlantis-eco...@googlegroups.com>

Subject: Re: Weird recruitiment issue

 

You don't often get email from cnrfis...@gmail.com. Learn why this is important

--

You received this message because you are subscribed to the Google Groups "Atlantis ecosystem model" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlantis-ecosystem...@googlegroups.com.

matteo.sinerchia

unread,
Nov 27, 2024, 10:07:19 AM11/27/24
to Atlantis ecosystem model
Hi Beth,

thanks a lot. I have sent you the credentials to access my unix machine.
Cheers,
Matteo.

Reply all
Reply to author
Forward
0 new messages