2 ! ======================================================================================
3 ! This file was generated by the version 4.4.0 of ADG on 12/23/2010. The Adjoint Code
4 ! Generator (ADG) was developed and sponsored by LASG of IAP (1999-2010)
5 ! The Copyright of the ADG system was declared by Walls at LASG, 1999-2010
6 ! ======================================================================================
7 ! corrrected by zzma on 01/10/2011
9 MODULE a_module_microphysics_zero_out
13 SUBROUTINE a_microphysics_zero_outa(moist_new,a_moist_new,n_moist,config_flags, &
14 ids,ide,jds,jde,kds,kde,ims,ime,jms,jme,kms,kme,its,ite,jts,jte,kts,kte)
16 !PART I: DECLARATION OF VARIABLES
18 USE module_state_description
24 INTEGER :: K0_ADJ,K1_ADJ,K2_ADJ,K3_ADJ
25 TYPE(grid_config_rec_type) :: config_flags
26 INTEGER :: ids,ide,jds,jde,kds,kde
27 INTEGER :: ims,ime,jms,jme,kms,kme
28 INTEGER :: its,ite,jts,jte,kts,kte
30 REAL,DIMENSION(ims:ime,kms:kme,jms:jme,n_moist) :: moist_new,a_moist_new
33 IF( config_flags%mp_zero_out .EQ. 0 ) THEN
34 ELSE IF( config_flags%mp_zero_out .EQ. 1 ) THEN
35 CALL wrf_debug ( 100 , 'zero out small condensates, vapor not included')
36 DO n =PARAM_FIRST_SCALAR, n_moist
37 IF( n .NE. P_QV ) THEN
41 IF( moist_new(i,k,j,n) .LT. config_flags%mp_zero_out_thresh ) THEN
42 a_moist_new(i,k,j,n) =0.
50 ELSE IF( config_flags%mp_zero_out .EQ. 2 ) then
51 CALL wrf_debug ( 100 , 'zero out small condensates, zero out negative vapor')
52 DO n =PARAM_FIRST_SCALAR, n_moist
53 IF( n .NE. P_QV ) THEN
58 IF( moist_new(i,k,j,n) .LT. config_flags%mp_zero_out_thresh ) THEN
59 a_moist_new(i,k,j,n) =0.0
65 ELSE IF( n .EQ. P_QV ) THEN
70 a_moist_new(i,k,j,n) =(1.0 +(1.0)*sign(1.0,moist_new(i,k,j,n)-0.))*0.5*a_moist_new(i,k,j,n)
80 END SUBROUTINE a_microphysics_zero_outa
82 SUBROUTINE a_microphysics_zero_outb(moist_new,a_moist_new,n_moist,config_flags, &
83 ids,ide,jds,jde,kds,kde,ims,ime,jms,jme,kms,kme,its,ite,jts,jte,kts,kte)
85 !PART I: DECLARATION OF VARIABLES
87 USE module_state_description
93 INTEGER :: K0_ADJ,K1_ADJ,K2_ADJ,K3_ADJ
94 TYPE(grid_config_rec_type) :: config_flags
95 INTEGER :: ids,ide,jds,jde,kds,kde
96 INTEGER :: ims,ime,jms,jme,kms,kme
97 INTEGER :: its,ite,jts,jte,kts,kte
99 REAL,DIMENSION(ims:ime,kms:kme,jms:jme,n_moist) :: moist_new,a_moist_new
102 IF( config_flags%mp_zero_out .NE. 0 ) THEN
103 DO n =n_moist, PARAM_FIRST_SCALAR, -1
106 IF( ( i .GE. its ) .AND. ( i .LE. MIN( ite , ide-1) ) ) THEN
107 DO j =min(jte, jde-1), jts, -1
109 a_moist_new(i,k,j,n) =(1.0 +(1.0)*sign(1.0,moist_new(i,k,j,n)-0.))*0.5*a_moist_new(i,k,j,n)
115 IF( ( i .GE. its ) .AND. ( i .LE. MIN( ite , ide-1) ) ) THEN
116 DO j =min(jte, jde-1), jts, -1
118 a_moist_new(i,k,j,n) =(1.0 +(1.0)*sign(1.0,moist_new(i,k,j,n)-0.))*0.5*a_moist_new(i,k,j,n)
124 IF( ( j .GE. jts ) .AND. ( j .LE. MIN( jte , jde-1) ) ) THEN
126 DO i =min(ite, ide-1), its, -1
127 a_moist_new(i,k,j,n) =(1.0 +(1.0)*sign(1.0,moist_new(i,k,j,n)-0.))*0.5*a_moist_new(i,k,j,n)
133 IF( ( j .GE. jts ) .AND. ( j .LE. MIN( jte , jde-1) ) ) THEN
135 DO i =min(ite, ide-1), its, -1
136 a_moist_new(i,k,j,n) =(1.0 +(1.0)*sign(1.0,moist_new(i,k,j,n)-0.))*0.5*a_moist_new(i,k,j,n)
146 END SUBROUTINE a_microphysics_zero_outb
148 END MODULE a_module_microphysics_zero_out