2 ! ======================================================================================
3 ! This file was generated by the version 5.4.0 of DFT on 12/23/2010. The differentiation
4 ! transforming system(DFT) was jointly developed and sponsored by LASG of IAP(1998-2010)
5 ! and LSEC of ICMSEC, AMSS(2001-2003)
6 ! The copyright of the DFT system was declared by Walls at LASG, 1998-2010
7 ! ======================================================================================
8 ! corrected by zzma on 01/10/2011
10 MODULE g_module_microphysics_zero_out
14 SUBROUTINE g_microphysics_zero_outa(moist_new,g_moist_new,n_moist,config_flags, &
15 ids,ide,jds,jde,kds,kde,ims,ime,jms,jme,kms,kme,its,ite,jts,jte,kts,kte)
17 USE module_state_description
23 TYPE(grid_config_rec_type) :: config_flags
24 INTEGER :: ids,ide,jds,jde,kds,kde
25 INTEGER :: ims,ime,jms,jme,kms,kme
26 INTEGER :: its,ite,jts,jte,kts,kte
28 REAL,DIMENSION(ims:ime,kms:kme,jms:jme,n_moist) :: moist_new,g_moist_new
31 IF( config_flags%mp_zero_out .EQ. 0 ) THEN
32 ELSE IF( config_flags%mp_zero_out .EQ. 1 ) THEN
33 CALL wrf_debug ( 100 , 'zero out small condensates, vapor not included')
35 DO n =PARAM_FIRST_SCALAR,n_moist
36 IF( n .NE. P_QV ) THEN
40 IF( moist_new(i,k,j,n) .LT. config_flags%mp_zero_out_thresh ) g_moist_new(i,k,j,n) =0.0
41 IF( moist_new(i,k,j,n) .LT. config_flags%mp_zero_out_thresh ) moist_new(i,k,j,n) =0.
47 ELSE IF( config_flags%mp_zero_out .EQ. 2 ) then
48 CALL wrf_debug ( 100 , 'zero out small condensates, zero out negative vapor')
50 DO n =PARAM_FIRST_SCALAR,n_moist
52 IF( n .NE. P_QV ) THEN
57 IF( moist_new(i,k,j,n) .LT. config_flags%mp_zero_out_thresh ) g_moist_new(i,k,j,n) =0.0
58 IF( moist_new(i,k,j,n) .LT. config_flags%mp_zero_out_thresh ) moist_new(i,k,j,n) =0.
62 ELSE IF( n .EQ. P_QV ) THEN
68 g_moist_new(i,k,j,n) =(g_moist_new(i,k,j,n) +g_moist_new(i,k,j,n)*sign(1.0, moist_new(i,k,j,n)))*0.5
69 moist_new(i,k,j,n) =max(moist_new(i,k,j,n),0.)
78 END SUBROUTINE g_microphysics_zero_outa
80 SUBROUTINE g_microphysics_zero_outb(moist_new,g_moist_new,n_moist,config_flags, &
81 ids,ide,jds,jde,kds,kde,ims,ime,jms,jme,kms,kme,its,ite,jts,jte,kts,kte)
83 USE module_state_description
89 TYPE(grid_config_rec_type) :: config_flags
90 INTEGER :: ids,ide,jds,jde,kds,kde
91 INTEGER :: ims,ime,jms,jme,kms,kme
92 INTEGER :: its,ite,jts,jte,kts,kte
94 REAL,DIMENSION(ims:ime,kms:kme,jms:jme,n_moist) :: moist_new,g_moist_new
97 IF( config_flags%mp_zero_out .NE. 0 ) THEN
99 DO n =PARAM_FIRST_SCALAR,n_moist
102 IF( ( j .GE. jts ) .AND. ( j .LE. MIN( jte , jde-1) ) ) THEN
105 DO i =its,min(ite,ide-1)
107 g_moist_new(i,k,j,n) =(g_moist_new(i,k,j,n) +g_moist_new(i,k,j,n)*sign(1.0, moist_new(i,k,j,n) ))*0.5
108 moist_new(i,k,j,n) =max(moist_new(i,k,j,n),0.)
116 IF( ( j .GE. jts ) .AND. ( j .LE. MIN( jte , jde-1) ) ) THEN
119 DO i =its,min(ite,ide-1)
121 g_moist_new(i,k,j,n) =(g_moist_new(i,k,j,n) +g_moist_new(i,k,j,n)*sign(1.0, moist_new(i,k,j,n) ))*0.5
122 moist_new(i,k,j,n) =max(moist_new(i,k,j,n),0.)
130 IF( ( i .GE. its ) .AND. ( i .LE. MIN( ite , ide-1) ) ) THEN
132 DO j =jts,min(jte,jde-1)
135 g_moist_new(i,k,j,n) =(g_moist_new(i,k,j,n) +g_moist_new(i,k,j,n)*sign(1.0, moist_new(i,k,j,n) ))*0.5
136 moist_new(i,k,j,n) =max(moist_new(i,k,j,n),0.)
144 IF( ( i .GE. its ) .AND. ( i .LE. MIN( ite , ide-1) ) ) THEN
146 DO j =jts,min(jte,jde-1)
149 g_moist_new(i,k,j,n) =(g_moist_new(i,k,j,n) +g_moist_new(i,k,j,n) *sign(1.0, moist_new(i,k,j,n) ))*0.5
150 moist_new(i,k,j,n) =max(moist_new(i,k,j,n),0.)
159 END SUBROUTINE g_microphysics_zero_outb
161 END MODULE g_module_microphysics_zero_out