From 8a92d594069e256f4aef2dc496d2dfaa8b72751c Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 13 Feb 2025 09:35:38 -0700 Subject: [PATCH] add hugevalue and tinyvalue, correct buildlib path, fix rc intent in shr_abort --- buildlib.csm_share | 2 +- src/shr_abort_mod.F90 | 10 +++++++--- src/shr_kind_mod.F90 | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/buildlib.csm_share b/buildlib.csm_share index 321a8c5..68bfe2b 100755 --- a/buildlib.csm_share +++ b/buildlib.csm_share @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import sys,os _CIMEROOT = os.getenv("CIMEROOT") -sys.path.append(os.path.join(_CIMEROOT,"scripts","Tools")) +sys.path.append(os.path.join(_CIMEROOT,"CIME","Tools")) from standard_script_setup import * from CIME.utils import copyifnewer, run_bld_cmd_ensure_logging, expect, symlink_force diff --git a/src/shr_abort_mod.F90 b/src/shr_abort_mod.F90 index b651db2..ac61eaa 100644 --- a/src/shr_abort_mod.F90 +++ b/src/shr_abort_mod.F90 @@ -38,13 +38,14 @@ subroutine shr_abort_abort(string,rc, line, file) !----- arguments ----- character(len=*) , intent(in), optional :: string ! error message string - integer(shr_kind_in), intent(inout), optional :: rc ! error code + integer(shr_kind_in), intent(in), optional :: rc ! error code integer(shr_kind_in), intent(in), optional :: line character(len=*), intent(in), optional :: file - + ! Local version of the string. ! (Gets a default value if string is not present.) character(len=shr_kind_cx) :: local_string + integer :: lrc !------------------------------------------------------------------------------- if (present(string)) then @@ -54,9 +55,12 @@ subroutine shr_abort_abort(string,rc, line, file) end if if(present(rc)) then write(local_string, *) trim(local_string), ' rc=',rc + lrc = rc + else + lrc = 0 endif - call shr_log_error(local_string, rc=rc, line=line, file=file) + call shr_log_error(local_string, rc=lrc, line=line, file=file) call shr_abort_backtrace() diff --git a/src/shr_kind_mod.F90 b/src/shr_kind_mod.F90 index be988e5..fedddde 100644 --- a/src/shr_kind_mod.F90 +++ b/src/shr_kind_mod.F90 @@ -3,6 +3,7 @@ MODULE shr_kind_mod !---------------------------------------------------------------------------- ! precision/kind constants add data public !---------------------------------------------------------------------------- + public integer,parameter :: SHR_KIND_R8 = selected_real_kind(12) ! 8 byte real integer,parameter :: SHR_KIND_R4 = selected_real_kind( 6) ! 4 byte real @@ -16,5 +17,6 @@ MODULE shr_kind_mod integer,parameter :: SHR_KIND_CL = 256 ! long char integer,parameter :: SHR_KIND_CX = 512 ! extra-long char integer,parameter :: SHR_KIND_CXX= 4096 ! extra-extra-long char - + real(kind=shr_kind_r8),parameter :: tinyvalue = tiny(1._shr_kind_R8) ! tiny value + real(kind=shr_kind_r8),parameter :: hugevalue = huge(1._shr_kind_r8) ! huge value END MODULE shr_kind_mod