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

Error in setting background viscosity #238

Open
dcherian opened this issue Mar 16, 2023 · 2 comments · May be fixed by #239
Open

Error in setting background viscosity #238

dcherian opened this issue Mar 16, 2023 · 2 comments · May be fixed by #239

Comments

@dcherian
Copy link

dcherian commented Mar 16, 2023

if (present(Kd_lay)) Kd_lay(:,:,:) = CS%Kd
Kd_int(:,:,:) = CS%Kd
if (present(Kd_extra_T)) Kd_extra_T(:,:,:) = 0.0
if (present(Kd_extra_S)) Kd_extra_S(:,:,:) = 0.0
if (associated(visc%Kv_slow)) visc%Kv_slow(:,:,:) = CS%Kv

Kd_lay and Kv_slow are set to KD and KV; effectively these are background values and the defaults are KD=2e-5, KV=1e-4

Later calculate_bkgnd_mixing calculates background values Kv_bkgnd and Kd_bkgnd (I have HORIZ_VARYING_BACKGROUND=TRUE) and assigns Kd_lay_2d and Kd_int_2d

! Add background mixing
call calculate_bkgnd_mixing(h, tv, N2_lay, Kd_lay_2d, Kd_int_2d, Kv_bkgnd, j, G, GV, US, CS%bkgnd_mixing_csp)

Kd_bkgnd is assigned to Kd_lay in there, overwriting the KD values set earlier.

Now back in MOM_set_diffusivity: Kv_bkgnd is added to Kv_slow (≡ KD):

! Update Kv and 3-d diffusivity diagnostics.
if (associated(visc%Kv_slow)) then ; do K=1,nz+1 ; do i=is,ie
visc%Kv_slow(i,j,K) = visc%Kv_slow(i,j,K) + Kv_bkgnd(i,K)
enddo ; enddo ; endif

This is NOT what's being done with diffusivity where Kd_lay is set by calculate_bkgnd_mixing.

It is wrong because we've added two different "background" viscosity formulations. We should be overwriting Kv_slow with Kv_bkgnd.

Setting KD=0, KV=0 makes things work like I expected.

EDIT: For the record, here's the image that shows the issue (mean profiles at 0N, 140W; averaged over years 46-68), the prandtl number (visc/diff) is ~200 below the EUC. We want it to be in the 1-10 range.

image

@gustavo-marques
Copy link
Collaborator

Thanks for reporting this.
cc'ing @alperaltuntas

dcherian added a commit to dcherian/MOM6 that referenced this issue Mar 22, 2023
Add constant background viscosity KD to latitudinal dependent
formulations, if any.

Closes NCAR#238
@dcherian
Copy link
Author

dcherian commented Mar 22, 2023

As update, after discussing with Alper and Gustavo, we decided to do something similar for diffusivity where we add the background field to whatever Kd_int is initialized to (KD in this case) , and then set KV=0, KD=0 by default in MOM_interface.

See #239 and ESCOMP/MOM_interface#134, ESCOMP/MOM_interface#135

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