Skip to content

Commit

Permalink
Merge pull request ESCOMP#148 from billsacks/backout_123
Browse files Browse the repository at this point in the history
Revert PR ESCOMP#123

### Description of changes

PR ESCOMP#123 (solar zenith angle correction) led to exact restart failures in some situations: see ESCOMP#144. This PR backs out the changes from ESCOMP#123 .

### Specific notes

Contributors other than yourself, if any:

CDEPS Issues Fixed (include github issue #): Temporarily deals with ESCOMP#144.

Are there dependencies on other component PRs (if so list): no

Are changes expected to change answers (bfb, different to roundoff, more substantial): more substantial. I have verified that this brings answers back to being bfb with those in cdeps0.12.35 (i.e., prior to ESCOMP#123) via a run of the aux_clm test suite.

Any User Interface Changes (namelist or namelist defaults changes): no

Testing performed (e.g. aux_cdeps, CESM prealpha, etc): aux_clm

Hashes used for testing: billsacks/ctsm@3fd7f6fbf
  • Loading branch information
billsacks authored Mar 16, 2022
2 parents 471e459 + dc77f4d commit 2ee28ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion streams/dshr_strdata_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ subroutine shr_strdata_readLBUB(sdat, ns, mDate, mSec, newData, istr, rc)
call ESMF_TraceRegionExit(trim(istr)//'_setup')

! if model current date is outside of model lower or upper bound - find the stream bounds
if (rDateM < rDateLB .or. rDateM >= rDateUB) then
if (rDateM < rDateLB .or. rDateM > rDateUB) then
call ESMF_TraceRegionEnter(trim(istr)//'_fbound')
call shr_stream_findBounds(stream, mDate, mSec, sdat%mainproc, &
sdat%pstrm(ns)%ymdLB, dDateLB, sdat%pstrm(ns)%todLB, n_lb, filename_lb, &
Expand Down
19 changes: 14 additions & 5 deletions streams/dshr_tinterp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,27 @@ subroutine shr_tInterp_getAvgCosz(tavCosz, lon, lat, &

do while( reday < reday2) ! mid-interval t-steps thru interval [LB,UB]

!--- get next cosz value for t-avg ---
call shr_tInterp_getCosz(cosz,lon,lat,ymd,tod,eccen,mvelpp,lambm0,obliqr,calendar)
n = n + ldt
tavCosz = tavCosz + cosz*real(ldt,r8) ! add to partial sum

!--- advance to next time in [LB,UB] ---
ymd0 = ymd
tod0 = tod
reday0 = reday
call shr_cal_advDateInt(ldt,'seconds',ymd0,tod0,ymd,tod,calendar)
call shr_cal_timeSet(reday,ymd,tod,calendar)

if (reday > reday2) then
ymd = ymd2
tod = tod2
timeint = reday2-reday0
call ESMF_TimeIntervalGet(timeint, s_i8=dtsec, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
ldt = int(dtsec, shr_kind_in)
endif

!--- get next cosz value for t-avg ---
call shr_tInterp_getCosz(cosz,lon,lat,ymd,tod,eccen,mvelpp,lambm0,obliqr,calendar)
n = n + ldt
tavCosz = tavCosz + cosz*real(ldt,r8) ! add to partial sum

end do
tavCosz = tavCosz/real(n,r8) ! form t-avg

Expand Down

0 comments on commit 2ee28ac

Please sign in to comment.