20 | | 2. {{{element_material_number_from_cloud()}}} |
| 20 | 2. {{{get_element_material_number_from_cloud()}}}[[BR]] |
| 21 | This subroutine should create an array of {{{nelem}}} x {{{nmat}}} (?), fill that array with the number of cloud particles of a given material for each element and assign the element material number based on some criteria. In general, the procedure would be |
| 22 | * Allocate an array that is {{{nelem}}} x {{{nmat}}} (or {{{nelem}}} x {{{nlsf}}}???); initialize to zero |
| 23 | * Loop through all cloud particles |
| 24 | * Find which element contains a given particle |
| 25 | * Increment the material number index for the element in the 2D array created above using the cloud particle material number |
| 26 | * After looping through all cloud particles, loop through all elements |
| 27 | * For a given element, check associated material number distribution list |
| 28 | * Look for index of max value |
| 29 | * Look for 'ties'. Do a count on the value at the index found above. If that number is >1, we have a tie. |
| 30 | * Based on the info above, make a decision on which material number should be used (Things to consider: Majority rule, how to handle ties, etc.) |
| 31 | * Call {{{make_matrix.f90}}} using the material number from the decision |