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

merge mixed mode updates into main #1366

Merged
merged 58 commits into from
Sep 20, 2023
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a22e194
Revert "feat: emc mixedmode support (#997)"
Nov 23, 2022
95287f5
Add back in constants4 files from emc revert
Nov 23, 2022
61ac8a9
chore: add include files for easier reviews (#1086)
mlee03 Dec 8, 2022
38b5143
Merge remote-tracking branch 'origin/main' into mixedmode
Jan 10, 2023
4dbd23c
Merge remote-tracking branch 'origin/main' into mixedmode
Jan 23, 2023
fcaca04
chore: copy over changes from modules to includes (#1115)
rem1776 Jan 24, 2023
2456a41
fix: add class(*) back to diag_manager (#1123)
mlee03 Feb 7, 2023
17a5359
Update mixedmode to main (#1143)
mlee03 Mar 8, 2023
24760ee
update the mixedmode branch to main (#1153)
mlee03 Mar 15, 2023
8376481
update mixedmode to main (#1171)
mlee03 Mar 29, 2023
2edc3dc
feat: mixed precision axis_utils2 (#1104)
mcallic2 Mar 29, 2023
6b3855a
feat: mixed precision fms_mod (#1147)
J-Lentz Mar 29, 2023
cdabf07
feat: horiz interp mixed precision (#1067)
rem1776 Mar 29, 2023
7b3906c
mixed precision sat_vapor_pressure (#1095)
mlee03 Mar 29, 2023
f1adb5e
feat: add mixed precision axis_utils unit tests (#1172)
J-Lentz Mar 30, 2023
e6c6e38
merge _base into mixedmode branch (#1180)
rem1776 Apr 6, 2023
66c1297
fix: move type definitions to before first usage to fix nvhpc bug (#1…
rem1776 Apr 10, 2023
be8473d
fix: change allocatable type for intel errors (#1221)
rem1776 May 24, 2023
b3aca89
feat: eliminate use of real numbers for mixed precision in `block_con…
J-Lentz May 24, 2023
4cb3f69
chore: merge mixedmode_base into mixedmode (#1235)
rem1776 May 24, 2023
d5980a8
fix: private routines in libFMS.F90 (#1241)
mlee03 Jun 1, 2023
c036f90
feat: mixed precision field_manager (#1205)
mlee03 Jun 7, 2023
9f3c791
feat: mixed precision random_numbers_mod (#1191)
J-Lentz Jun 7, 2023
f655759
feat: mixed precision time_manager reals to r8 and clean up (#1196)
rem1776 Jun 7, 2023
9340a5d
feat: mixed Precision tracer_manager (#1212)
mlee03 Jun 7, 2023
ba97253
fix duplicate test directory from merge
Jun 7, 2023
d2733bb
chore: Update mixedmode (#1304)
mlee03 Jul 27, 2023
7f8abc2
Mixed precision monin_obukhov (#1116)
mcallic2 Jul 28, 2023
f7b7544
Mixed precision: `monin_obukhov` unit tests (#1272)
J-Lentz Jul 28, 2023
0e0956c
mixed-precision diag_integral_mod (#1217)
mlee03 Aug 3, 2023
0501ed2
mixed precision time_interp (#1252)
rem1776 Aug 3, 2023
82e2674
mixed precision interpolator_mod (#1305)
mlee03 Aug 18, 2023
54b5a21
Mixed precision astronomy (#1092)
mcallic2 Aug 18, 2023
be5c138
fix: add floor function back to astronomy_mod(#1350)
mlee03 Aug 23, 2023
73d0461
merge mixed mode base into mixedmode (#1352)
rem1776 Aug 25, 2023
b582419
remove renamed CI file missed in merge (#1356)
mlee03 Aug 28, 2023
dffe74b
Mixed precision `data_override_mod` (#1323)
J-Lentz Aug 30, 2023
0d0f604
mixed precision exchange (#1341)
mcallic2 Aug 30, 2023
3dbcd7e
coupler mixed precision (#1353)
rem1776 Aug 30, 2023
b737eb2
bring in parser changes from main (#1359)
mlee03 Aug 31, 2023
497ab46
Mixed precision topography_mod (#1250)
mcallic2 Aug 31, 2023
9983ce3
mixed precision remove cp fileobj in interpolator_type_eq (#1358)
mlee03 Aug 31, 2023
34db486
Merge remote-tracking branch 'upstream/main' into HEAD
Sep 14, 2023
7fb3367
remove un-updated include files
Sep 14, 2023
385a698
fix build
Sep 15, 2023
fa05256
fixes for review comments
Sep 18, 2023
f6f9364
fixes for whitespace
Sep 18, 2023
8d8fadf
replace kind in error messages for get_data_type_string
Sep 18, 2023
ebbcedb
add rm diag_integral.out to test script
Sep 19, 2023
a145d4b
add newlines for added files
Sep 19, 2023
d74c608
add kind to static reals in time_interp test
Sep 19, 2023
045018e
add comments for load_record r8 read
Sep 19, 2023
9fb1a62
add seconds per day parameters to get_cal_time
Sep 19, 2023
98d5ee3
fix comments in gaussian_topog.F90
Sep 19, 2023
aa84fd7
Merge pull request #92 from mlee03/mixedmode-alpha3-mlee03
rem1776 Sep 19, 2023
70a2be8
fix types used in get_calendar_time
Sep 19, 2023
7583db7
delete out file appropriately
Sep 19, 2023
1485874
Merge pull request #93 from mlee03/mixedmode-alpha3-mlee03
rem1776 Sep 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add back in constants4 files from emc revert
rem1776 authored and rem1776 committed Nov 23, 2022
commit 95287f55ef701bf64b13ee9d61820eaccab7f7cf
33 changes: 33 additions & 0 deletions constants4/constantsr4.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
!***********************************************************************
!* GNU Lesser General Public License
!*
!* This file is part of the GFDL Flexible Modeling System (FMS).
!*
!* FMS is free software: you can redistribute it and/or modify it under
!* the terms of the GNU Lesser General Public License as published by
!* the Free Software Foundation, either version 3 of the License, or (at
!* your option) any later version.
!*
!* FMS is distributed in the hope that it will be useful, but WITHOUT
!* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
!* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
!* for more details.
!*
!* You should have received a copy of the GNU Lesser General Public
!* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
!***********************************************************************
!> @defgroup constantsR4_mod constantsR4_mod
!> @ingroup constantsR4
!> @brief compatibility module as we transition to an FMSConstantsR4 module
!!
!> @file
!> @brief File for @ref constantsR4_mod

module constantsR4_mod

!> rename to not conflict with any other version vars
use FMSConstantsR4, version => constantsR4_version, constants_init => FMSconstantsR4_init

contains

end module constantsR4_mod
99 changes: 99 additions & 0 deletions constants4/fmsconstantsr4.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
!***********************************************************************
!* GNU Lesser General Public License
!*
!* This file is part of the GFDL Flexible Modeling System (FMS).
!*
!* FMS is free software: you can redistribute it and/or modify it under
!* the terms of the GNU Lesser General Public License as published by
!* the Free Software Foundation, either version 3 of the License, or (at
!* your option) any later version.
!*
!* FMS is distributed in the hope that it will be useful, but WITHOUT
!* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
!* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
!* for more details.
!*
!* You should have received a copy of the GNU Lesser General Public
!* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
!***********************************************************************
!> @defgroup fmsconstantsR4 FMSConstantsR4
!> @ingroup libfms
!> @brief Defines useful constants for Earth. Constants are defined as real
!!
!> FMSconstantsR4 have been declared as r4_kind or r8_kind PARAMETER.
!!
!! The value of a constant defined and used from here cannot be changed
!! in a users program. New constants can be defined in terms of values
!! from the FMSconstants module and their includes using a parameter
!! statement.<br><br>
!!
!! The currently support contant systems are:
!! GFDL constants (gfdl_constantsR4.h)
!! GEOS constants (geos_constantsR4.h)
!! GFS constants (gfs_constantsR4.h)
!! <br><br>
!!
!! The name given to a particular constant may be changed.<br><br>
!!
!! Constants can only be used on the right side on an assignment statement
!! (their value can not be reassigned).
!!
!! Example:
!!
!! @verbatim
!! use FMSConstantsR4, only: TFREEZE, grav_new => GRAV
!! real, parameter :: grav_inv = 1.0 / grav_new
!! tempc(:,:,:) = tempk(:,:,:) - TFREEZE
!! geopotential(:,:) = height(:,:) * grav_new
!! @endverbatim
!> @file
!> @brief File for @ref FMSconstantsR4_mod

!> @addtogroup FMSconstantsR4_mod
!> @{
module FMSconstantsR4

use platform_mod, only: r4_kind, r8_kind

!--- default scoping
implicit none

#define RKIND r4_kind

!--- set a default for the FMSConstantsR4
#if !defined(GFDL_CONSTANTS) && !defined(GFS_CONSTANTS) && !defined(GEOS_CONSTANTS)
#define GFDL_CONSTANTS
#endif

!--- perform error checking and include the correct system of constants
#if defined(GFDL_CONSTANTS) && !defined(GFS_CONSTANTS) && !defined(GEOS_CONSTANTS)
#warning "Using GFDL constantsR4"
#include <gfdl_constantsR4.h>
#elif !defined(GFDL_CONSTANTS) && defined(GFS_CONSTANTS) && !defined(GEOS_CONSTANTS)
#warning "Using GFS constantsR4"
#include <gfs_constantsR4.h>
#elif !defined(GFDL_CONSTANTS) && !defined(GFS_CONSTANTS) && defined(GEOS_CONSTANTS)
#warning "Using GEOS constantsR4"
#include <geos_constantsR4.h>
#else
#error FATAL FMSConstantsR4 error - multiple constants macros are defined for FMS
#endif

!--- public interfaces
public :: FMSConstantsR4_init

contains

!> @brief FMSconstantsR4 init routine
subroutine FMSconstantsR4_init
use mpp_mod, only: stdlog
integer :: logunit
logunit = stdlog()

write (logunit,'(/,80("="),/(a))') trim(constantsR4_version)

end subroutine FMSconstantsR4_init

end module FMSconstantsR4
!> @}
! close documentation grouping
97 changes: 97 additions & 0 deletions constants4/geos_constantsR4.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
!***********************************************************************
!* GNU Lesser General Public License
!*
!* This file is part of the GFDL Flexible Modeling System (FMS).
!*
!* FMS is free software: you can redistribute it and/or modify it under
!* the terms of the GNU Lesser General Public License as published by
!* the Free Software Foundation, either version 3 of the License, or (at
!* your option) any later version.
!*
!* FMS is distributed in the hope that it will be useful, but WITHOUT
!* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
!* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
!* for more details.
!*
!* You should have received a copy of the GNU Lesser General Public
!* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
!***********************************************************************

character(len=20), public, parameter :: constantsR4_version = 'FMSConstantsR4: GEOS'

!--- temporary definition for backwards compatibility
real(kind=RKIND), public, parameter :: small_fac = 1._r8_kind

!--- Spherical coordinate conversion constants
real(kind=r8_kind), public, parameter :: PI_8 = 3.14159265358979323846_r8_kind !< Ratio of circle circumference to diameter [N/A]
real(kind=RKIND), public, parameter :: PI = PI_8 !< Ratio of circle circumference to diameter [N/A]
real(kind=RKIND), public, parameter :: RAD_TO_DEG = 180._r8_kind/PI_8 !< Degrees per radian [deg/rad]
real(kind=RKIND), public, parameter :: DEG_TO_RAD = PI_8/180._r8_kind !< Radians per degree [rad/deg]
real(kind=RKIND), public, parameter :: RADIAN = RAD_TO_DEG !< Equal to RAD_TO_DEG for backward compatability. [rad/deg]

!--- Earth physical constants
real(kind=RKIND), public, parameter :: RADIUS = 6371.0E3_r8_kind !< Radius of the Earth [m]
real(kind=RKIND), public, parameter :: OMEGA = 2.0*PI_8/86164.0 !< Rotation rate of the Earth [1/s]
real(kind=RKIND), public, parameter :: GRAV = 9.80665_r8_kind !< Acceleration due to gravity [m/s^2]
real(kind=RKIND), public, parameter :: SECONDS_PER_DAY = 86400._r8_kind !< Seconds in a day [s]
real(kind=RKIND), public, parameter :: SECONDS_PER_HOUR = 3600._r8_kind !< Seconds in an hour [s]
real(kind=RKIND), public, parameter :: SECONDS_PER_MINUTE = 60._r8_kind !< Seconds in a minute [s]

!--- Various gas constants
real(kind=RKIND), public, parameter :: RDGAS = 8314.47 /28.965 !< Gas constant for dry air [J/kg/deg]
real(kind=RKIND), public, parameter :: RVGAS = 8314.47 /18.015 !< Gas constant for water vapor [J/kg/deg]
real(kind=RKIND), public, parameter :: HLV = 2.4665E6_r8_kind !< Latent heat of evaporation [J/kg]
real(kind=RKIND), public, parameter :: HLF = 3.3370E5_r8_kind !< Latent heat of fusion [J/kg]
real(kind=RKIND), public, parameter :: HLS = HLV + HLF !< Latent heat of sublimation [J/kg]
real(kind=RKIND), public, parameter :: KAPPA = RDGAS/(3.5*RDGAS) !< RDGAS / (3.5*RDGAS) [dimensionless]
real(kind=RKIND), public, parameter :: CP_AIR = RDGAS/KAPPA !< Specific heat capacity of dry air
!! at constant pressure [J/kg/deg]
real(kind=RKIND), public, parameter :: CP_VAPOR = 4.0_r8_kind*RVGAS !< Specific heat capacity of water vapor
!! at constant pressure [J/kg/deg]
real(kind=RKIND), public, parameter :: CP_OCEAN = 3989.24495292815_r8_kind !< Specific heat capacity taken from McDougall (2002)
!! "Potential Enthalpy ..." [J/kg/deg]
real(kind=RKIND), public, parameter :: DENS_H2O = 1000._r8_kind !< Density of liquid water [kg/m^3]
real(kind=RKIND), public, parameter :: RHOAIR = 1.292269_r8_kind !< Reference atmospheric density [kg/m^3]
real(kind=RKIND), public, parameter :: RHO0 = 1.035E3_r8_kind !< Average density of sea water [kg/m^3]
real(kind=RKIND), public, parameter :: RHO0R = 1.0_r8_kind/RHO0 !< Reciprocal of average density of sea water [m^3/kg]
real(kind=RKIND), public, parameter :: RHO_CP = RHO0*CP_OCEAN !< (kg/m^3)*(cal/kg/deg C)(joules/cal) =
!! (joules/m^3/deg C) [J/m^3/deg]
real(kind=RKIND), public, parameter :: O2MIXRAT = 2.0953E-01_r8_kind !< Mixing ratio of molecular oxygen in air [dimensionless]
real(kind=RKIND), public, parameter :: WTMAIR = 2.896440E+01_r8_kind !< Molecular weight of air [AMU]
real(kind=RKIND), public, parameter :: WTMH2O = WTMAIR*(RDGAS/RVGAS) !< Molecular weight of water [AMU]
real(kind=RKIND), public, parameter :: WTMOZONE = 47.99820_r8_kind !< Molecular weight of ozone [AMU]
real(kind=RKIND), public, parameter :: WTMC = 12.00000_r8_kind !< Molecular weight of carbon [AMU]
real(kind=RKIND), public, parameter :: WTMCO2 = 44.00995_r8_kind !< Molecular weight of carbon dioxide [AMU]
real(kind=RKIND), public, parameter :: WTMCH4 = 16.0425_r8_kind !< Molecular weight of methane [AMU]
real(kind=RKIND), public, parameter :: WTMO2 = 31.9988_r8_kind !< Molecular weight of molecular oxygen [AMU]
real(kind=RKIND), public, parameter :: WTMCFC11 = 137.3681_r8_kind !< Molecular weight of CFC-11 (CCl3F) [AMU]
real(kind=RKIND), public, parameter :: WTMCFC12 = 120.9135_r8_kind !< Molecular weight of CFC-21 (CCl2F2) [AMU]
real(kind=RKIND), public, parameter :: WTMN = 14.0067_r8_kind !< Molecular weight of Nitrogen [AMU]
real(kind=RKIND), public, parameter :: DIFFAC = 1.660_r8_kind !< Diffusivity factor [dimensionless]
real(kind=RKIND), public, parameter :: ES0 = 1.0_r8_kind !< Humidity factor [dimensionless]
!! Controls the humidity content of the atmosphere through
!! the Saturation Vapour Pressure expression
!! when using DO_SIMPLE

!--- Pressure and Temperature constants
real(kind=RKIND), public, parameter :: PSTD = 1.013250E+06_r8_kind !< Mean sea level pressure [dynes/cm^2]
real(kind=RKIND), public, parameter :: PSTD_MKS = 101325.0_r8_kind !< Mean sea level pressure [N/m^2]
real(kind=RKIND), public, parameter :: KELVIN = 273.16_r8_kind !< Degrees Kelvin at zero Celsius [K]
real(kind=RKIND), public, parameter :: TFREEZE = 273.16_r8_kind !< Freezing temperature of fresh water [K]
real(kind=RKIND), public, parameter :: C2DBARS = 1.E-4_r8_kind !< Converts rho*g*z (in mks) to dbars:
!! 1dbar = 10^4 (kg/m^3)(m/s^2)m [dbars]

!--- Named constants
real(kind=RKIND), public, parameter :: STEFAN = 5.6734E-8_r8_kind !< Stefan-Boltzmann constant [W/m^2/deg^4]
real(kind=RKIND), public, parameter :: AVOGNO = 6.023000E+23_r8_kind !< Avogadro's number [atoms/mole]
real(kind=RKIND), public, parameter :: VONKARM = 0.40_r8_kind !< Von Karman constant [dimensionless]

!--- Miscellaneous constants
real(kind=RKIND), public, parameter :: ALOGMIN = -50.0_r8_kind !< Minimum value allowed as argument to log function [N/A]
real(kind=RKIND), public, parameter :: EPSLN = 1.0E-40_r8_kind !< A small number to prevent divide by zero exceptions [N/A]
real(kind=RKIND), public, parameter :: RADCON = ((1.0E+02*GRAV)/(1.0D+04*CP_AIR))*SECONDS_PER_DAY !< Factor to convert flux divergence
!! to heating rate in degrees per day
!! [deg sec/(cm day)]
real(kind=RKIND), public, parameter :: RADCON_MKS = (GRAV/CP_AIR)*SECONDS_PER_DAY !< Factor to convert flux divergence
!! to heating rate in degrees per day
!! [deg sec/(m day)]
Loading