-
Notifications
You must be signed in to change notification settings - Fork 25
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
Bugfix/240 #263
Merged
Merged
Bugfix/240 #263
Conversation
This file contains 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
Several tendencies in marbl_ciso_mod.F90 are missing zoo_graze terms; the first step to add them in is to make them accessible in the module via the share type.
Previously, marbl_ciso_mod.F90 computed tendencies without considering the possibility that zooplankton could be grazed, so no zoo_graze_* terms were included. The mass balance check did not catch this (even in a test run where zoo grazes itself) because the way the mass balance checks are constructed the missing terms all canceled each other out. I did confirm that adding some zoo_graze terms (but not all of them) triggered the error when zoo grazed itself and had no effect when zoo was not grazed.
marbl_ciso_mod.F90 only wants the sum of zooplankton terms like zoo_loss and zoo_graze (sum over all zooplankton species). Instead of sending each individual loss / grazing term, marbl_mod.F90 now does the sum in marbl_export_zooplankton_shared_variables(). Also, marbl_ciso_mod.F90 does not need x_graze_zoo so that field is not included in the share type.
Instead of copying these into marbl_autotroph_share_type, just pass autotroph_secondary_species to marbl_ciso_set_interior_forcing().
Cleaned up more variables that were available to marbl_ciso_mod.F90 via autotroph_secondary_species but were still being copied to marbl_autotroph_share_type. At this point, the only use of the share type is to copy tracer_local terms and there is already a plan to pass tracer_local instead.
|
Part of some post-review code-cleanup - realized that the zooplankton_share_type and marbl_ciso_mod.F90 should be using zootot instead of zoo to signify this is a sum over zooplankton species. As a first pass, I changed zoo13Ctot and zoo14Ctot to zootot13C and zootot14C, respectively.
Since marbl_mod.F90 sums over all zooplankton when storing data in the zooplankton share type, those variables are now refered to as zootot: zoototC zootot_loss zootot_graze And so on. This is most pronounced in marbl_ciso_mod.F90, but also is apparent in the diagnostics module.
The changes to diagnostic names and metadata from the previous commit were not included in default_diagnostics.yaml, so GCMs were looking for CISO_zooC_d1[34]C instead of CISO_zoototC_d1[34]C
Expand autotroph_local_type to include carbon isotope elements, and then pass autotroph_local to marbl_ciso_set_interior() instead of copying data into the share type. Other related clean-ups: * marbl_autotroph_share_type is no longer needed * marbl_compute_autotroph_phyto_diatoms() does not need autotroph_local * marbl_ciso_mod.F90 no longer needs its own autotroph_local_type, so there is no longer a consistency check there (or a setup_autotroph_local, since that is taken care of in marbl_mod)
tracer_local is no longer restricted to the base tracers, it also contains carbon isotope tracers if ciso_on = .true. This fixes a bug in attempts to put carbon isotope fields in autotroph_local.
No need to compute this ratio for autotrophs that do not have CaCO3 tracer
Instead of copying some elements of tracer_local to interior_share and recomputing other elements in setup_local_column_tracers, just pass tracer_local (instead of tracers) to marbl_ciso_set_interior_forcing(). This means that some associate statements need to be updated to point to elements of tracer_local instead of marbl_interior_share_type (and some local variables are now associate statements instead of being computed in marbl_ciso_mod).
DO13Ctot_loc was inadvertently pointing to DO14Ctot_loc
* several "zooC" -> "total zooC" or "zoototC" in comments * R1[34]C_zooC -> R1[34]C_zoototC * autotroph consistency check has a single "if (ciso_on) then" block and checks for Ca1[34]CO3_ind instead of individual checks for all isotopic autotroph tracers * ciso_set_interior_forcing(): reordered arguments in interface so all intent(in)s are clumped together, followed by the (inout)s
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.
Added additional terms to
zooplankton_share_type
so thatmarbl_ciso_mod.F90
could includezoo_graze
terms when computing tracer tendencies. This fixes #240 in the "quick fix" sense, but @klindsay28 and I talked about how it makes sense for me to take a little extra time to clean up the way some of this data is passed frommarbl_mod.F90
tomarbl_ciso_mod.F90
. Namely:autotroph_share_type
is a direct copy ofautotroph_secondary_species_type
; why don't we pass that instead of doing unnecessary memory copies?marbl_ciso_mod.F90
is only concerned with the sum over all zooplankton species, so this summation should be done as part of buildingzooplankton_share_type
rather than done internal tomarbl_ciso_mod.F90
. That would be consistent with howDOCtot
is handled (summed inmarbl_mod.F90
, treated as a single quantity throughoutmarbl_ciso_mod.F90
)I'll add another comment when this is actually ready for review.