-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add suspended sediment concentration tracer #858
Add suspended sediment concentration tracer #858
Conversation
</nml_record> | ||
<nml_record name="init_vertical_grid" mode="init"> | ||
<nml_option name="config_init_vertical_grid_type" type="character" default_value="z-star" units="unitless" | ||
description="Which vertical grid to initialize with. Without ice-shelf cavities (i.e. ssh=0 everywhere), 'z-star' and 'z-level' are the same." | ||
possible_values="'z-star', 'z-level', or 'haney-number'" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I don't think these whitespace changes should have happened. Can you figure out which commit they're in, do and interactive rebase (git rebase --interactive MPAS-Dev/MPAS-Model/ocean/develop
) and edit that commit to remove these changes (e.g. git checkout src/core_ocean/mode_init/Registry.xml
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will do that. Thanks!
! Set debugging tracer | ||
if ( associated(debugTracers) ) then | ||
do k = 1, nVertLevels | ||
debugTracers(index_tracer1, k, iCell) = 1.0_RKIND | ||
enddo | ||
end if | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an expert in debug tracers but my sense was that debugTracers(1, :, :)
was purposefully set to all ones to be a check on conservation in the model. It might be better to modify debugTracer(2 :, :)
to serve the purpose you have above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I will put back the debugTracer(index_tracer1, :, :)
content and use index_tracer2
for my test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Make sure that actually works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the code and the test case (MPAS-Dev/compass#87) accordingly. I re-ran the case and plot the outputs with no issues.
@@ -126,6 +126,8 @@ function ocn_setup_packages(configPool, packagePool, iocontext) result(ierr)!{{{ | |||
logical, pointer :: tidalForcingActive | |||
logical, pointer :: tidalPotentialForcingPKGActive | |||
logical, pointer :: vegetationDragPKGActive | |||
logical, pointer :: sedimentTransportPKGActive | |||
logical, pointer :: sedimentTracersPKGActive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@caozd999 Does this package still exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two packages both exist. sedimentTransportPKGActive
is for general sediment transport, under which we define the sediment transport related variables such as sediment characteristics; sedimentTracersPKGActive
is specifically for process-based suspended sediment transport.
@@ -226,6 +227,8 @@ function ocn_forward_mode_init(domain, startTimeStamp) result(ierr)!{{{ | |||
call ocn_tracer_nonlocalflux_init(err_tmp) | |||
ierr = ior(ierr,err_tmp) | |||
call ocn_tracer_ecosys_init(domain, err_tmp) | |||
call ocn_tracer_sediment_init(domain, err_tmp) | |||
ierr = ior(ierr,err_tmp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ierr = ior(ierr,err_tmp) | |
This appears to be a duplicate line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually missed one ierr = ior(ierr,err_tmp)
after call ocn_tracer_ecosys_init(domain, err_tmp)
, thank you for pointing it out.
description="Concentration of debug tracer1 in one half of the domain." | ||
possible_values="Any real number" | ||
/> | ||
<nml_option name="config_lock_exchange_high_tracer1" type="real" default_value="10.0" units="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does having a default value >0 alter the behavior of the original test case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I see now that the debug tracers are not active by default. Are you planning to post a comparison between the debugTracer behavior and the sedimentTracers behavior, perhaps in the compass PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbegeman yes I've submitted a separate PR to compass MPAS-Dev/compass#87
! treat negative values as zero and apply mask to locals | ||
!--------------------------------------------------------------------------- | ||
|
||
sedConcen_loc(k,column) = max(0.0_SEDIMENT_r8, SEDIMENT_input%SEDIMENT_tracers(k,column,sedConcen_ind)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a naive question but can you explain why getting rid of negative values happens here as opposed to elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just emulated the codes of DMS and MACROS tracers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we really don't want to act on any sed tracers with negative concentration, but for conservation we don't want to clip the value of the actual prognostic field, so it's done using a temporary.
subroutine SEDIMENT_init(SEDIMENT_indices) | ||
|
||
! !DESCRIPTION: | ||
! Initialize tracegas tracer module. This involves setting metadata, reading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you describing the sediment tracer module as tracegas
or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing them out. The code was for sediment source-sink, I just built the code structure but left the code empty. I will clean the comments.
if ( groupName == 'sedimentTracers' ) then | ||
call ocn_tracer_sediment_compute(tracerGroup, & | ||
nTracersGroup,forcingPool, & | ||
nCellsOwned, maxLevelCell, & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recently put in some code that allows for inactive top cells, so minLevelCell
is needed here and in the subroutine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbegeman is the designated enforcer of the minLevelCell requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will add minLevelCell
. The whole routine currently works as a placeholder, and I will modify it accordingly as the development work goes on.
1889c14
to
6a666d9
Compare
@caozd999, could you change the name of the PR to something like "Add sediment concentration tracer"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This branch needs to be rebased onto ocean/develop
to resolve 2 conflicts with the last merge. Other than that, it looks great to me.
I ran the nightly suite from the legacy
compass branch on ocean/develop
and a merge of this branch into ocean/develop
. I ran with gnu on my Ubuntu laptop and intel on Anvil. Both passed.
I also successfully ran the compass
test cases in MPAS-Dev/compass#87. I have made some suggestions on that branch, but they don't affect merging this branch.
6a666d9
to
0e70bb6
Compare
0e70bb6
to
c36a9c8
Compare
@caozd999, I'm pretty sure you're aware at this point that this PR will eventually need to move to E3SM. However, if it isn't ready yet to merge into E3SM (e.g. needs more testing or review, which seems likely to be the case), we should chat about whether it makes sense to keep it here for now or move to the new https://github.com/E3SM-Ocean-Discussion/E3SM space where we will have PRs open for discussion. @mark-petersen, what is your plan for PRs like this one? |
@caozd999 did you create a design document for this? i think it would help me understand the implementation. |
Thanks @xylar. Yes I noticed what you mentioned. In addition, I will need to prepare a design doc for it as @maltrud suggested. Therefore, I am open to any decision. |
@caozd999 thanks, Zhendong. it doesn't have to be really detailed. like @cbegeman i'm curious why there are 2 new modules that are very similar. can we combine them? Also, i'm glad you used the BGC as a guide for this, but i think it would be fine to remove the "parms" module and just include them at the top of the sediment module. the "parms" is a legacy from CESM that we are going to remove with the new BGC implementation (MARBL). |
@maltrud Yes you are right - we can combine them. I am now working on the sediment erosion, and I realize that I can actually put everything into one module. I will do that. Thanks! |
@caozd999, these sound like significant enough changes that I would suggest closing this PR and opening a new one (perhaps referencing this one) in https://github.com/E3SM-Ocean-Discussion/E3SM. That way, it will be a lot easier to move over the E3SM-Project/E3SM when you're ready to get final approval and merge. Sorry this has been such a moving target. Bad timing. |
PR moved to E3SM-Ocean-Discussion/E3SM#4 |
This PR added suspended sediment as a tracer (without source/sink terms) in MPAS-O. The existing lock_exchange code was modified to support a new test case called
sed_tracer
in the compass (MPAS-Dev/compass#87). The new test case is to simulate 1) a pure diffusion process and 2) a advection-diffusion process (momentum generated by temperature), of suspended sediment and a debug tracer. The results of suspended sediment and the debug tracer will be compared to validate the implementation of suspended sediment as a new tracer in the model.