1 !WRF:MEDIATION_LAYER:PHYSICS
3 MODULE module_microphysics_zero_out
6 SUBROUTINE microphysics_zero_outa ( &
9 ,ids,ide, jds,jde, kds,kde &
10 ,ims,ime, jms,jme, kms,kme &
11 ,its,ite, jts,jte, kts,kte )
14 USE module_state_description
19 TYPE (grid_config_rec_type) , INTENT(IN) :: config_flags
20 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde
21 INTEGER, INTENT(IN ) :: ims,ime, jms,jme, kms,kme
22 INTEGER, INTENT(IN ) :: its,ite, jts,jte, kts,kte
24 INTEGER, INTENT(IN ) :: n_moist
26 REAL, DIMENSION( ims:ime, kms:kme, jms:jme, n_moist ) :: moist_new
33 ! Zero out small condensate values FSL-BLS-12-JUL-2004
35 IF ( config_flags%mp_zero_out .EQ. 0 ) THEN
37 ELSE IF ( config_flags%mp_zero_out .EQ. 1 ) THEN
38 ! All of the "moist" fields, except for vapor, that are below a critical
39 ! threshold are set to zero.
40 CALL wrf_debug ( 100 , 'zero out small condensates, vapor not included')
41 DO n = PARAM_FIRST_SCALAR,n_moist
42 IF ( n .NE. P_QV ) THEN
46 IF ( moist_new(i,k,j,n) .LT. config_flags%mp_zero_out_thresh ) moist_new(i,k,j,n) =0.
52 ELSE IF ( config_flags%mp_zero_out .EQ. 2 ) then
53 ! All of the non-Qv "moist" fields that are below a critical threshold are set to
54 ! zero. The vapor is constrained to be non-negative.
55 CALL wrf_debug ( 100 , 'zero out small condensates, zero out negative vapor')
56 DO n = PARAM_FIRST_SCALAR,n_moist
57 IF ( n .NE. P_QV ) THEN
61 IF ( moist_new(i,k,j,n) .LT. config_flags%mp_zero_out_thresh ) moist_new(i,k,j,n) =0.
65 ELSE IF ( n .EQ. P_QV ) THEN
69 moist_new(i,k,j,n) = MAX ( moist_new(i,k,j,n) , 0. )
76 END SUBROUTINE microphysics_zero_outa
78 SUBROUTINE microphysics_zero_outb ( &
81 ,ids,ide, jds,jde, kds,kde &
82 ,ims,ime, jms,jme, kms,kme &
83 ,its,ite, jts,jte, kts,kte )
86 USE module_state_description
91 TYPE (grid_config_rec_type) , INTENT(IN) :: config_flags
92 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde
93 INTEGER, INTENT(IN ) :: ims,ime, jms,jme, kms,kme
94 INTEGER, INTENT(IN ) :: its,ite, jts,jte, kts,kte
96 INTEGER, INTENT(IN ) :: n_moist
98 REAL, DIMENSION( ims:ime, kms:kme, jms:jme, n_moist ) :: moist_new
104 ! Make sure that the boundary is .GE. 0 if the config_flags%mp_zero_out option is selected (1 or 2)
105 ! Just do the outer row/col, no interior points.
107 IF ( config_flags%mp_zero_out .NE. 0 ) THEN
108 DO n = PARAM_FIRST_SCALAR,n_moist
111 IF ( ( j .GE. jts ) .AND. ( j .LE. MIN( jte , jde-1) ) ) THEN
113 DO i = its , MIN ( ite , ide-1 )
114 moist_new(i,k,j,n) = MAX ( moist_new(i,k,j,n) , 0. )
120 IF ( ( j .GE. jts ) .AND. ( j .LE. MIN( jte , jde-1) ) ) THEN
122 DO i = its , MIN ( ite , ide-1 )
123 moist_new(i,k,j,n) = MAX ( moist_new(i,k,j,n) , 0. )
129 IF ( ( i .GE. its ) .AND. ( i .LE. MIN( ite , ide-1) ) ) THEN
130 DO j = jts , MIN ( jte , jde-1 )
132 moist_new(i,k,j,n) = MAX ( moist_new(i,k,j,n) , 0. )
138 IF ( ( i .GE. its ) .AND. ( i .LE. MIN( ite , ide-1) ) ) THEN
139 DO j = jts , MIN ( jte , jde-1 )
141 moist_new(i,k,j,n) = MAX ( moist_new(i,k,j,n) , 0. )
150 END SUBROUTINE microphysics_zero_outb
152 END MODULE module_microphysics_zero_out