Skip to content

Commit

Permalink
Merge pull request #65 from jedwards4b/huge_tiny_issues
Browse files Browse the repository at this point in the history
add hugevalue and tinyvalue, correct buildlib path, fix rc intent in …
  • Loading branch information
jedwards4b authored Feb 13, 2025
2 parents a30c627 + 8a92d59 commit 14338be
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buildlib.csm_share
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 7 additions & 3 deletions src/shr_abort_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

Expand Down
4 changes: 3 additions & 1 deletion src/shr_kind_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 14338be

Please sign in to comment.