Skip to content

Commit d166014

Browse files
committed
Just getting better.
1 parent f66e7a2 commit d166014

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

prms/stream_temp.f90

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ INTEGER FUNCTION stream_temp_run()
715715
USE PRMS_CLIMATE_HRU, ONLY: Humidity_hru
716716
USE PRMS_FLOWVARS, ONLY: Seg_outflow
717717
USE PRMS_SNOW, ONLY: Snowmelt
718-
USE PRMS_ROUTING, ONLY: Hru_segment, Segment_order, Seginc_swrad
718+
USE PRMS_ROUTING, ONLY: Hru_segment, Segment_order
719719
USE PRMS_OBS, ONLY: Humidity
720720
USE PRMS_SET_TIME, ONLY: Nowyear, Nowmonth, Nowday, Jday
721721
USE PRMS_SOLTAB, ONLY: Soltab_potsw, Hru_cossl
@@ -844,7 +844,7 @@ INTEGER FUNCTION stream_temp_run()
844844
seg_tave_upstream(i) = -100.0
845845

846846
! Big do loop
847-
write(*,*) "big do loop ", Nowyear, Nowmonth, Nowday
847+
! write(*,*) "big do loop ", Nowyear, Nowmonth, Nowday
848848
DO j = 1, Nsegment
849849
i = Segment_order(j)
850850

@@ -875,7 +875,7 @@ INTEGER FUNCTION stream_temp_run()
875875
! Add in the heat from upstream
876876
do k = 1, upstream_count(i)
877877
kk = upstream_idx(i,k)
878-
fs_kk = SNGL(Seg_outflow(kk)) * CFS2CMS_CONV
878+
fs_kk = SNGL(Seg_outflow(kk) * CFS2CMS_CONV)
879879

880880
up_temp = up_temp + (Seg_tave_water(kk) * fs_kk)
881881
fs = fs + fs_kk
@@ -891,10 +891,10 @@ INTEGER FUNCTION stream_temp_run()
891891

892892
! Add the lateral temperature to the upstream temperature
893893
! Compute t_o
894-
fs2 = (Seg_lateral_inflow(i) * CFS2CMS_CONV + fs)
894+
fs2 = sngl(Seg_lateral_inflow(i) * CFS2CMS_CONV + fs)
895895
if (fs2 > 0.0) then
896-
t_o = ((seg_tave_lat(i) * Seg_lateral_inflow(i) * CFS2CMS_CONV) + &
897-
& (fs * seg_tave_upstream(i))) / fs2
896+
t_o = (sngl(seg_tave_lat(i) * Seg_lateral_inflow(i) * CFS2CMS_CONV) + &
897+
& sngl(fs * seg_tave_upstream(i))) / fs2
898898
else
899899
t_o = -99.9
900900
endif
@@ -935,20 +935,17 @@ INTEGER FUNCTION stream_temp_run()
935935

936936
! debug
937937
if (t_o .ne. t_o) then
938-
write(*,*) "t_o is Nan, seg_tave_upstream = ", seg_tave_upstream(i), " fs = ", fs, &
939-
& " qlat = ", qlat, " seg_tave_lat = ", seg_tave_lat(i), " lat_temp_adj = ", lat_temp_adj(i,Nowmonth)
940-
! continue
941-
endif
938+
write(*,*) "t_o is Nan"
939+
Seg_tave_water(i) = -98.9
942940

943-
! debug
944-
if (t_o .gt. 50.0) then
945-
write(*,*) "this is the place: t_o = ", t_o, " ted = ", te, " seg_id = ", i
941+
else if (t_o .gt. 50.0) then
942+
write(*,*) "t_o = ", t_o, " ted = ", te, " seg_id = ", i
946943
write(*,*) " seg_tave_upstream = ", seg_tave_upstream(i), " fs = ", fs, &
947944
& " qlat = ", qlat, " seg_tave_lat = ", seg_tave_lat(i), " lat_temp_adj = ", lat_temp_adj(i,Nowmonth)
948945
write(*,*) " width = ", Seg_width(i), Nowyear, Nowmonth, Nowday
949-
endif
946+
Seg_tave_water(i) = -98.9
950947

951-
if (t_o .lt. -98.0) then
948+
else if (t_o .lt. -98.0) then
952949
Seg_tave_water(i) = -98.9
953950

954951
else

0 commit comments

Comments
 (0)