| 1 | SUBROUTINE iniaerosol() |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | use radinc_h, only: naerkind |
|---|
| 5 | use aerosol_mod |
|---|
| 6 | use callkeys_mod, only: aeroco2,aeroh2o,dusttau,aeroh2so4, |
|---|
| 7 | & aeroback2lay,aeronh3, nlayaero, aeronlay, aeroaurora |
|---|
| 8 | |
|---|
| 9 | IMPLICIT NONE |
|---|
| 10 | c======================================================================= |
|---|
| 11 | c subject: |
|---|
| 12 | c -------- |
|---|
| 13 | c Initialization related to aerosols |
|---|
| 14 | c (CO2 aerosols, dust, water, chemical species, ice...) |
|---|
| 15 | c |
|---|
| 16 | c author: Laura Kerber, S. Guerlet |
|---|
| 17 | c ------ |
|---|
| 18 | c |
|---|
| 19 | c======================================================================= |
|---|
| 20 | |
|---|
| 21 | integer i, ia |
|---|
| 22 | |
|---|
| 23 | ! Special case, dyn. allocation for n-layer depending on callphys.def |
|---|
| 24 | IF(.NOT.ALLOCATED(iaero_nlay)) ALLOCATE(iaero_nlay(nlayaero)) |
|---|
| 25 | iaero_nlay(:) = 0 |
|---|
| 26 | |
|---|
| 27 | ia=0 |
|---|
| 28 | if (aeroco2) then |
|---|
| 29 | ia=ia+1 |
|---|
| 30 | iaero_co2=ia |
|---|
| 31 | endif |
|---|
| 32 | write(*,*) '--- CO2 aerosol = ', iaero_co2 |
|---|
| 33 | |
|---|
| 34 | if (aeroh2o) then |
|---|
| 35 | ia=ia+1 |
|---|
| 36 | iaero_h2o=ia |
|---|
| 37 | endif |
|---|
| 38 | write(*,*) '--- H2O aerosol = ', iaero_h2o |
|---|
| 39 | |
|---|
| 40 | if (dusttau.gt.0) then |
|---|
| 41 | ia=ia+1 |
|---|
| 42 | iaero_dust=ia |
|---|
| 43 | endif |
|---|
| 44 | write(*,*) '--- Dust aerosol = ', iaero_dust |
|---|
| 45 | |
|---|
| 46 | if (aeroh2so4) then |
|---|
| 47 | ia=ia+1 |
|---|
| 48 | iaero_h2so4=ia |
|---|
| 49 | endif |
|---|
| 50 | write(*,*) '--- H2SO4 aerosol = ', iaero_h2so4 |
|---|
| 51 | |
|---|
| 52 | if (aeroback2lay) then |
|---|
| 53 | ia=ia+1 |
|---|
| 54 | iaero_back2lay=ia |
|---|
| 55 | endif |
|---|
| 56 | write(*,*) '--- Two-layer aerosol = ', iaero_back2lay |
|---|
| 57 | |
|---|
| 58 | if (aeronh3) then |
|---|
| 59 | ia=ia+1 |
|---|
| 60 | iaero_nh3=ia |
|---|
| 61 | endif |
|---|
| 62 | write(*,*) '--- NH3 Cloud = ', iaero_nh3 |
|---|
| 63 | |
|---|
| 64 | if (aeronlay) then |
|---|
| 65 | do i=1,nlayaero |
|---|
| 66 | ia=ia+1 |
|---|
| 67 | iaero_nlay(i)=ia |
|---|
| 68 | enddo |
|---|
| 69 | endif |
|---|
| 70 | write(*,*) '--- N-layer aerosol = ', iaero_nlay |
|---|
| 71 | |
|---|
| 72 | if (aeroaurora) then |
|---|
| 73 | ia=ia+1 |
|---|
| 74 | iaero_aurora=ia |
|---|
| 75 | endif |
|---|
| 76 | write(*,*) '--- Auroral aerosols = ', iaero_aurora |
|---|
| 77 | |
|---|
| 78 | write(*,*) '=== Number of aerosols= ', ia |
|---|
| 79 | |
|---|
| 80 | ! For the zero aerosol case, we currently make a dummy co2 aerosol which is zero everywhere. |
|---|
| 81 | ! (See aeropacity.F90 for how this works). A better solution would be to turn off the |
|---|
| 82 | ! aerosol machinery in the no aerosol case, but this would be complicated. LK |
|---|
| 83 | |
|---|
| 84 | if (ia.eq.0) then !For the zero aerosol case. |
|---|
| 85 | ia = 1 |
|---|
| 86 | noaero = .true. |
|---|
| 87 | iaero_co2=ia |
|---|
| 88 | endif |
|---|
| 89 | |
|---|
| 90 | if (ia.ne.naerkind) then |
|---|
| 91 | print*, 'Aerosols counted not equal to naerkind' |
|---|
| 92 | print*, 'Compile with tag -s',ia,'to run' |
|---|
| 93 | print*, 'or change options in callphys.def' |
|---|
| 94 | print*, 'Abort in iniaerosol.F' |
|---|
| 95 | call abort |
|---|
| 96 | endif |
|---|
| 97 | |
|---|
| 98 | end |
|---|