Skip to content

Commit

Permalink
Update CESM share to 1.1.5 and incorporate upstream fix for missing #…
Browse files Browse the repository at this point in the history
…ifdef timing in CESM_share

Co-authored-by: Dougie Squire <42455466+dougiesquire@users.noreply.github.com>
  • Loading branch information
anton-seaice and dougiesquire committed Feb 13, 2025
1 parent 31eefa9 commit af996ad
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion share/CESM_share
Submodule CESM_share updated 74 files
+54 −0 .github/actions/buildshare/action.yaml
+108 −0 .github/workflows/extbuild.yml
+0 −171 .github/workflows/srt.yml
+137 −0 CMakeLists.txt
+28 −46 buildlib.csm_share
+71 −0 cmake/Compilers.cmake
+147 −0 cmake/FindESMF.cmake
+134 −0 cmake/Sourcelist_utils.cmake
+169 −0 cmake/add_pfunit_ctest.cmake
+90 −0 cmake/genf90_utils.cmake
+10 −17 src/CMakeLists.txt
+0 −19 src/esmf_wrf_timemgr/CMakeLists.txt
+0 −19 src/esmf_wrf_timemgr/ESMF.F90
+0 −102 src/esmf_wrf_timemgr/ESMF_AlarmClockMod.F90
+0 −1,040 src/esmf_wrf_timemgr/ESMF_AlarmMod.F90
+0 −1,089 src/esmf_wrf_timemgr/ESMF_BaseMod.F90
+0 −459 src/esmf_wrf_timemgr/ESMF_BaseTimeMod.F90
+0 −502 src/esmf_wrf_timemgr/ESMF_CalendarMod.F90
+0 −1,247 src/esmf_wrf_timemgr/ESMF_ClockMod.F90
+0 −83 src/esmf_wrf_timemgr/ESMF_FractionMod.F90
+0 −36 src/esmf_wrf_timemgr/ESMF_Macros.inc
+0 −45 src/esmf_wrf_timemgr/ESMF_ShrTimeMod.F90
+0 −167 src/esmf_wrf_timemgr/ESMF_Stubs.F90
+0 −1,739 src/esmf_wrf_timemgr/ESMF_TimeIntervalMod.F90
+0 −45 src/esmf_wrf_timemgr/ESMF_TimeMgr.inc
+0 −1,572 src/esmf_wrf_timemgr/ESMF_TimeMod.F90
+0 −60 src/esmf_wrf_timemgr/Makefile
+0 −65 src/esmf_wrf_timemgr/MeatMod.F90
+0 −19 src/esmf_wrf_timemgr/README
+0 −63 src/esmf_wrf_timemgr/unittests/Makefile
+0 −14 src/esmf_wrf_timemgr/unittests/go.csh
+0 −312 src/esmf_wrf_timemgr/unittests/test.F90
+0 −17 src/esmf_wrf_timemgr/unittests/wrf_stuff.F90
+0 −9 src/esmf_wrf_timemgr/wrf_error_fatal.F90
+0 −5 src/esmf_wrf_timemgr/wrf_message.F90
+1,468 −0 src/m_MergeSorts.F90
+0 −1,242 src/mct_mod.F90
+868 −0 src/nuopc_shr_methods.F90
+1 −1 src/shr_assert_mod.F90.in
+0 −16 src/shr_flds_mod.F90
+0 −3,463 src/shr_map_mod.F90
+0 −860 src/shr_mct_mod.F90
+2 −2 src/shr_mpi_mod.F90
+0 −817 src/shr_pcdf_mod.F90
+56 −24 src/shr_reprosum_mod.F90
+41 −212 src/shr_scam_mod.F90
+2 −2 src/shr_spfn_mod.F90
+1 −1 src/shr_sys_mod.F90
+0 −403 src/shr_taskmap_mod.F90
+0 −163 test/old_unit_testers/Makefile
+0 −327 test/old_unit_testers/Mkdepends
+0 −60 test/old_unit_testers/Mksrcfiles
+0 −212 test/old_unit_testers/bundle_expected.F90
+0 −7 test/old_unit_testers/config.h
+0 −369 test/old_unit_testers/make.Macros
+0 −10 test/old_unit_testers/namelist
+0 −2 test/old_unit_testers/nl/atm.stdin
+0 −2 test/old_unit_testers/nl/cpl.stdin
+0 −2 test/old_unit_testers/nl/ice.stdin
+0 −2 test/old_unit_testers/nl/lnd.stdin
+0 −2 test/old_unit_testers/nl/ocn.stdin
+0 −96 test/old_unit_testers/run_dshr_bundle_test
+0 −68 test/old_unit_testers/run_file_test
+0 −339 test/old_unit_testers/test_mod.F90
+0 −220 test/old_unit_testers/test_shr_file.F90
+0 −28 test/old_unit_testers/test_shr_log.F90
+0 −291 test/old_unit_testers/test_shr_mpi.F90
+0 −47 test/old_unit_testers/test_shr_orb.F90
+0 −156 test/old_unit_testers/test_shr_scam.F90
+0 −663 test/old_unit_testers/test_shr_streams.F90
+0 −75 test/old_unit_testers/test_shr_sys.F90
+0 −108 test/old_unit_testers/test_shr_tInterp.F90
+1 −1 test/unit/dynamic_vector/CMakeLists.txt
+3 −6 test/unit/shr_cal_test/CMakeLists.txt
3 changes: 2 additions & 1 deletion share/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
### Targets

