5858]
5959# sensible and latent heat flux parameter values
6060wspd = 20.0
61- tatm = 270.87556216 # unrealistically high to drive a -1C change in stream temperature
61+ tatm = 270.79111 # unrealistically high to drive a -1C change in stream temperature
6262# shortwave radiation parameter values
6363solr = 47880870.9 # unrealistically high to drive a 1 deg C rise in stream temperature
6464shd = 1.0 # 100% shade "turns off" solar flux
9090perlen = [1 ]
9191
9292nouter , ninner = 1000 , 300
93- hclose , rclose , relax = 1e-3 , 1e-4 , 0.97
93+ hclose , rclose , relax = 1e-10 , 1e-10 , 0.97
9494
9595#
9696# MODFLOW 6 flopy GWF object
@@ -455,11 +455,12 @@ def check_output(idx, test):
455455
456456 # confirm that the energy added to the stream results in a -1C change in temp
457457 # temperature gradient
458+
458459 tgrad = tatm - strm_temp
459460 shf_ener_per_sqm = c_d * rhoa * Cpa * wspd * tgrad
460461 swr_ener_per_sqm = solr * (1 - shd ) * (1 - swrefl )
461462 # latent calcs
462- L = (2499.64 - 2.51 * strm_temp ) * 1000
463+ L = (2499.64 - ( 2.51 * strm_temp ) ) * 1000
463464 e_w = 6.1275 * math .exp (17.2693882 * (strm_temp / (strm_temp + 273.16 - 35.86 )))
464465 e_s = 6.1275 * math .exp (17.2693882 * (tatm / (tatm + 273.16 - 35.86 )))
465466 e_a = rh / 100 * e_s
@@ -473,22 +474,25 @@ def check_output(idx, test):
473474 )
474475 # calculate expected temperature change based on energy transfer
475476 temp_change = ener_transfer / (surf_Q_in [idx ][0 ] * Cpw * rhow )
477+
478+ print (str (strm_temp + temp_change ))
479+
480+ #new_strm_temp = strm_temp + temp_change
476481
477482 fpth2 = os .path .join (test .workspace , gwename + ".sfe.obs.csv" )
478483 assert os .path .isfile (fpth2 )
479484 df2 = pd .read_csv (fpth2 )
480485
481486 # confirm 1 deg C decrease in temp
482- msg1 = (
483- "The calculated temperature change \
484- is: "
485- + str ( temp_change )
487+ msg1 = "Python temperature change is = " + str ( temp_change )
488+ msg2 = "MODFLOW temperature = " + str ( df2 . loc [ 0 , "RCH1_OUTFTEMP" ])
489+ msg3 = "MODFLOW temperature change is " + str (
490+ strm_temp - df2 . loc [ 0 , "RCH1_OUTFTEMP" ]
486491 )
487- msg2 = "The temperature is:" + str (df2 .loc [0 , "RCH1_OUTFTEMP" ])
488492
489493 assert np .isclose (
490494 df2 .loc [0 , "RCH1_OUTFTEMP" ], strm_temp + temp_change , atol = 1e-6
491- ), msg2
495+ ), msg2 + ". " + msg3 + ". " + msg1
492496
493497
494498# - No need to change any code below
0 commit comments