Skip to content

Commit

Permalink
Fix undefined WDR and direction logic for urban option 1 (#1689)
Browse files Browse the repository at this point in the history
TYPE: bug fix

KEYWORDS: urban model WDR undefined before use
SOURCE: internal, reported by CWB, Taiwan

DESCRIPTION OF CHANGES:
Problem:
WDR was used before being defined in urban model. This is a wind direction used in computing the urban roughness length for local surface flux calculations.
Another problem was that logic for some directions was wrong in selecting the correct one of 4 frontal area directions.

Solution:
Uncomment WDR calculation (assumes grid is roughly y direction northwards) and correct direction if-tests.

LIST OF MODIFIED FILES:
M phys/module_sf_urban.F

TESTS CONDUCTED:
Compile only - recommend test for effect
The Jenkins tests are all passing.

RELEASE NOTE: minor fix for urban wind directions when using detailed urban morphology maps.
  • Loading branch information
dudhia authored Mar 15, 2022
1 parent c394ff0 commit 2be1982
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions phys/module_sf_urban.F
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ SUBROUTINE urban(LSOLAR, & ! L
SIGMA_ZED = stdh_urb

!Calculate Wind Direction and Assign Appropriae lf_urb
!WDR = (180.0/PI)*ATAN2(U10,V10)
WDR = (180.0/PI)*ATAN2(U10,V10)

IF(WDR.ge.0.0.and.WDR.lt.22.5)THEN
lambda_f = lf_urb(1)
Expand All @@ -698,15 +698,15 @@ SUBROUTINE urban(LSOLAR, & ! L
lambda_f = lf_urb(1)
ELSEIF(WDR.gt.22.5.and.WDR.le.67.5)THEN
lambda_f = lf_urb(2)
ELSEIF(WDR.ge.-67.5.and.WDR.lt.-22.5)THEN
ELSEIF(WDR.ge.-157.5.and.WDR.lt.-112.5)THEN
lambda_f = lf_urb(2)
ELSEIF(WDR.gt.67.5.and.WDR.le.112.5)THEN
lambda_f = lf_urb(3)
ELSEIF(WDR.ge.-112.5.and.WDR.lt.-67.5)THEN
lambda_f = lf_urb(3)
ELSEIF(WDR.gt.112.5.and.WDR.le.157.5)THEN
lambda_f = lf_urb(4)
ELSEIF(WDR.ge.-157.5.and.WDR.lt.-112.5)THEN
ELSEIF(WDR.ge.-67.5.and.WDR.lt.-22.5)THEN
lambda_f = lf_urb(4)
ELSE
lambda_f = lf_urb(1)
Expand Down

0 comments on commit 2be1982

Please sign in to comment.