Closed skylersagarese-NOAA closed 8 months ago
@skylersagarese-NOAA thanks for reporting this, and sorry to again ask for your model files/code (feel free to email me them when you submit an issue in the future if this is easier for you than waiting for me to ask!
It sounds like your fix would work for this model, but not generally for 2 area models, is that right? Would a more general solution be needed in that case?
I believe my fix would work for SEFSC models where we have more than one region and specify fleets as areas. But this fix will not work for other models if they have a fleet operating in 2 separate areas (is that even possible?)
@k-doering-NOAA - it works! thank you!
Thanks for finding and proposing the fix - it was really all you, just me duplicating your work!
When using a two-area model (with two fleets operating in each area), I'm getting an error in achieved_F within the update_OM function:
Error in
[<-.data.frame
(*tmp*
, i, "last_adjust", value = c(1.01732724909191, : replacement has 2 rows, data has 1This is occurring because achieved_F is giving two values (one per area), which is later producing two values for target_F:
achieved_F <- F_achieved[F_achieved[, "year"] == catch_intended[i, "year"] & F_achieved[, "seas"] == catch_intended[i, "seas"] & F_achieved[, "fleet"] == catch_intended[i, "fleet"], "F"]
achieved_F for fleet 1 [1] 0.012108 0 #Fleet 1 fishes in area 1 not area 2
achieved_F for fleet 2 [1] 0 0.01 #Fleet 2 fishes in area 2 not area 1
achieved_F for fleet 3 [1] 0.171941 0 #Fleet 3 fishes in area 1 not area 2
achieved_F for fleet 4 [1] 0 0.0385965 #Fleet 4 fishes in area 2 not area 1
For this model, F is positive in only one area, so my fix here is to sum these two values for achieved_F right below the achieved_F function given above. achieved_F<-sum(achieved_F) #F in one area is always zero