Skip to content

Commit ed9e08b

Browse files
Update CESM share to 1.1.5 and incorporate upstream fix for missing #ifdef timing in CESM_share
Co-authored-by: Dougie Squire <[email protected]>
1 parent 4f278cc commit ed9e08b

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

share/CESM_share

Submodule CESM_share updated 74 files

share/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
### Targets
21

32
## share library
43
add_fortran_library(OM3_share mod/share STATIC)
@@ -46,7 +45,9 @@ target_sources(OM3_share PRIVATE
4645
# The following file is a stub.
4746
stubs/mct_mod.F90
4847
)
48+
add_patched_source(OM3_share CESM_share/src/nuopc_shr_methods.F90)
4949
add_patched_source(OM3_share CESM_share/src/shr_const_mod.F90)
50+
5051
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
5152
# CESM reduces the precision and increases speed for the following file
5253
set_source_files_properties(CESM_share/src/shr_wv_sat_mod.F90 PROPERTIES COMPILE_FLAGS "-fimf-precision=low -fp-model fast")
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
diff --git a/src/nuopc_shr_methods.F90 b/src/nuopc_shr_methods.F90
2+
index 07cf7e5..8bdf11f 100644
3+
--- a/src/nuopc_shr_methods.F90
4+
+++ b/src/nuopc_shr_methods.F90
5+
@@ -820,9 +820,9 @@ contains
6+
7+
! local vars
8+
integer :: yr, mon, day
9+
- character(len=16) timestr
10+
- logical :: isPresent
11+
- character(len=ESMF_MAXSTR) :: inst_suffix
12+
+ character(len=17) timestr
13+
+ logical :: isPresent , isSet
14+
+ character(len=ESMF_MAXSTR) :: inst_suffix , pointer_date
15+
character(len=*), parameter :: subname='shr_get_rpointer_name'
16+
17+
rc = ESMF_SUCCESS
18+
@@ -832,19 +832,31 @@ contains
19+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
20+
if(ispresent) call NUOPC_CompAttributeGet(gcomp, name='inst_suffix', value=inst_suffix, rc=rc)
21+
22+
- yr = ymd/10000
23+
- mon = (ymd - yr*10000)/100
24+
- day = (ymd - yr*10000 - mon*100)
25+
- write(timestr,'(i4.4,a,i2.2,a,i2.2,a,i5.5)') yr,'-',mon,'-',day,'-',time
26+
- write(rpfile,*) "rpointer."//compname//trim(inst_suffix)//'.'//trim(timestr)
27+
+ ! if restart_pointer_append_date is false then don't append timestamp
28+
+ timestr = ""
29+
+ pointer_date = ".true."
30+
+ call NUOPC_CompAttributeGet(gcomp, name="restart_pointer_append_date", isPresent=isPresent, isSet=isSet, rc=rc)
31+
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
32+
+ if (isPresent .and. isSet) then
33+
+ call NUOPC_CompAttributeGet(gcomp, name='restart_pointer_append_date', value=pointer_date, rc=rc)
34+
+ endif
35+
+ if (trim(pointer_date) .eq. '.true.') then
36+
+ yr = ymd/10000
37+
+ mon = (ymd - yr*10000)/100
38+
+ day = (ymd - yr*10000 - mon*100)
39+
+ write(timestr,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') '.',yr,'-',mon,'-',day,'-',time
40+
+ endif
41+
+
42+
+ write(rpfile,*) "rpointer."//compname//trim(inst_suffix)//trim(timestr)
43+
rpfile = adjustl(rpfile)
44+
+
45+
if (mode.eq.'read') then
46+
inquire(file=trim(rpfile), exist=isPresent)
47+
if(.not. isPresent) then
48+
rpfile = "rpointer."//compname//trim(inst_suffix)
49+
inquire(file=trim(rpfile), exist=isPresent)
50+
if(.not. isPresent) then
51+
- call shr_sys_abort( subname//'ERROR no rpointer file found in '//rpfile//' or in '//rpfile//'.'//timestr )
52+
+ call shr_sys_abort( subname//'ERROR no rpointer file found in '//rpfile//' or in '//rpfile//trim(inst_suffix)//trim(timestr) )
53+
endif
54+
endif
55+
endif

0 commit comments

Comments
 (0)