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

Fms mixedmode update #962

Merged
merged 27 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
060e004
Modify send_data in diag_manager.F90
MinsukJi-NOAA Oct 5, 2021
3efd6c8
Use select type for rmask in send_data_3d
MinsukJi-NOAA Oct 5, 2021
fc22927
Comment out send_data_2d_r8 and send_data_3d_r8 to disambiguate send_…
MinsukJi-NOAA Oct 5, 2021
128ee92
Modify register_diag_field and register_static_field in diag_manager.F90
MinsukJi-NOAA Oct 6, 2021
1cb055a
Modify log_diag_field_info in diag_util.F90
MinsukJi-NOAA Oct 6, 2021
f407187
Merge remote-tracking branch 'emc/fms_mixedmode' into feature/mji_mix…
MinsukJi-NOAA Oct 6, 2021
068a7bd
Modify diag_axis_init and get_diag_axis in diag_axis.F90
MinsukJi-NOAA Oct 6, 2021
15b5e20
Modify diag_grid_init in diag_grid.F90
MinsukJi-NOAA Oct 6, 2021
b04c43c
Merge pull request #1 from MinsukJi-NOAA/feature/mji_mixedmode
junwang-noaa Oct 7, 2021
6418dfa
Code changes for `tracer_manager` and `time_manager` directories (#3)
MinsukJi-NOAA Oct 9, 2021
64a4504
Modify files in `sat_vapor_pres` directory (#4)
MinsukJi-NOAA Oct 18, 2021
6dab04c
Add constants4 directory (#5)
binli2337 Oct 20, 2021
1041d75
Fix range size check if statements in diag_manager.F90 (#6)
MinsukJi-NOAA Oct 21, 2021
48d5b9f
Modify sat_vapor_pres_k.F90 to fix cpld_control_p7 test with 32bit FV…
MinsukJi-NOAA Nov 1, 2021
062d6bc
Modify send_data_3d in diag_manager.F90 to move SELECT TYPE blocks ou…
MinsukJi-NOAA Nov 3, 2021
940df90
Update to the top of main of NOAA-GFDL/FMS (#9)
MinsukJi-NOAA Nov 5, 2021
91fc755
Merge remote-tracking branch 'gfdl/emc_mixedmode' into fms_mixedmode
MinsukJi-NOAA Nov 5, 2021
9242fe4
Make changes to address review comments on class(*) and select type (…
MinsukJi-NOAA Nov 12, 2021
19c85fe
Merge remote-tracking branch 'gfdl/main' into fms_mixedmode
MinsukJi-NOAA Dec 15, 2021
0747a61
Address GFDL reviewer's comments: part 1 (#12)
MinsukJi-NOAA Jan 12, 2022
754f7e4
Address GFDL reviewer's comments (#13)
MinsukJi-NOAA Jan 14, 2022
740443d
Code changes to address reviewer's comments (#14)
MinsukJi-NOAA Jan 14, 2022
f0f398e
Bring EMC fms_mixedmode up to date with GFDL main (#15)
MinsukJi-NOAA Apr 15, 2022
033b2fb
Bring EMC fms_mixedmode up to date with GFDL main (689579e) (#16)
MinsukJi-NOAA Apr 15, 2022
3b74d35
Merge remote-tracking branch 'gfdl/main' into fms_mixedmode
MinsukJi-NOAA Apr 15, 2022
b0c3f5c
Update constants4 and CMakeLists.txt. (#17)
binli2337 Jun 20, 2022
40c0bf4
update files in constants4 directory (#18)
binli2337 Jun 22, 2022
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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ list(APPEND fms_fortran_src_files
column_diagnostics/column_diagnostics.F90
constants/constants.F90
constants/fmsconstants.F90
constants4/constants4.F90
constants4/fmsconstants4.F90
coupler/atmos_ocean_fluxes.F90
coupler/coupler_types.F90
coupler/ensemble_manager.F90
Expand Down Expand Up @@ -284,6 +286,7 @@ foreach(kind ${kinds})
fms
fms2_io/include
mpp/include
constants4
constants)
target_compile_definitions(${libTgt}_f PRIVATE "${fms_defs}")
target_compile_definitions(${libTgt}_f PRIVATE "${${kind}_defs}")
Expand Down
33 changes: 33 additions & 0 deletions constants4/constants4.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
97 changes: 97 additions & 0 deletions constants4/fmsconstants4.F90
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/>.
!***********************************************************************
!> @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

!--- 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=r4_kind), 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=r4_kind), public, parameter :: PI = PI_8 !< Ratio of circle circumference to diameter [N/A]
real(kind=r4_kind), public, parameter :: RAD_TO_DEG = 180._r8_kind/PI_8 !< Degrees per radian [deg/rad]
real(kind=r4_kind), public, parameter :: DEG_TO_RAD = PI_8/180._r8_kind !< Radians per degree [rad/deg]
real(kind=r4_kind), public, parameter :: RADIAN = RAD_TO_DEG !< Equal to RAD_TO_DEG for backward compatability. [rad/deg]

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

!--- Various gas constants
real(kind=r4_kind), public, parameter :: RDGAS = 8314.47 /28.965 !< Gas constant for dry air [J/kg/deg]
real(kind=r4_kind), public, parameter :: RVGAS = 8314.47 /18.015 !< Gas constant for water vapor [J/kg/deg]
real(kind=r4_kind), public, parameter :: HLV = 2.4665E6_r8_kind !< Latent heat of evaporation [J/kg]
real(kind=r4_kind), public, parameter :: HLF = 3.3370E5_r8_kind !< Latent heat of fusion [J/kg]
real(kind=r4_kind), public, parameter :: HLS = HLV + HLF !< Latent heat of sublimation [J/kg]
real(kind=r4_kind), public, parameter :: KAPPA = RDGAS/(3.5*RDGAS) !< RDGAS / (3.5*RDGAS) [dimensionless]
real(kind=r4_kind), public, parameter :: CP_AIR = RDGAS/KAPPA !< Specific heat capacity of dry air
!! at constant pressure [J/kg/deg]
real(kind=r4_kind), public, parameter :: CP_VAPOR = 4.0_r8_kind*RVGAS !< Specific heat capacity of water vapor
!! at constant pressure [J/kg/deg]
real(kind=r4_kind), public, parameter :: CP_OCEAN = 3989.24495292815_r8_kind !< Specific heat capacity taken from McDougall (2002)
!! "Potential Enthalpy ..." [J/kg/deg]
real(kind=r4_kind), public, parameter :: DENS_H2O = 1000._r8_kind !< Density of liquid water [kg/m^3]
real(kind=r4_kind), public, parameter :: RHOAIR = 1.292269_r8_kind !< Reference atmospheric density [kg/m^3]
real(kind=r4_kind), public, parameter :: RHO0 = 1.035E3_r8_kind !< Average density of sea water [kg/m^3]
real(kind=r4_kind), public, parameter :: RHO0R = 1.0_r8_kind/RHO0 !< Reciprocal of average density of sea water [m^3/kg]
real(kind=r4_kind), 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=r4_kind), public, parameter :: O2MIXRAT = 2.0953E-01_r8_kind !< Mixing ratio of molecular oxygen in air [dimensionless]
real(kind=r4_kind), public, parameter :: WTMAIR = 2.896440E+01_r8_kind !< Molecular weight of air [AMU]
real(kind=r4_kind), public, parameter :: WTMH2O = WTMAIR*(RDGAS/RVGAS) !< Molecular weight of water [AMU]
real(kind=r4_kind), public, parameter :: WTMOZONE = 47.99820_r8_kind !< Molecular weight of ozone [AMU]
real(kind=r4_kind), public, parameter :: WTMC = 12.00000_r8_kind !< Molecular weight of carbon [AMU]
real(kind=r4_kind), public, parameter :: WTMCO2 = 44.00995_r8_kind !< Molecular weight of carbon dioxide [AMU]
real(kind=r4_kind), public, parameter :: WTMCH4 = 16.0425_r8_kind !< Molecular weight of methane [AMU]
real(kind=r4_kind), public, parameter :: WTMO2 = 31.9988_r8_kind !< Molecular weight of molecular oxygen [AMU]
real(kind=r4_kind), public, parameter :: WTMCFC11 = 137.3681_r8_kind !< Molecular weight of CFC-11 (CCl3F) [AMU]
real(kind=r4_kind), public, parameter :: WTMCFC12 = 120.9135_r8_kind !< Molecular weight of CFC-21 (CCl2F2) [AMU]
real(kind=r4_kind), public, parameter :: WTMN = 14.0067_r8_kind !< Molecular weight of Nitrogen [AMU]
real(kind=r4_kind), public, parameter :: DIFFAC = 1.660_r8_kind !< Diffusivity factor [dimensionless]
real(kind=r4_kind), 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=r4_kind), public, parameter :: PSTD = 1.013250E+06_r8_kind !< Mean sea level pressure [dynes/cm^2]
real(kind=r4_kind), public, parameter :: PSTD_MKS = 101325.0_r8_kind !< Mean sea level pressure [N/m^2]
real(kind=r4_kind), public, parameter :: KELVIN = 273.16_r8_kind !< Degrees Kelvin at zero Celsius [K]
real(kind=r4_kind), public, parameter :: TFREEZE = 273.16_r8_kind !< Freezing temperature of fresh water [K]
real(kind=r4_kind), 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=r4_kind), public, parameter :: STEFAN = 5.6734E-8_r8_kind !< Stefan-Boltzmann constant [W/m^2/deg^4]
real(kind=r4_kind), public, parameter :: AVOGNO = 6.023000E+23_r8_kind !< Avogadro's number [atoms/mole]
real(kind=r4_kind), public, parameter :: VONKARM = 0.40_r8_kind !< Von Karman constant [dimensionless]

!--- Miscellaneous constants
real(kind=r4_kind), public, parameter :: ALOGMIN = -50.0_r8_kind !< Minimum value allowed as argument to log function [N/A]
real(kind=r4_kind), public, parameter :: EPSLN = 1.0E-40_r8_kind !< A small number to prevent divide by zero exceptions [N/A]
real(kind=r4_kind), 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=r4_kind), 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