I believe this was a bug, no idea how it was even working before
[WRF.git] / chem / module_dust_load.F
blob54ee373c87aa527334f38c715894ad9dec607d97
1 MODULE module_dust_load
3 ! This module for calculation of dust loading
4  CONTAINS
6    SUBROUTINE dust_load_driver ( config_flags,                         &
7             alt, chem, dz8w, dustload_1, dustload_2, dustload_3,       &
8             dustload_4, dustload_5,                                    &
9             ids,ide, jds,jde, kds,kde,                                 &
10             ims,ime, jms,jme, kms,kme,                                 &
11             its,ite, jts,jte, kts,kte                                  )
13    USE module_configure
14    IMPLICIT NONE
16    INTEGER,      INTENT(IN   )    ::                                   &
17                                       ids,ide, jds,jde, kds,kde,       &
18                                       ims,ime, jms,jme, kms,kme,       &
19                                       its,ite, jts,jte, kts,kte
21    REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),             &
22          INTENT(IN ) :: chem
24    REAL, DIMENSION( ims:ime, kms:kme, jms:jme ),                       &
25          INTENT(IN ) :: alt, dz8w
27    REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: dustload_1,   &
28                 dustload_2, dustload_3, dustload_4, dustload_5
30    TYPE(grid_config_rec_type),  INTENT(IN   )    :: config_flags
32    INTEGER :: i, j, k
34 !      do j=jts,jte
35 !       do i=its,ite
36        dustload_1(its:ite,jts:jte) = 0.
37        dustload_2(its:ite,jts:jte) = 0.
38        dustload_3(its:ite,jts:jte) = 0.
39        dustload_4(its:ite,jts:jte) = 0.
40        dustload_5(its:ite,jts:jte) = 0.
41 !       enddo
42 !      enddo
43      do j=jts,jte
44       do i=its,ite
45        do k=kts,kte
46 ! chem(p_dust) : [ug/kg_dryair], alt : [m3/kg], dz8w : [m] -> dustload : [ug/m2]
47         dustload_1(i,j)= dustload_1(i,j) + chem(i,k,j,p_dust_1)/alt(i,k,j) * dz8w(i,k,j)
48         dustload_2(i,j)= dustload_2(i,j) + chem(i,k,j,p_dust_2)/alt(i,k,j) * dz8w(i,k,j)
49         dustload_3(i,j)= dustload_3(i,j) + chem(i,k,j,p_dust_3)/alt(i,k,j) * dz8w(i,k,j)
50         dustload_4(i,j)= dustload_4(i,j) + chem(i,k,j,p_dust_4)/alt(i,k,j) * dz8w(i,k,j)
51         dustload_5(i,j)= dustload_5(i,j) + chem(i,k,j,p_dust_5)/alt(i,k,j) * dz8w(i,k,j)
52 !         if (j.eq.int(0.5*(ite-its)).and.i.eq.int(0.5*(jte-jts))) write(6,*) 'dload', chem(i,k,j,p_dust_5)
53        enddo
54       enddo
55      enddo
57    END SUBROUTINE dust_load_driver
59 END MODULE module_dust_load