@@ -715,7 +715,7 @@ INTEGER FUNCTION stream_temp_run()
715
715
USE PRMS_CLIMATE_HRU, ONLY: Humidity_hru
716
716
USE PRMS_FLOWVARS, ONLY: Seg_outflow
717
717
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
719
719
USE PRMS_OBS, ONLY: Humidity
720
720
USE PRMS_SET_TIME, ONLY: Nowyear, Nowmonth, Nowday, Jday
721
721
USE PRMS_SOLTAB, ONLY: Soltab_potsw, Hru_cossl
@@ -844,7 +844,7 @@ INTEGER FUNCTION stream_temp_run()
844
844
seg_tave_upstream(i) = - 100.0
845
845
846
846
! Big do loop
847
- write (* ,* ) " big do loop " , Nowyear, Nowmonth, Nowday
847
+ ! write(*,*) "big do loop ", Nowyear, Nowmonth, Nowday
848
848
DO j = 1 , Nsegment
849
849
i = Segment_order(j)
850
850
@@ -875,7 +875,7 @@ INTEGER FUNCTION stream_temp_run()
875
875
! Add in the heat from upstream
876
876
do k = 1 , upstream_count(i)
877
877
kk = upstream_idx(i,k)
878
- fs_kk = SNGL(Seg_outflow(kk)) * CFS2CMS_CONV
878
+ fs_kk = SNGL(Seg_outflow(kk) * CFS2CMS_CONV)
879
879
880
880
up_temp = up_temp + (Seg_tave_water(kk) * fs_kk)
881
881
fs = fs + fs_kk
@@ -891,10 +891,10 @@ INTEGER FUNCTION stream_temp_run()
891
891
892
892
! Add the lateral temperature to the upstream temperature
893
893
! Compute t_o
894
- fs2 = (Seg_lateral_inflow(i) * CFS2CMS_CONV + fs)
894
+ fs2 = sngl (Seg_lateral_inflow(i) * CFS2CMS_CONV + fs)
895
895
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
898
898
else
899
899
t_o = - 99.9
900
900
endif
@@ -935,20 +935,17 @@ INTEGER FUNCTION stream_temp_run()
935
935
936
936
! debug
937
937
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
942
940
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
946
943
write (* ,* ) " seg_tave_upstream = " , seg_tave_upstream(i), " fs = " , fs, &
947
944
& " qlat = " , qlat, " seg_tave_lat = " , seg_tave_lat(i), " lat_temp_adj = " , lat_temp_adj(i,Nowmonth)
948
945
write (* ,* ) " width = " , Seg_width(i), Nowyear, Nowmonth, Nowday
949
- endif
946
+ Seg_tave_water(i) = - 98.9
950
947
951
- if (t_o .lt. - 98.0 ) then
948
+ else if (t_o .lt. - 98.0 ) then
952
949
Seg_tave_water(i) = - 98.9
953
950
954
951
else
0 commit comments