NCAR / MOM6

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

REMAP_VEL_CONSERVE_KE breaks dimensional consistency tests #300

Closed gustavo-marques closed 1 month ago

gustavo-marques commented 2 months ago

@alperaltuntas found that the dimensional consistency tests break when REMAP_VEL_CONSERVE_KE = True. CC'ing @iangrooms

iangrooms commented 2 months ago

OK, I will take a look.

iangrooms commented 2 months ago

I can't get dev/ncar to pass dimensional consistency even with REMAP_VEL_CONSERVE_KE = False, so I can't make progress on this for now.

iangrooms commented 2 months ago

I think the lines that break the dimensional consistency tests are here and here. The correction is based on the square root of the ratio of two kinetic energies, and to avoid division by 0 I introduced a dimensional constant 1.E-19. This literal constant doesn't scale in the dimensional consistency tests, which causes the results to change and the test to fail. I changed the code to remove the literal constant here and here.

Separately, on the same branch I also changed the computation of the diagnostics ale_u2 and ale_v2 to make the code clearer. I don't think this change is necessary to fix the dimensional consistency tests.

iangrooms commented 1 month ago

This issue was resolved by #308.