## share library
add_fortran_library(OM3_share mod/share STATIC)
Expand Down Expand Up @@ -46,7 +45,9 @@ target_sources(OM3_share PRIVATE
# The following file is a stub.
stubs/mct_mod.F90
)
add_patched_source(OM3_share CESM_share/src/nuopc_shr_methods.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
55 changes: 55 additions & 0 deletions share/patches/nuopc_shr_methods.F90.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
diff --git a/src/nuopc_shr_methods.F90 b/src/nuopc_shr_methods.F90
index 07cf7e5..8bdf11f 100644
--- a/src/nuopc_shr_methods.F90
+++ b/src/nuopc_shr_methods.F90
@@ -820,9 +820,9 @@ contains

! local vars
integer :: yr, mon, day
- character(len=16) timestr
- logical :: isPresent
- character(len=ESMF_MAXSTR) :: inst_suffix
+ character(len=17) timestr
+ logical :: isPresent , isSet
+ character(len=ESMF_MAXSTR) :: inst_suffix , pointer_date
character(len=*), parameter :: subname='shr_get_rpointer_name'

rc = ESMF_SUCCESS
@@ -832,19 +832,31 @@ contains
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if(ispresent) call NUOPC_CompAttributeGet(gcomp, name='inst_suffix', value=inst_suffix, rc=rc)

- yr = ymd/10000
- mon = (ymd - yr*10000)/100
- day = (ymd - yr*10000 - mon*100)
- write(timestr,'(i4.4,a,i2.2,a,i2.2,a,i5.5)') yr,'-',mon,'-',day,'-',time
- write(rpfile,*) "rpointer."//compname//trim(inst_suffix)//'.'//trim(timestr)
+ ! if restart_pointer_append_date is false then don't append timestamp
+ timestr = ""
+ pointer_date = ".true."
+ call NUOPC_CompAttributeGet(gcomp, name="restart_pointer_append_date", isPresent=isPresent, isSet=isSet, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (isPresent .and. isSet) then
+ call NUOPC_CompAttributeGet(gcomp, name='restart_pointer_append_date', value=pointer_date, rc=rc)
+ endif
+ if (trim(pointer_date) .eq. '.true.') then
+ yr = ymd/10000
+ mon = (ymd - yr*10000)/100
+ day = (ymd - yr*10000 - mon*100)
+ write(timestr,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') '.',yr,'-',mon,'-',day,'-',time
+ endif
+
+ write(rpfile,*) "rpointer."//compname//trim(inst_suffix)//trim(timestr)
rpfile = adjustl(rpfile)
+
if (mode.eq.'read') then
inquire(file=trim(rpfile), exist=isPresent)
if(.not. isPresent) then
rpfile = "rpointer."//compname//trim(inst_suffix)
inquire(file=trim(rpfile), exist=isPresent)
if(.not. isPresent) then
- call shr_sys_abort( subname//'ERROR no rpointer file found in '//rpfile//' or in '//rpfile//'.'//timestr )
+ call shr_sys_abort( subname//'ERROR no rpointer file found in '//rpfile//' or in '//rpfile//trim(inst_suffix)//trim(timestr) )
endif
endif
endif

0 comments on commit af996ad

Please sign in to comment.