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

Mixed precision: monin_obukhov unit tests #1272

Merged
merged 111 commits into from
Jul 28, 2023

Conversation

J-Lentz
Copy link
Contributor

@J-Lentz J-Lentz commented Jul 5, 2023

Description
Unit tests for mixed precision monin_obukhov_mod

How Has This Been Tested?
Tests build and pass on the AMD box with GNU and Intel.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

mcallic2 and others added 30 commits January 20, 2023 10:22
end associate

associate(ans => drag_answers(n_answers+1))
ans%drag_m = INT_(drag_m_1d)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the answers converted to itnegers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference answers are loaded from a namelist file so that it's easy to add additional answer keys for new compilers or platforms. With reals, the Fortran standard makes no guarantee that x.eq.y is true, where y is the result of storing x in a namelist file and reading it back. Integers have unambiguous string representations however, so x.eq.y will be true if y is the result of transfer()-ing x to an integer, storing that integer in a namelist file, reading it back, and transfer()-ing it back to a real.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the monin algorithms too complicated to have simple answers such as 1.0? 😅 (for example by setting all the namelist parameters to simple values)..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attempted that approach at first. It would be more elegant for sure if I could spend a semester studying the math. But given the timeline, I decided that a lazy reference answer approach would be more expedient.

@rem1776 rem1776 merged commit f7b7544 into NOAA-GFDL:mixedmode Jul 28, 2023
27 checks passed
rem1776 added a commit that referenced this pull request Sep 20, 2023
BREAKING CHANGE: In coupler_types.F90,  `coupler_nd_field_type` and `coupler_nd_values_type` have been renamed to indicate real kind value: `coupler_nd_real4/8_field_type` and `coupler_nd_real4/8_values_type`. The `bc` field within `coupler_nd_bc_type` was modified to use r8_kind within the value and field types, and an additional field added `bc_r4` to use r4_kind values.

Includes:

* feat: eliminate use of real numbers for mixed precision in `block_control` (#1195)

* feat: mixed precision field_manager  (#1205)

* feat: mixed precision random_numbers_mod (#1191)

* feat: mixed precision time_manager reals to r8 and clean up (#1196)

* feat: mixed Precision tracer_manager  (#1212)

* Mixed precision monin_obukhov (#1116)

* Mixed precision: `monin_obukhov` unit tests (#1272)

* mixed-precision diag_integral_mod  (#1217)

* mixed precision time_interp (#1252)

* mixed precision interpolator_mod  (#1305)

* Mixed precision astronomy (#1092)

* Mixed precision `data_override_mod` (#1323)

* mixed precision exchange (#1341)

* coupler mixed precision (#1353)

* Mixed precision topography_mod (#1250)

---------

Co-authored-by: rem1776 <[email protected]>
Co-authored-by: MiKyung Lee <[email protected]>
Co-authored-by: mlee03 <[email protected]>
Co-authored-by: Caitlyn McAllister <[email protected]>
Co-authored-by: Jesse Lentz <[email protected]>
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 this pull request may close these issues.