Skip to content

Commit

Permalink
Patch shr_const_mod.F90 so that we can compile with CPU specific opti…
Browse files Browse the repository at this point in the history
…mizations on cascade lake.
  • Loading branch information
micaeljtoliveira committed Oct 23, 2023
1 parent 611ef3b commit 4bac80e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion share/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ target_sources(OM3_share PRIVATE
CESM_share/include/shr_assert.h
CESM_share/src/shr_abort_mod.F90
CESM_share/src/shr_cal_mod.F90
CESM_share/src/shr_const_mod.F90
CESM_share/src/shr_file_mod.F90
CESM_share/src/shr_kind_mod.F90
CESM_share/src/shr_log_mod.F90
Expand All @@ -46,6 +45,7 @@ target_sources(OM3_share PRIVATE
# The following file is a stub.
stubs/mct_mod.F90
)
add_patched_source(OM3_share CESM_share/src/shr_const_mod.F90)
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
# CESM reduces the precision and increases speed for the following file
set_source_files_properties(CESM_share/src/shr_wv_sat_mod.F90 PROPERTIES COMPILE_FLAGS "-fimf-precision=low -fp-model fast")
Expand Down
15 changes: 15 additions & 0 deletions share/patches/shr_const_mod.F90.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/shr_const_mod.F90 b/src/shr_const_mod.F90
index 8437190..9696c81 100644
--- shr_const_mod.F90.old
+++ shr_const_mod.F90.new
@@ -87,9 +87,8 @@ contains
!-----------------------------------------------------------------------------

elemental logical function shr_const_isspval(rval)
-!$omp declare simd(shr_const_isspval)

- real(r8), intent(in) :: rval
+ real(r8), intent(in) :: rval

if (rval > SHR_CONST_SPVAL_TOLMIN .and. &
rval < SHR_CONST_SPVAL_TOLMAX) then

0 comments on commit 4bac80e

Please sign in to comment.