Skip to content

Commit 7a546f0

Browse files
committed
refactor: remove BaseTmethod parameter and always use weekday/weekend base temperatures
Removes the BaseTmethod parameter which controlled whether to use a single BaseT_HC value or separate weekday/weekend base temperatures for heating/ cooling degree day (HDD/CDD) calculations in the anthropogenic heat flux module. Changes: - Remove BaseTMethod parameter from suews_ctrl_const.f95 - Remove BaseTMethod and BaseT_HC from update_DailyState_Day subroutine - Always use weekday/weekend-specific BaseT_Heating and BaseT_Cooling arrays - Simplify HDD/CDD calculation logic by removing SELECT CASE branching This change aligns with the data model which already provides weekday/weekend base temperature profiles, and follows the removal of BaseT_HC from input files in SUEWS v2023a. Note: BaseT and BaseTe remain as separate parameters for vegetation LAI phenology calculations (growing degree days and senescence degree days). Addresses #144
1 parent 093df77 commit 7a546f0

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

src/suews/src/suews_ctrl_const.f95

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,6 @@ MODULE data_in
11301130

11311131
! ---- Model options set in RunControl --------------------------------------------------------
11321132
INTEGER :: EmissionsMethod, & ! anthropogenic emissions method
1133-
BaseTMethod, & ! base temperature method for HDD/CDD calculations used in QF module
11341133
CBLuse, & !CBL slab model used (1) or not used (0)
11351134
MultipleMetFiles, & !Indicates whether a single met file is used for all grids (0) or one for each grid (1)
11361135
MultipleInitFiles, & !Indicates whether a single initial conditions file is used for all grids (0) or one for each grid (1)

src/suews/src/suews_phys_dailystate.f95

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ SUBROUTINE SUEWS_cal_DailyState( &
8282
TYPE(SUEWS_STATE), INTENT(INOUT) :: modState
8383

8484
! INTEGER :: WaterUseMethod
85-
INTEGER, PARAMETER :: BaseTMethod = 2 ! base t method [-]
86-
REAL(KIND(1D0)), PARAMETER :: BaseT_HC = 18.2 !base temperature for heating degree dayb [degC] ! to be fully removed TODO
8785

8886
! TYPE(IRRIGATION_PRM), INTENT(IN) :: irrPrm
8987
! INTEGER :: Ie_start !Starting time of water use (DOY)
@@ -503,12 +501,10 @@ SUBROUTINE SUEWS_cal_DailyState( &
503501
! regular update at all timesteps of a day
504502
IF (execute_subroutines) THEN
505503
CALL update_DailyState_Day( &
506-
BaseTMethod, &
507504
DayofWeek_id, &
508505
avkdn, & !input
509506
Tair, &
510507
Precip, &
511-
BaseT_HC, &
512508
BaseT_Heating, BaseT_Cooling, &
513509
nsh_real, &
514510
Tmin_id, Tmax_id, lenDay_id, & !inout
@@ -746,26 +742,22 @@ END SUBROUTINE SUEWS_cal_DailyState
746742
! END SUBROUTINE update_DailyState_End
747743

748744
SUBROUTINE update_DailyState_Day( &
749-
BaseTMethod, &
750745
DayofWeek_id, &
751746
avkdn, & !input
752747
Tair, &
753748
Precip, &
754-
BaseT_HC, &
755749
BaseT_Heating, BaseT_Cooling, &
756750
nsh_real, &
757751
Tmin_id, Tmax_id, lenDay_id, & !inout
758752
HDD_id) !inout
759753
! use time, only: id, id_prev_t
760754
IMPLICIT NONE
761755

762-
INTEGER, INTENT(IN) :: BaseTMethod
763756
INTEGER, DIMENSION(3), INTENT(in) :: DayofWeek_id
764757

765758
REAL(KIND(1D0)), INTENT(IN) :: avkdn
766759
REAL(KIND(1D0)), INTENT(IN) :: Tair ! Ambient air temperature [degC], this can be from either forcing or diagnostic
767760
REAL(KIND(1D0)), INTENT(IN) :: Precip
768-
REAL(KIND(1D0)), INTENT(IN) :: BaseT_HC
769761
REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Heating
770762
REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Cooling
771763
REAL(KIND(1D0)), INTENT(IN) :: nsh_real
@@ -793,18 +785,9 @@ SUBROUTINE update_DailyState_Day( &
793785
iu = 1 !Set to 1=weekday
794786
IF (DayofWeek_id(1) == 1 .OR. DayofWeek_id(1) == 7) iu = 2 !Set to 2=weekend
795787

796-
SELECT CASE (BaseTMethod)
797-
CASE (1)
798-
BaseT_Heating_use = BaseT_HC
799-
BaseT_Cooling_use = BaseT_HC
800-
CASE (2)
801-
BaseT_Heating_use = BaseT_Heating(iu)
802-
BaseT_Cooling_use = BaseT_Cooling(iu)
803-
804-
CASE default
805-
CALL ErrorHint(75, "RunControl.nml", -999, -999, -999)
806-
807-
END SELECT
788+
! Use weekday/weekend-specific base temperatures for heating/cooling degree day calculations
789+
BaseT_Heating_use = BaseT_Heating(iu)
790+
BaseT_Cooling_use = BaseT_Cooling(iu)
808791

809792
! Daily min and max temp (these get updated through the day) ---------------------
810793
Tmin_id = MIN(Tair, Tmin_id) !Daily min T in column 3

0 commit comments

Comments
 (0)