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

Compute KPP input fields #6507

Closed
qingli411 opened this issue Jul 11, 2024 · 6 comments · Fixed by #6509
Closed

Compute KPP input fields #6507

qingli411 opened this issue Jul 11, 2024 · 6 comments · Fixed by #6509
Assignees

Comments

@qingli411
Copy link
Contributor

@vanroekel, I think the call below to compute necessary input fields for CVMix should be placed outside the if statement checking config_cvmix_kpp_nonlocal_with_implicit_mix, or somewhere else? This seems to be the only place where this subroutine is called and the computed fields surfaceBuoyancyForcing and surfaceFrictionVelocity are required by other CVMix subroutines. What do you think?

call ocn_compute_KPP_input_fields(statePool, forcingPool,&
meshPool, timeLevel)

@vanroekel
Copy link
Contributor

@qingli411 great catch, yes you are right on. If we set config_cvmix_kpp_nonloacl_with_implicit_mix those critical quantities would not be computed. Fortunately that is not the default value, but we need to fix this. I'll assign this to myself.

@vanroekel vanroekel self-assigned this Jul 11, 2024
@qingli411
Copy link
Contributor Author

I guess we could probably put it in ocn_diagnostic_solve()? I realized it that I was using surfaceFrictionVelocity in GOTM as well... So maybe do the computation when either CVMix or GOTM is on?

@vanroekel
Copy link
Contributor

Oh, GOTM uses this as well? That's more problematic.

I think we should do a two step process.

  1. for now - move the KPP_input_fields above that if statement and change the if on L1248 to if(config_cvmix .or. config_gotm)
  2. move the calculation to diagnostic solve or vmix.F - since diagnostic_solve is called multiple times perhaps making this call in vmix.F is more effective

I suggest this way as we can keep our current v3 simulations BFB

What do you think?

@qingli411
Copy link
Contributor Author

Yes, doing it in two steps sounds good.

I'm a bit concerned about making this call in vmix.F - vmix is after tend_tracer in time_integration? Maybe only move the computation of surfaceFrictionVelocity to ocn_diagnostic_solve? The computation of buoyancy flux and non-local surface fluxes can stay here in tend_tracer?

@vanroekel
Copy link
Contributor

So here is my thinking. In the operator splitting we do here, vmix should be fully contained at the end and in the way we compute things everything going into KPP/GOTM (including u* and b_sfc) should be updated values at the end of the timestep. Right now we compute the nonlocal part of KPP based on partially updated buoyancy fluxes and the non local shape from the previous timestep. If we move this call to vmix we won't have this time offset anymore. So the move to later feels more consistent to me. What are your concerns in making the call after the main time step?

But it also occurs to me that calling this in vmix and diagnostic_solve is functionally equivalent. Diagnostic_solve is called right before vmix_implicit

@qingli411
Copy link
Contributor Author

OK. That makes sense now - I didn't realize there is a time offset between the shape function and surface buoyancy flux and was thinking that the non-local fluxes are needed by tend_tracer...

I was also a bit confused to see the computation of friction velocity in a subroutine called by tend_tracer. But moving that call to vmix_implicit will address that.

vanroekel added a commit that referenced this issue Jul 11, 2024
if GOTM is enabled surface friction velocity is not calculated at
present.  This fixes that issue

Addresses #6507
jonbob added a commit that referenced this issue Aug 20, 2024
Fixes gotm interface for vertical mixing

If GOTM is enabled surface friction velocity is not calculated at
present. This fixes that issue by allowing KPP_input_fields to be
calculated for cvmix and gotm

Fixes #6507
[BFB]
@jonbob jonbob closed this as completed in 0439e66 Aug 21, 2024
rfiorella pushed a commit to rfiorella/E3SM that referenced this issue Jan 28, 2025
if GOTM is enabled surface friction velocity is not calculated at
present.  This fixes that issue

Addresses E3SM-Project#6507
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

Successfully merging a pull request may close this issue.

2 participants