-
Notifications
You must be signed in to change notification settings - Fork 134
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
Conversation
…DL#1125) Co-authored-by: mlee03 <[email protected]>
Co-authored-by: rem1776 <[email protected]>
BREAKING CHANGE: Any code using the global fms module (libFMS.F90) will break as this adds prefixes to all names in that module.
Test all six variants of the mo_diff interface. Store input values and answers as scalars rather than arrays.
end associate | ||
|
||
associate(ans => drag_answers(n_answers+1)) | ||
ans%drag_m = INT_(drag_m_1d) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)..
There was a problem hiding this comment.
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.
Declare input arrays with the `parameter` attribute, and set their values via derived type constructors.
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]>
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:
make distcheck
passes