Skip to content

Commit

Permalink
test EHC
Browse files Browse the repository at this point in the history
  • Loading branch information
lyy committed Jul 12, 2023
1 parent a8cae7e commit 909141e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
43 changes: 35 additions & 8 deletions src/suews/src/suews_ctrl_driver.f95
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,11 @@ SUBROUTINE SUEWS_cal_Main_DTS( &
REAL(KIND(1D0)) :: FAIEveTree_use
REAL(KIND(1D0)) :: FAIDecTree_use

WRITE (*, *) "hydroState%state_roof", hydroState%state_roof
WRITE (*, *) "hydroState%soilstore_roof", hydroState%soilstore_roof
WRITE (*, *) "hydroState%state_wall", hydroState%state_wall
WRITE (*, *) "hydroState%soilstore_wall", hydroState%soilstore_wall

! ############# memory allocation for DTS variables (start) #############
ALLOCATE (hydroState_prev%soilstore_roof(nlayer))
ALLOCATE (hydroState_prev%state_roof(nlayer))
Expand Down Expand Up @@ -2178,10 +2183,15 @@ SUBROUTINE SUEWS_cal_Main_DTS( &
ohmState_next = ohmState
snowState_next = snowState
hydroState_next = hydroState

WRITE (*, *) "hydroState_next%state_roof", hydroState_next%state_roof
WRITE (*, *) "hydroState_next%soilstore_roof", hydroState_next%soilstore_roof
WRITE (*, *) "hydroState_next%state_wall", hydroState_next%state_wall
WRITE (*, *) "hydroState_next%soilstore_wall", hydroState_next%soilstore_wall
! state_surf_next = state_surf
! soilstore_surf_next = soilstore_surf

hydroState_next = hydroState
!hydroState_next = hydroState
! IF (StorageHeatMethod == 5) THEN

! soilstore_roof_next = soilstore_roof
Expand Down Expand Up @@ -2597,9 +2607,9 @@ SUBROUTINE SUEWS_cal_Main_DTS( &
! temp_in_wall = temp_out_wall
! temp_in_surf = temp_out_surf
! Ts_iter = DOT_PRODUCT(tsfc_out_surf, sfr_surf)
! PRINT *, 'QS_surf after cal_qs', QS_surf
! PRINT *, 'QS_roof after cal_qs', QS_roof
! PRINT *, 'QS_wall after cal_qs', QS_wall
!PRINT *, 'QS_surf after cal_qs', QS_surf
!PRINT *, 'QS_roof after cal_qs', QS_roof
!PRINT *, 'QS_wall after cal_qs', QS_wall

! PRINT *, ''

Expand Down Expand Up @@ -2652,6 +2662,8 @@ SUBROUTINE SUEWS_cal_Main_DTS( &
QH_Init = QH
END IF

!print *, 'QH_Init=', QH_Init

!============= calculate water balance =============
IF (methodPrm%Diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_Water...'
! CALL SUEWS_cal_Water_DTS( &
Expand Down Expand Up @@ -2731,7 +2743,7 @@ SUBROUTINE SUEWS_cal_Main_DTS( &
g_kdown, g_dq, g_ta, g_smd, g_lai, & ! output:
UStar, TStar, L_mod, & !output
zL, gsc, RS, RA_h, RAsnow, RB, z0v, z0vSnow)
! WRITE (*, *) 'UStar=', UStar, ' TStar=', TStar, ' QH_Init=', QH_Init, "kdown=", forcing%kdown, "L_mod=", L_mod
!WRITE (*, *) 'UStar=', UStar, ' TStar=', TStar, ' QH_Init=', QH_Init, "kdown=", forcing%kdown, "L_mod=", L_mod
!===================Resistance Calculations End=======================

!===================Calculate surface hydrology and related soil water=======================
Expand Down Expand Up @@ -2867,6 +2879,7 @@ SUBROUTINE SUEWS_cal_Main_DTS( &
runoffAGveg, runoffAGimpervious, rss_surf)
!======== Evaporation and surface state_id end========
END IF

! IF (Diagnose == 1) PRINT *, 'before SUEWS_cal_SoilState soilstore_id = ', soilstore_surf_next
IF (methodPrm%Diagnose == 1) PRINT *, 'before SUEWS_cal_SoilState soilstore_id = ', hydroState_next%soilstore_surf

Expand Down Expand Up @@ -2941,7 +2954,7 @@ SUBROUTINE SUEWS_cal_Main_DTS( &
RA_h, &
qh, qh_residual, qh_resist, & !output
qh_resist_surf, qh_resist_roof, qh_resist_wall)
! PRINT *, 'qn: ', qn, "qf: ", qf, "qe: ", qe, "qs: ", qs
PRINT *, 'qn: ', qn, "qf: ", qf, "qe: ", qe, "qs: ", qs
! PRINT *, 'qn_surf after SUEWS_cal_QH', qn_surf
! PRINT *, 'qs_surf after SUEWS_cal_QH', qs_surf
! PRINT *, 'qe_surf after SUEWS_cal_QH', qe_surf
Expand Down Expand Up @@ -9174,6 +9187,21 @@ SUBROUTINE SUEWS_cal_QE_DTS( &
vpd_hPa, avdens, avcp, qn_e_wall, s_hPa, psyc_hPa, RS, RA_h, RB, tlv, &
rss_wall, ev_wall, qe_wall) !output

WRITE (*, *) 'StateLimit_roof', StateLimit_roof
WRITE (*, *) 'SoilStoreCap_roof', SoilStoreCap_roof
WRITE (*, *) 'WetThresh_roof', WetThresh_roof
WRITE (*, *) 'state_roof_in', state_roof_in
WRITE (*, *) 'soilstore_roof_in', soilstore_roof_in
WRITE (*, *) 'StateLimit_wall', StateLimit_wall
WRITE (*, *) 'SoilStoreCap_wall', SoilStoreCap_wall
WRITE (*, *) 'WetThresh_wall', WetThresh_wall
WRITE (*, *) 'state_wall_in', state_wall_in
WRITE (*, *) 'soilstore_wall_in', soilstore_wall_in

WRITE (*, *) "hydroState_next%state_roof", hydroState_next%state_roof
WRITE (*, *) "hydroState_next%soilstore_roof", hydroState_next%soilstore_roof
WRITE (*, *) "hydroState_next%state_wall", hydroState_next%state_wall
WRITE (*, *) "hydroState_next%soilstore_wall", hydroState_next%soilstore_wall
! == calculate water balance ==
! --- building facets: roofs and walls ---
CALL cal_water_storage_building( &
Expand Down Expand Up @@ -13265,17 +13293,16 @@ SUBROUTINE SUEWS_cal_multitsteps( &

ALLOCATE (heatState%temp_roof(nlayer, ndepth))
ALLOCATE (heatState%temp_wall(nlayer, ndepth))
ALLOCATE (heatState%temp_surf(nsurf, ndepth))
ALLOCATE (heatState%tsfc_roof(nlayer))
ALLOCATE (heatState%tsfc_wall(nlayer))
ALLOCATE (heatState%tsfc_surf(nsurf))
ALLOCATE (heatState%temp_surf(nsurf, ndepth))
heatState%temp_roof = temp_roof
heatState%temp_wall = temp_wall
heatState%temp_surf = temp_surf
heatState%tsfc_roof = tsfc_roof
heatState%tsfc_wall = tsfc_wall
heatState%tsfc_surf = tsfc_surf
heatState%temp_surf = temp_surf

! OHM related:
ohmState%qn_av = qn_av
Expand Down
2 changes: 1 addition & 1 deletion src/suews/src/suews_phys_ehc.f95
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ SUBROUTINE EHC( &
! PRINT *, 'translation for roof! '
! TODO: to update with actual values from input files
tsfc_cal(1:nfacet) = tsfc_roof(1:nfacet)
! PRINT *, 'tsfc_cal for roof! ', tsfc_cal
tin_cal(1:nfacet) = tin_roof(1:nfacet)
! PRINT *, 'tin_cal for roof! ', tin_cal
temp_cal(1:nfacet, 1:ndepth) = temp_in_roof(1:nfacet, 1:ndepth)
Expand Down Expand Up @@ -446,6 +445,7 @@ SUBROUTINE EHC( &

! all standard suews surfaces
qs = DOT_PRODUCT(QS_surf, sfr_surf)
!PRINT *, 'QS_surf in ESTM_ehc', QS_surf

END SUBROUTINE EHC

Expand Down
2 changes: 1 addition & 1 deletion src/supy/supy/sample_run/RunControl.nml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SnowUse = 0
NetRadiationMethod = 3
EmissionsMethod = 2
BaseTMethod = 1
StorageHeatMethod = 1
StorageHeatMethod = 5
OHMIncQF = 0
StabilityMethod = 3
RoughLenHeatMethod = 2
Expand Down

0 comments on commit 909141e

Please sign in to comment.