Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grazing_function should be a string that is converted to int type #332

Open
mnlevy1981 opened this issue Mar 6, 2019 · 2 comments
Open
Assignees
Milestone

Comments

@mnlevy1981
Copy link
Collaborator

Currently, changing the grazing function for a particular grazer requires knowing that grazing_function = 1 refers to Michaelis-Menten and grazing_function = 2 refers to a sigmoidal function. Instead, users should specify a grazing function via a string (michaelis or sigmoidal) that is then converted to an integer to avoid string comparisons inside the computation stage. See treatment of caco3_bury_thres_opt in marbl_settings_mod.F90.

@mnlevy1981 mnlevy1981 self-assigned this Mar 6, 2019
@mnlevy1981 mnlevy1981 added this to the MARBL1.0.0 milestone Apr 18, 2019
@mangelesg
Copy link

Im trying to understand the MARBL code, but I have a couple of questions about the subroutine compute_grazing.

1- Why does the subroutine loop over the vertical level k? Could this subroutine be vectorized?

2- In the part of the code shown below, Im not sure if the loop is supposed to sum over the Pprime of all the three autotrophs groups. For example for prey =1 and predator =1, it has auto_ind_cnt =1 and auto_ind2 =1. So if I understand correctly, there is no sum over all the autotrophs but just the corresponding one to the prey?
!-----------------------------------------------------------------------
! compute sum of carbon in the grazee class, both autotrophs and zoop
!-----------------------------------------------------------------------
work1 = c0 ! biomass in prey class prey_ind
do auto_ind2 = 1, grazing_relationship_settings(prey_ind, pred_ind)%auto_ind_cnt
auto_ind = grazing_relationship_settings(prey_ind, pred_ind)%auto_ind(auto_ind2)
work1 = work1 + Pprime(auto_ind,k)
end do

I would appreciate any help in this matter

@mnlevy1981
Copy link
Collaborator Author

  1. We loop over k as part of the clean-up addressing migrate k loop inside of subroutines called from marbl_set_interior_forcing #53; we plan to investigate vectorization once MARBL v1.0.0 has been released (it is unclear if we will see much speed-up with vectorization in models that let the number of active levels vary from column to column)
  2. This is a confusing portion of the code that will be cleaned up when we address grazing type should be a subset of zooplankton type #320. auto_ind2 is looping over all autotrophs that are preyed upon by a given grazer, but the way the code is currently written that will typically correspond to a single autotroph (because of the prey_ind dimension of grazing_relationship_settings(prey_ind, pred_ind)). But the general idea is that pred_ind grazes on auto_ind_cnt different autotrophs in a manner determined by the parameters in the grazing relationship datatype, and auto_ind is the index of autotroph_settings for each different prey. work1 is used to determine graze_rate for the given predator-prey pair, and is the sum of Pprime at a given level across all the autotrophs being grazed in a given grazing relationship. Note that each "grazing relationship" is defined by a unique entry in grazing_relationship_settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants