Skip to content

Commit b3eebb3

Browse files
authored
Update how fogdes identifies land use type (#2110)
TYPE: bug fix KEYWORDS: grav_setting, LCZ SOURCE: Adam Dury (WeatherQuest) DESCRIPTION OF CHANGES: Problem: WRF crashes when grav_settling is greater than 0 and wudapt_lcz = 1 due to the historical code using hard coded values for land categories to detect which land use type is being used. This isn't the case now so needed to update to use a variable with actual land use category type so the grav_settling code would work when wudapt_lcz was turned on and the nlcat wasnt the same for each land use type. Solution: Changed the if statements to use mminlu rather than nlcat so that the grav_settling option knows what land use dataset is being used. Corrected the error message to go into rsl.error files rather than rsl.out files LIST OF MODIFIED FILES: phys/module_sf_fogdes.f phys/module_surface_driver.f TESTS CONDUCTED: 1. Tested with wudapt_lcz on and off with all option of grav_settling. 2. The Jenkins tests are all passing. RELEASE NOTE: Updated grav_settling code to better recognize the land use type so it doesn't crash. Also update the error message if it does crash to go into the rsl.error files rather than rsl.out files.
1 parent bb791e7 commit b3eebb3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

phys/module_sf_fogdes.F

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ MODULE module_sf_fogdes
1313

1414
SUBROUTINE sf_fogdes(&
1515
vdfg,fgdp,dfgdp,ivgtyp,lai,wspd,qc_curr, &
16-
dtbl,rho,dz8w,grav_settling,nlcat, &
16+
dtbl,rho,dz8w,grav_settling,nlcat,mminlu, &
1717
ids,ide, jds,jde, kds,kde, &
1818
ims,ime, jms,jme, kms,kme, &
1919
its,ite, jts,jte, kts,kte &
@@ -81,7 +81,7 @@ SUBROUTINE sf_fogdes(&
8181
,ids,ide,jds,jde,kds,kde
8282

8383
INTEGER, INTENT(IN) :: grav_settling,nlcat
84-
84+
CHARACTER (LEN=*), INTENT(IN):: mminlu
8585
INTEGER,DIMENSION( ims:ime , jms:jme ),INTENT(INOUT) :: ivgtyp
8686

8787
REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), &
@@ -105,18 +105,20 @@ SUBROUTINE sf_fogdes(&
105105
!JOE-end
106106

107107
! Local variables
108+
CHARACTER*512 :: message
108109
INTEGER :: i,j
109110
REAL :: lad, spcfct, vegh, ftmp1, ftmp2, dp_fog, lwc
110111
CHARACTER (LEN=25) :: land_use_type, lu_fogdes
111112

112113
!------------------------------------------------------------------
113114

114-
IF ((nlcat .eq. 20).or.(nlcat .eq. 21)) THEN ! includes lake category
115+
IF (mminlu .eq. 'MODIFIED_IGBP_MODIS_NOAH') THEN ! includes lake category
115116
land_use_type = 'MODIS'
116-
ELSEIF ((nlcat .eq. 24).or.(nlcat .eq. 28)) THEN ! includes lake category
117+
ELSEIF (mminlu .eq. 'USGS') THEN ! includes lake category
117118
land_use_type = 'USGS'
118119
ELSE
119-
PRINT *, 'Unknown landuse category (sf_fogdes.F): num_land_cat=',nlcat
120+
write ( message, * ) "Unknown land category for grav_settling (sf_fogdes.F) Landuse type = ",mminlu," and number of land categories= ",nlcat
121+
CALL wrf_error_fatal ( message )
120122
STOP
121123
END IF
122124

phys/module_surface_driver.F

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2509,7 +2509,7 @@ SUBROUTINE surface_driver( &
25092509

25102510
CALL sf_fogdes( &
25112511
vdfg,fgdp,dfgdp,ivgtyp,lai,wspd,qc_curr, &
2512-
dtbl,rho,dz8w,grav_settling,nlcat, &
2512+
dtbl,rho,dz8w,grav_settling,nlcat,mminlu, &
25132513
ids,ide, jds,jde, kds,kde, &
25142514
ims,ime, jms,jme, kms,kme, &
25152515
i_start(ij),i_end(ij), &

0 commit comments

Comments
 (0)