Feature/i38 rlink - #73
Open
erlasturl wants to merge 5 commits into
Open
Conversation
… from fisheries fleet but sel param for assessment fleet. Get_Length has a bug in wgt calc and used l-w param from assess file, using Ecology_Get_Size() instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Your commits explain the
who,what,whereandwhenof these changes. Your code shows thehow. You do not need to reiterate this. This PR should complete the big picture by telling thewhy.Justification
Makes the RAssess functions work for TAC and Effort allocation.
The main changes was done to Read_RAssess_output(). It can read in to format of files 1) TAC for each fishery 2) Effort allocation (box, season, fishery) based on effortmodel= 3. The code detects if there is TAC or Effort in the header of the file from R. It then reads the values into the appropriate arrays. The format of the files needed is given in a comment above the function in the code.
In order to allocate effort one needs to assess a species and put isTAC > 1 in the group csv file. This should then be done for a group which is not being assessed for TAC. The parameterization does not really make sense for effort allocation. We may want to add a parameter so instead of whichRAssess_XXX we would have RAssesseffortAllocation_YYY. Then I think we would need to call Do_RAssess (or just Run_RAssess() and Read_RAssess_output()) somewhere outside the loop Do_RAssess() is in. Maybe we would like to put it straight into RunNextTimeStep() after Manage_Calculate_Total_Effort() so it can be called before each season or monthly and the effort allocation for certain fleets updated.
Added new arrays to RAssessSurvey() to collect size index and fixed minor bugs. Using Ecology_Get_Size() instead of Get_Length() as there is a bug in Get_Length() when converting from mg N to g ww. Ecology_Get_Size() used the l-w parameters from the biology file but Get_Length() uses parameters from the assessment file.
In Populate_RAssessFile() I removed code that was not working. The array SizeCaught was only created but never used so only contained zeros. I made changes in Calculate_Catch() such that SizeCaught contains caught biomass which is used in Populate_RAssessFile() to calculate size in catch. This function now reads data into all columns that were initialized.
Types of changes
What types of changes does your code introduce? Put an
xin the boxes that applyFurther comments
If this is a New Feature, Breaking change, or a bug fix, the Atlantis Manual will need to be updated to reflect these changes.
Now would be a good time to create an issue in the Atlantis Manual repo and begin documenting your changes.
Reviewer instructions:
Assign at least 2 reviewers:
assigneesfieldPlease detail the process reviewers will need to follow to properly test these changes. It is especially helpful to identify the exact code needed to conduct a local build/review/test and to specify any aspects of the testing that may not be obvious.
I have written sections in the manual "Effort reallocation using R-link" in "Fishing Mortality" chapter and "Dynamic TAC using R-link" in "Management" that should help with the testing. Theses sections can be found on following branch
https://github.com/Atlantis-Ecosystem-Model/AtlantisManual/tree/docs/i32-rlink-documetation-new
In order to test this a model with assessment parameter file is needed and to test the effort allocation a fleet with effort model 3 is needed.