NCAR / MOM6

NCAR/CESM fork of the Modular Ocean Model v.6 (MOM6)
Other
2 stars 18 forks source link

Error in setting background viscosity #238

Open dcherian opened 1 year ago

dcherian commented 1 year ago

https://github.com/NCAR/MOM6/blob/9786710c3eff31468891767852600eeadf368589/src/parameterizations/vertical/MOM_set_diffusivity.F90#L311-L315

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

https://github.com/NCAR/MOM6/blob/9786710c3eff31468891767852600eeadf368589/src/parameterizations/vertical/MOM_set_diffusivity.F90#L409-L410

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): https://github.com/NCAR/MOM6/blob/9786710c3eff31468891767852600eeadf368589/src/parameterizations/vertical/MOM_set_diffusivity.F90#L411-L414

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 commented 1 year ago

Thanks for reporting this. cc'ing @alperaltuntas

dcherian commented 1 year ago

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 https://github.com/ESCOMP/MOM_interface/issues/134, https://github.com/ESCOMP/MOM_interface/pull/135