Skip to content

Make it possible to overwrite shr_const values in CESM #23

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 1 addition & 4 deletions libglide/glide_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1559,18 +1559,15 @@ subroutine handle_parameters(section, model)

!NOTE: The following physical constants have default values in glimmer_physcon.F90.
! Some test cases (e.g., MISMIP) specify different values. The default values
! can therefore be overridden by the user in the config file (except that certain
! constants in CESM's shr_const_mod cannot be overridden when CISM is coupled to CESM).
! can therefore be overridden by the user in the config file.
! These constants are not part of the model derived type.

#ifndef CCSMCOUPLED
call GetValue(section,'rhoi', rhoi)
call GetValue(section,'rhoo', rhoo)
call GetValue(section,'grav', grav)
call GetValue(section,'shci', shci)
call GetValue(section,'lhci', lhci)
call GetValue(section,'trpt', trpt)
#endif

loglevel = GM_levels-GM_ERROR
call GetValue(section,'log_level',loglevel)
Expand Down
38 changes: 25 additions & 13 deletions libglimmer/glimmer_physcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,38 @@ module glimmer_physcon

use glimmer_global, only : dp

#ifdef CCSMCOUPLED
#ifdef CCSMCOUPLED

!Note: These CESM values are current as of September 2015.
use shr_const_mod, only: pi=> SHR_CONST_PI,& ! 3.14159265358979323846
rhoi=> SHR_CONST_RHOICE,& ! 0.917e3
rhoo=> SHR_CONST_RHOSW,& ! 1.026e3
rhow=> SHR_CONST_RHOFW,& ! 1.000e3
rearth=> SHR_CONST_REARTH,& ! 6.37122e6
grav=> SHR_CONST_G,& ! 9.80616
shci=> SHR_CONST_CPICE,& ! 2.11727e3
lhci=> SHR_CONST_LATICE,& ! 3.337e5
trpt=> SHR_CONST_TKTRIP ! 273.16
use shr_const_mod, only: SHR_CONST_PI,& ! 3.14159265358979323846
SHR_CONST_RHOICE,& ! 0.917e3
SHR_CONST_RHOSW,& ! 1.026e3
SHR_CONST_RHOFW,& ! 1.000e3
SHR_CONST_REARTH,& ! 6.37122e6
SHR_CONST_G,& ! 9.80616
SHR_CONST_CPICE,& ! 2.11727e3
SHR_CONST_LATICE,& ! 3.337e5
SHR_CONST_TKTRIP ! 273.16

implicit none
save

#else
real(dp), parameter :: pi = SHR_CONST_PI
real(dp), parameter :: rhow = SHR_CONST_RHOFW
real(dp), parameter :: rearth = SHR_CONST_REARTH

implicit none
real(dp) :: rhoi = SHR_CONST_RHOICE
real(dp) :: rhoo = SHR_CONST_RHOSW
real(dp) :: grav = SHR_CONST_G
real(dp) :: shci = SHR_CONST_CPICE
real(dp) :: lhci = SHR_CONST_LATICE
real(dp) :: trpt = SHR_CONST_TKTRIP

#else

implicit none
save

real(dp),parameter :: pi = 3.14159265358979d0 !< Value of \f$\pi\f$.
real(dp),parameter :: rhow = 1000.0d0 !< The density of fresh water (kg m<SUP>-3</SUP>)
real(dp),parameter :: rearth = 6.37122d6 ! radius of earth (m)
Expand Down