Skip to content

Commit

Permalink
Merge pull request ESCOMP#123 from jedwards4b/jedwards/solar_zenith_a…
Browse files Browse the repository at this point in the history
…ngle_correction
  • Loading branch information
jedwards4b authored Jan 6, 2022
2 parents 4ebc156 + 11a48c8 commit 39f79b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 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%masterproc, &
sdat%pstrm(ns)%ymdLB, dDateLB, sdat%pstrm(ns)%todLB, n_lb, filename_lb, &
Expand Down
19 changes: 5 additions & 14 deletions streams/dshr_tinterp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -238,27 +238,18 @@ 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 39f79b4

Please sign in to comment.