[726] | 1 | SUBROUTINE iniaerosol() |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | use radinc_h, only: naerkind |
---|
| 5 | use aerosol_mod |
---|
[1397] | 6 | use callkeys_mod, only: aeroco2,aeroh2o,dusttau,aeroh2so4, |
---|
[2297] | 7 | & aeroback2lay,aeronh3, nlayaero, aeronlay, aeroaurora |
---|
[726] | 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 |
---|
[1026] | 16 | c author: Laura Kerber, S. Guerlet |
---|
[726] | 17 | c ------ |
---|
| 18 | c |
---|
| 19 | c======================================================================= |
---|
| 20 | |
---|
[2297] | 21 | integer i, ia |
---|
[726] | 22 | |
---|
[2297] | 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 | |
---|
[726] | 27 | ia=0 |
---|
| 28 | if (aeroco2) then |
---|
[741] | 29 | ia=ia+1 |
---|
| 30 | iaero_co2=ia |
---|
[726] | 31 | endif |
---|
[747] | 32 | write(*,*) '--- CO2 aerosol = ', iaero_co2 |
---|
[726] | 33 | |
---|
| 34 | if (aeroh2o) then |
---|
[741] | 35 | ia=ia+1 |
---|
| 36 | iaero_h2o=ia |
---|
[726] | 37 | endif |
---|
[747] | 38 | write(*,*) '--- H2O aerosol = ', iaero_h2o |
---|
[726] | 39 | |
---|
| 40 | if (dusttau.gt.0) then |
---|
[741] | 41 | ia=ia+1 |
---|
| 42 | iaero_dust=ia |
---|
[726] | 43 | endif |
---|
[747] | 44 | write(*,*) '--- Dust aerosol = ', iaero_dust |
---|
[726] | 45 | |
---|
| 46 | if (aeroh2so4) then |
---|
[741] | 47 | ia=ia+1 |
---|
| 48 | iaero_h2so4=ia |
---|
[726] | 49 | endif |
---|
[747] | 50 | write(*,*) '--- H2SO4 aerosol = ', iaero_h2so4 |
---|
[726] | 51 | |
---|
[1026] | 52 | if (aeroback2lay) then |
---|
| 53 | ia=ia+1 |
---|
| 54 | iaero_back2lay=ia |
---|
| 55 | endif |
---|
| 56 | write(*,*) '--- Two-layer aerosol = ', iaero_back2lay |
---|
| 57 | |
---|
[1677] | 58 | if (aeronh3) then |
---|
| 59 | ia=ia+1 |
---|
| 60 | iaero_nh3=ia |
---|
| 61 | endif |
---|
| 62 | write(*,*) '--- NH3 Cloud = ', iaero_nh3 |
---|
| 63 | |
---|
[2297] | 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 | |
---|
[1677] | 72 | if (aeroaurora) then |
---|
| 73 | ia=ia+1 |
---|
| 74 | iaero_aurora=ia |
---|
| 75 | endif |
---|
| 76 | write(*,*) '--- Auroral aerosols = ', iaero_aurora |
---|
| 77 | |
---|
[747] | 78 | write(*,*) '=== Number of aerosols= ', ia |
---|
[726] | 79 | |
---|
[741] | 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 |
---|
[726] | 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' |
---|
[741] | 95 | call abort |
---|
[726] | 96 | endif |
---|
| 97 | |
---|
| 98 | end |
---|