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 field_manager #1205

Merged
merged 39 commits into from
Jun 7, 2023
Merged

Conversation

mlee03
Copy link
Contributor

@mlee03 mlee03 commented Apr 27, 2023

Description
In this PR, field_manager has been updated to include mixedmode capabilities. All string values that are converted to real values is done in r8_kind precision.

Minor changes were required in coupler_types.F90 where the precision of the pointers param and mol_wt are now explicitly defined as r8_kind. This change is required for compatibility between the current atmos_ocean_fluxes and the mixed-mode-updated field_manager.

@mlee03 mlee03 changed the base branch from main to mixedmode April 27, 2023 15:50
@mlee03 mlee03 requested review from J-Lentz and mcallic2 April 27, 2023 16:01
@mlee03 mlee03 requested a review from uramirez8707 May 31, 2023 16:45
Copy link
Contributor

@rem1776 rem1776 left a comment

Choose a reason for hiding this comment

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

looks good, mainly needs some interfaces added for fm_util.F90.

field_manager/field_manager.F90 Show resolved Hide resolved
libFMS.F90 Outdated Show resolved Hide resolved
test_fms/field_manager/Makefile.am Outdated Show resolved Hide resolved
test_fms/field_manager/test_field_manager2.sh Outdated Show resolved Hide resolved
Comment on lines 62 to 72
public fm_util_set_value
public fm_util_set_value_integer_array
public fm_util_set_value_logical_array
public fm_util_set_value_real_array
public fm_util_set_value_real_array_r4
public fm_util_set_value_real_array_r8
public fm_util_set_value_string_array
public fm_util_set_value_integer
public fm_util_set_value_logical
public fm_util_set_value_real
public fm_util_set_value_real_r4
public fm_util_set_value_real_r8
public fm_util_set_value_string
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not directly related to the mixed mode update
But this is weird, fm_util_set_value is an interface and what the users should be calling. The compiler will figure out which function to go to.

interface fm_util_set_value !{
module procedure fm_util_set_value_integer_array
module procedure fm_util_set_value_logical_array
module procedure fm_util_set_value_real_array
module procedure fm_util_set_value_string_array
module procedure fm_util_set_value_integer
module procedure fm_util_set_value_logical
module procedure fm_util_set_value_real
module procedure fm_util_set_value_string
end interface !}

Comment on lines +228 to +229
public :: fm_get_value_real_r4 !< as above (overloaded function)
public :: fm_get_value_real_r8 !< as above (overloaded function)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment fm_get_value should be the only public function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree but I'm scared to change it. Coupler_mod in FMS calls fm_util_get_real instead of "fm_util_get_value" so for consistency, I think I'm going to leave this in here. But maybe this can be a separate issue, cleaning up interfaces in field_manager?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, this should be a separate issue, not related to mixed mode.

@rem1776 rem1776 merged commit c036f90 into NOAA-GFDL:mixedmode Jun 7, 2023
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.

5 participants