Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dyn_em/module_first_rk_step_part1.F
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& ,LF_URB2D=grid%lf_urb2d &
& ,lf_urb2d_s=grid%lf_urb2d_s, z0_urb2d=grid%z0_urb2d &
& ,GMT=grid%gmt,XLAT=grid%xlat,XLONG=grid%xlong,JULDAY=grid%julday &
& ,distributed_ahe_opt=grid%distributed_ahe_opt, ahe=grid%ahe & !For anthropogenic heat
& ,A_U_BEP=grid%a_u_bep,A_V_BEP=grid%a_v_bep,A_T_BEP=grid%a_t_bep &
& ,A_Q_BEP=grid%a_q_bep &
& ,B_U_BEP=grid%b_u_bep,B_V_BEP=grid%b_v_bep,B_T_BEP=grid%b_t_bep &
Expand Down
22 changes: 7 additions & 15 deletions phys/module_pbl_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -2269,23 +2269,15 @@ SUBROUTINE pbl_driver( &
,ITS=its,ITE=ite,JTS=jts,JTE=jte,KTS=kts,KTE=kte)
ENDIF

IF (distributed_ahe_opt > 0) THEN
IF (distributed_ahe_opt == 1) THEN
call cal_mon_day(julday, julyr, jmonth, jday)
ihour = (jmonth - 1) * 24 + MOD(INT(gmt + xtime / 60.0), 24)
IF (distributed_ahe_opt == 1) THEN
DO j = jts, jte
DO i = its, ite
! Volumetric heat capacity of air = 1200 J/(K m3)
RTHBLTEN(i, 1, j) = RTHBLTEN(i, 1, j) + ahe(i, ihour, j) / 1200 / DZ8W(i, 1, j)
END DO
END DO
ELSE IF (distributed_ahe_opt == 2) THEN
DO j = jts, jte
DO i = its, ite
HFX(i, j) = HFX(i, j) + ahe(i, ihour, j)
END DO
END DO
END IF
DO j = jts, jte
DO i = its, ite
! Volumetric heat capacity of air = 1200 J/(K m3)
RTHBLTEN(i, 1, j) = RTHBLTEN(i, 1, j) + ahe(i, ihour, j) / 1200 / DZ8W(i, 1, j)
END DO
END DO
END IF

ENDDO
Expand Down
46 changes: 44 additions & 2 deletions phys/module_sf_noahdrv.F
Original file line number Diff line number Diff line change
Expand Up @@ -2896,7 +2896,7 @@ SUBROUTINE lsm_mosaic(DZ8W,QV3D,P8W3D,T3D,TSK, &
REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(OUT) :: AKMS_URB2D
!
REAL, DIMENSION( ims:ime, jms:jme ), INTENT(OUT) :: UST_URB2D
REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: FRC_URB2D ! change this to inout, danli mosaic
REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FRC_URB2D ! change this to inout, danli mosaic
INTEGER, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: UTYPE_URB2D

! output variables urban --> lsm
Expand Down Expand Up @@ -3740,7 +3740,49 @@ SUBROUTINE lsm_mosaic(DZ8W,QV3D,P8W3D,T3D,TSK, &
IVGTYP(I,J) == LCZ_6 .or. IVGTYP(I,J) == LCZ_7 .or. IVGTYP(I,J) == LCZ_8 .or. &
IVGTYP(I,J) == LCZ_9 .or. IVGTYP(I,J) == LCZ_10 .or. IVGTYP(I,J) == LCZ_11 ) THEN

UTYPE_URB = UTYPE_URB2D(I,J) !urban type (low, high or industrial)
! UTYPE_URB = UTYPE_URB2D(I,J) !urban type (low, high or industrial)
Comment thread
epn09 marked this conversation as resolved.
! this need to be changed in the mosaic danli
IF (slucm_distributed_drag) THEN
IF (IVGTYP(I, J) == ISURBAN) THEN
UTYPE_URB = 2
FRC_URB2D(I, J) = MAX(0.1, MIN(0.9, 1 - shdavg(I, J) / 100.))
END IF
ELSE IF (use_wudapt_lcz == 1) THEN
IF(IVGTYP(I,J)==ISURBAN) UTYPE_URB=5
IF(IVGTYP(I,J)==LCZ_1) UTYPE_URB=1
IF(IVGTYP(I,J)==LCZ_2) UTYPE_URB=2
IF(IVGTYP(I,J)==LCZ_3) UTYPE_URB=3
IF(IVGTYP(I,J)==LCZ_4) UTYPE_URB=4
IF(IVGTYP(I,J)==LCZ_5) UTYPE_URB=5
IF(IVGTYP(I,J)==LCZ_6) UTYPE_URB=6
IF(IVGTYP(I,J)==LCZ_7) UTYPE_URB=7
IF(IVGTYP(I,J)==LCZ_8) UTYPE_URB=8
IF(IVGTYP(I,J)==LCZ_9) UTYPE_URB=9
IF(IVGTYP(I,J)==LCZ_10) UTYPE_URB=10
IF(IVGTYP(I,J)==LCZ_11) UTYPE_URB=11


IF(UTYPE_URB==1) FRC_URB2D(I,J)=1.
IF(UTYPE_URB==2) FRC_URB2D(I,J)=0.99
IF(UTYPE_URB==3) FRC_URB2D(I,J)=1.00
IF(UTYPE_URB==4) FRC_URB2D(I,J)=0.65
IF(UTYPE_URB==5) FRC_URB2D(I,J)=0.7
IF(UTYPE_URB==6) FRC_URB2D(I,J)=0.65
IF(UTYPE_URB==7) FRC_URB2D(I,J)=0.3
IF(UTYPE_URB==8) FRC_URB2D(I,J)=0.85
IF(UTYPE_URB==9) FRC_URB2D(I,J)=0.3
IF(UTYPE_URB==10) FRC_URB2D(I,J)=0.55
IF(UTYPE_URB==11) FRC_URB2D(I,J)=1.
ELSE
IF(IVGTYP(I,J)==ISURBAN) UTYPE_URB=2
IF(IVGTYP(I,J)==LCZ_1) UTYPE_URB=1 ! LOW_DENSITY_RESIDENTIAL
IF(IVGTYP(I,J)==LCZ_2) UTYPE_URB=2 ! HIGH_DENSITY_RESIDENTIAL
IF(IVGTYP(I,J)==LCZ_3) UTYPE_URB=3 ! HIGH_INTENSITY_INDUSTRIAL

IF(UTYPE_URB==1) FRC_URB2D(I,J)=0.5
IF(UTYPE_URB==2) FRC_URB2D(I,J)=0.9
IF(UTYPE_URB==3) FRC_URB2D(I,J)=0.95
END IF
Comment thread
epn09 marked this conversation as resolved.

TA_URB = SFCTMP ! [K]
QA_URB = Q2K ! [kg/kg]
Expand Down
25 changes: 20 additions & 5 deletions phys/module_surface_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ SUBROUTINE surface_driver( &
& ,bldt,curr_secs,adapt_step_flag,bldtacttime &
! Optional urban with BEP
& ,sf_urban_physics,gmt,xlat,xlong,julday &
& ,distributed_ahe_opt, ahe & !For anthropogenic heat
& ,num_urban_ndm & !multi-layer urban
& ,urban_map_zrd & !multi-layer urban
& ,urban_map_zwd & !multi-layer urban
Expand Down Expand Up @@ -395,6 +396,7 @@ SUBROUTINE surface_driver( &
USE module_sf_tmnupdate
USE module_sf_lake
USE module_cpl, ONLY : coupler_on, cpl_rcv
use module_ra_gfdleta, only: cal_mon_day

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires adding dependency in main/depend.common.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiwangncar Please check if I've added the dependency correctly. I think this the cal_mon_day function can be move to some library module instead of radiation module. But let's save it for later.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree it is odd that this comes from a radiation option that we don't use much but so far the urban options use it.

!
! This driver calls subroutines for the surface parameterizations.
!
Expand Down Expand Up @@ -942,6 +944,8 @@ SUBROUTINE surface_driver( &
! Variables for multi-layer UCM
REAL, OPTIONAL, INTENT(IN ) :: GMT
INTEGER, OPTIONAL, INTENT(IN ) :: JULDAY
INTEGER, INTENT(IN) :: distributed_ahe_opt
REAL, OPTIONAL, DIMENSION( ims:ime, 0:287, jms:jme ), INTENT(IN) :: ahe
REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN ) ::XLAT, XLONG
INTEGER , INTENT(IN) :: num_urban_ndm
INTEGER , INTENT(IN) :: urban_map_zrd
Expand Down Expand Up @@ -1455,14 +1459,10 @@ SUBROUTINE surface_driver( &

real, optional, dimension(ims:ime,jms:jme ),intent(inout) :: XLAIDYN
! IRRIGATION
INTEGER :: tloc, jmonth,timing
REAL, PARAMETER :: PI_GRECO=3.14159
INTEGER :: end_hour, irr_start,xt24,irr_day
REAL :: constants_irrigation

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this looks like valid clean-up

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dudhia @epn09 Why should these lines be removed for this PR?

@epn09 epn09 Feb 22, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiwangncar They are unused variables. Keeping them or removing them do not change the functionality of the program.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epn09 I understand. But we generally do not want un-related change to be put in a single PR. We may allow it for this time, if @dudhia and @cenlinhe are ok with it. If so, please document the change in your PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as it has no effect, it can be combined but the PR should list it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Jimy.

INTEGER :: ihour, jmonth, jday
REAL, DIMENSION( ims:ime, jms:jme ) :: IRRIGATION_CHANNEL
REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) , OPTIONAL:: IRRIGATION
REAL, INTENT(IN),OPTIONAL:: irr_daily_amount
INTEGER :: phase
INTEGER, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT),OPTIONAL :: irr_rand_field
INTEGER, INTENT(IN ),OPTIONAL:: sf_surf_irr_scheme,irr_start_hour,irr_num_hours,irr_start_julianday,irr_end_julianday,irr_freq,irr_ph

Expand Down Expand Up @@ -4482,6 +4482,21 @@ SUBROUTINE surface_driver( &
ENDIF
ENDIF

IF (distributed_ahe_opt == 2) THEN
call cal_mon_day(julday, julyr, jmonth, jday)
ihour = (jmonth - 1) * 24 + MOD(INT(gmt + xtime / 60.0), 24)
!$OMP PARALLEL DO &
!$OMP PRIVATE ( ij, i, j, k )
DO ij = 1, num_tiles
DO j = j_start(ij), j_end(ij)
DO i = i_start(ij), i_end(ij)
HFX(i, j) = HFX(i, j) + ahe(i, ihour, j)
END DO
END DO
END DO
!$OMP END PARALLEL DO
END IF

ENDIF run_param_if

END SUBROUTINE surface_driver
Expand Down