Skip to content

Commit

Permalink
Merge branch 'release-v4.5-WRF' of github.com:NCAR/noahmp into v4.5.1…
Browse files Browse the repository at this point in the history
…-devel

To include fixes for NCAR#91, NCAR#92, SLUCM ground flux and snow combination layer index
  • Loading branch information
jesusff committed Oct 19, 2023
2 parents cffe51d + 218eb5a commit 5fe2e72
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions drivers/wrf/module_sf_noahmpdrv.F
Original file line number Diff line number Diff line change
Expand Up @@ -3505,7 +3505,7 @@ SUBROUTINE noahmp_urban(sf_urban_physics, NSOIL, IVGTYP, ITIMESTEP,
QFX(I,J) = FRC_URB2D(I,J) * LH_KINEMATIC_URB &
+ (1-FRC_URB2D(I,J))* QFX(I,J) ![kg/m/m/s]
LH(I,J) = FRC_URB2D(I,J) * LH_URB + (1-FRC_URB2D(I,J)) * LH(I,J) ![W/m/m]
GRDFLX(I,J) = FRC_URB2D(I,J) * (G_URB) + (1-FRC_URB2D(I,J)) * GRDFLX(I,J) ![W/m/m]
GRDFLX(I,J) = FRC_URB2D(I,J) * (G_URB*(-1.0)) + (1-FRC_URB2D(I,J)) * GRDFLX(I,J) ![W/m/m] positive: downward direction
TSK(I,J) = FRC_URB2D(I,J) * TS_URB + (1-FRC_URB2D(I,J)) * TSK(I,J) ![K]
! Q1 = QSFC(I,J)/(1.0+QSFC(I,J))
! Q1 = FRC_URB2D(I,J) * QS_URB + (1-FRC_URB2D(I,J)) * Q1 ![-]
Expand Down Expand Up @@ -3734,7 +3734,7 @@ SUBROUTINE noahmp_urban(sf_urban_physics, NSOIL, IVGTYP, ITIMESTEP,

! rename *_urb to sh_urb2d,lh_urb2d,g_urb2d,rn_urb2d

grdflx(i,j) = (1.-frc_urb2d(i,j))*grdflx_rural(i,j)+ frc_urb2d(i,j)*grdflx_urb(i,j)
grdflx(i,j) = (1.-frc_urb2d(i,j))*grdflx_rural(i,j)+ frc_urb2d(i,j)*grdflx_urb(i,j)*(-1.0) ! positive: downward direction
qfx(i,j) = (1.-frc_urb2d(i,j))*qfx_rural(i,j) + qfx_urb(i,j)
lh(i,j) = qfx(i,j)*xlv
hfx(i,j) = hfx_urb(i,j) + (1-frc_urb2d(i,j))*hfx_rural(i,j) ![W/m/m]
Expand Down
24 changes: 13 additions & 11 deletions src/module_sf_noahmplsm.F
Original file line number Diff line number Diff line change
Expand Up @@ -3935,21 +3935,21 @@ SUBROUTINE VEGE_FLUX(parameters,NSNOW ,NSOIL ,ISNOW ,VEGTYP ,VEG , &
IF(ITER == 1) THEN
IF (OPT_CRS == 1) then ! Ball-Berry
CALL STOMATA (parameters,VEGTYP,MPE ,PARSUN ,FOLN ,ILOC , JLOC , & !in
TV ,ESTV ,EAH ,SFCTMP,SFCPRS, & !in
TV ,ESTV ,EAH ,SFCTMP,SFCPRS, FVEG, & !in
O2AIR ,CO2AIR,IGS ,BTRAN ,RB , & !in
RSSUN ,PSNSUN) !out

CALL STOMATA (parameters,VEGTYP,MPE ,PARSHA ,FOLN ,ILOC , JLOC , & !in
TV ,ESTV ,EAH ,SFCTMP,SFCPRS, & !in
TV ,ESTV ,EAH ,SFCTMP,SFCPRS, FVEG, & !in
O2AIR ,CO2AIR,IGS ,BTRAN ,RB , & !in
RSSHA ,PSNSHA) !out
END IF

IF (OPT_CRS == 2) then ! Jarvis
CALL CANRES (parameters,PARSUN,TV ,BTRAN ,EAH ,SFCPRS, & !in
CALL CANRES (parameters,PARSUN,TV ,BTRAN ,EAH ,SFCPRS, FVEG, & !in
RSSUN ,PSNSUN,ILOC ,JLOC ) !out

CALL CANRES (parameters,PARSHA,TV ,BTRAN ,EAH ,SFCPRS, & !in
CALL CANRES (parameters,PARSHA,TV ,BTRAN ,EAH ,SFCPRS, FVEG, & !in
RSSHA ,PSNSHA,ILOC ,JLOC ) !out
END IF

Expand Down Expand Up @@ -5003,7 +5003,7 @@ END SUBROUTINE ESAT
!== begin stomata ==================================================================================

SUBROUTINE STOMATA (parameters,VEGTYP ,MPE ,APAR ,FOLN ,ILOC , JLOC, & !in
TV ,EI ,EA ,SFCTMP ,SFCPRS , & !in
TV ,EI ,EA ,SFCTMP ,SFCPRS , FVEG, & !in
O2 ,CO2 ,IGS ,BTRAN ,RB , & !in
RS ,PSN ) !out
! --------------------------------------------------------------------------------------------------
Expand All @@ -5017,7 +5017,7 @@ SUBROUTINE STOMATA (parameters,VEGTYP ,MPE ,APAR ,FOLN ,ILOC , JLO

REAL, INTENT(IN) :: IGS !growing season index (0=off, 1=on)
REAL, INTENT(IN) :: MPE !prevents division by zero errors

REAL, INTENT(IN) :: FVEG !vegetation greeness fraction
REAL, INTENT(IN) :: TV !foliage temperature (k)
REAL, INTENT(IN) :: EI !vapor pressure inside leaf (sat vapor press at tv) (pa)
REAL, INTENT(IN) :: EA !vapor pressure of canopy air (pa)
Expand Down Expand Up @@ -5076,6 +5076,7 @@ SUBROUTINE STOMATA (parameters,VEGTYP ,MPE ,APAR ,FOLN ,ILOC , JLO
! initialize RS=RSMAX and PSN=0 because will only do calculations
! for APAR > 0, in which case RS <= RSMAX and PSN >= 0

APAR = APAR / max(FVEG,1.0e-6) ! scaling APAR back to stand scale
CF = SFCPRS/(8.314*SFCTMP)*1.0e06
RS = 1.0/parameters%BP * CF
PSN = 0.0
Expand Down Expand Up @@ -5135,7 +5136,7 @@ END SUBROUTINE STOMATA

!== begin canres ===================================================================================

SUBROUTINE CANRES (parameters,PAR ,SFCTMP,RCSOIL ,EAH ,SFCPRS , & !in
SUBROUTINE CANRES (parameters,PAR ,SFCTMP,RCSOIL ,EAH ,SFCPRS , FVEG, & !in
RC ,PSN ,ILOC ,JLOC ) !out

! --------------------------------------------------------------------------------------------------
Expand All @@ -5162,7 +5163,7 @@ SUBROUTINE CANRES (parameters,PAR ,SFCTMP,RCSOIL ,EAH ,SFCPRS , & !in
REAL, INTENT(IN) :: SFCPRS !surface pressure (pa)
REAL, INTENT(IN) :: EAH !water vapor pressure (pa)
REAL, INTENT(IN) :: RCSOIL !soil moisture stress factor

REAL, INTENT(IN) :: FVEG !vegetation greeness fraction
!outputs

REAL, INTENT(OUT) :: RC !canopy resistance per unit LAI
Expand All @@ -5186,6 +5187,7 @@ SUBROUTINE CANRES (parameters,PAR ,SFCTMP,RCSOIL ,EAH ,SFCPRS , & !in
RCS = 0.0
RCT = 0.0
RCQ = 0.0
PAR = PAR / max(FVEG,1.0e-6) ! scaling PAR back to stand scale

! compute Q2 and Q2SAT

Expand Down Expand Up @@ -6315,7 +6317,7 @@ SUBROUTINE CANWATER (parameters,VEGTYP ,DT , & !in
! --------------------------- liquid water ------------------------------
! maximum canopy water

MAXLIQ = parameters%CH2OP * (ELAI+ ESAI)
MAXLIQ = FVEG * parameters%CH2OP * (ELAI+ ESAI)

! evaporation, transpiration, and dew

Expand Down Expand Up @@ -6343,7 +6345,7 @@ SUBROUTINE CANWATER (parameters,VEGTYP ,DT , & !in
! --------------------------- canopy ice ------------------------------
! for canopy ice

MAXSNO = 6.6*(0.27+46.0/BDFALL) * (ELAI+ ESAI)
MAXSNO = FVEG * 6.6*(0.27+46.0/BDFALL) * (ELAI+ ESAI)

QSUBC = MIN(CANICE/DT,QSUBC)
CANICE= MAX(0.0,CANICE + (QFROC-QSUBC)*DT)
Expand Down Expand Up @@ -6654,7 +6656,7 @@ SUBROUTINE COMBINE (parameters,NSNOW ,NSOIL ,ILOC ,JLOC , & !in
SNICE(J+1) = SNICE(J+1) + SNICE(J)
DZSNSO(J+1) = DZSNSO(J+1) + DZSNSO(J)
ELSE
IF (ISNOW_OLD < -1) THEN ! MB/KM: change to ISNOW
IF (ISNOW < -1) THEN ! MB/KM: change to ISNOW
SNLIQ(J-1) = SNLIQ(J-1) + SNLIQ(J)
SNICE(J-1) = SNICE(J-1) + SNICE(J)
DZSNSO(J-1) = DZSNSO(J-1) + DZSNSO(J)
Expand Down

0 comments on commit 5fe2e72

Please sign in to comment.