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

HOMOGENIZE_FORCINGS does not rescale properly for large factors #60

Closed
Hallberg-NOAA opened this issue Jan 13, 2022 · 0 comments · Fixed by #78
Closed

HOMOGENIZE_FORCINGS does not rescale properly for large factors #60

Hallberg-NOAA opened this issue Jan 13, 2022 · 0 comments · Fixed by #78
Labels
bug Something isn't working

Comments

@Hallberg-NOAA
Copy link
Member

HOMOGENIZE_FORCINGS does not rescale properly for sufficiently large rescaling factors. In particular, for sufficiently large or small rescaling factors, these can return updated values of 0 or something that is too large to be represented, but for modest rescaling factors it gives the right answers.

The issue is that the homogenize_field() routines (approriately) use the reproducing sums via the global_area_mean() routines to give domain-independence and rotational invariance, and the reproducing_sums() routines in turn use the extended fixed point arithmetic.

The solution would seem to be to temporarily rescale the variables inside global_area_mean() back to mks units while taking the spatial means before restoring the scaling for the result. To accomplish this, I am proposing a new optional argument, tmp_scale, to global_area_mean(), global_area_mean_u() and global_area_mean_v() in MOM_spatial_means.F90, and a similar argument to the various homogenize_field rouitines in MOM_forcing_type. The appropriate rescaling factor would also have to be added to all of the calls to these routines in homogenize_forciing() and homogenize_mech_forcing().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant