| 1 | !================================================================== |
|---|
| 2 | module aerosol_mod |
|---|
| 3 | implicit none |
|---|
| 4 | save |
|---|
| 5 | !================================================================== |
|---|
| 6 | |
|---|
| 7 | ! aerosol indexes: these are initialized to be 0 if the |
|---|
| 8 | ! corresponding aerosol was not activated in callphys.def |
|---|
| 9 | ! -- otherwise a value is given in iniaerosol |
|---|
| 10 | integer :: iaero_haze = 0 |
|---|
| 11 | integer :: i_haze = 0 |
|---|
| 12 | |
|---|
| 13 | contains |
|---|
| 14 | |
|---|
| 15 | !================================================================== |
|---|
| 16 | subroutine haze_prof(ngrid,nlayer,zzlay,pplay,pt,reffrad,profmmr) |
|---|
| 17 | !================================================================== |
|---|
| 18 | ! Purpose |
|---|
| 19 | ! ------- |
|---|
| 20 | ! Get fixed haze properties |
|---|
| 21 | ! profile of haze (from txt file) and fixed radius profile |
|---|
| 22 | ! |
|---|
| 23 | !================================================================== |
|---|
| 24 | use radinc_h, only: naerkind |
|---|
| 25 | use datafile_mod |
|---|
| 26 | |
|---|
| 27 | Implicit none |
|---|
| 28 | #include "dimensions.h" |
|---|
| 29 | #include "dimphys.h" |
|---|
| 30 | #include "tracer.h" |
|---|
| 31 | #include "callkeys.h" |
|---|
| 32 | #include "comcstfi.h" |
|---|
| 33 | !----------------------------------------------------------------------- |
|---|
| 34 | ! Arguments |
|---|
| 35 | |
|---|
| 36 | integer,intent(in) :: ngrid |
|---|
| 37 | integer,intent(in) :: nlayer |
|---|
| 38 | real,intent(in) :: zzlay(ngrid,nlayer) |
|---|
| 39 | real,intent(in) :: pplay(ngrid,nlayer) |
|---|
| 40 | real,intent(in) :: pt(ngrid,nlayer) |
|---|
| 41 | real, intent(in) :: reffrad(ngrid,nlayer,naerkind) ! haze particles radii (m) |
|---|
| 42 | |
|---|
| 43 | real, intent(out) :: profmmr(ngrid,nlayer) ! mmr haze kg/kg |
|---|
| 44 | |
|---|
| 45 | ! Local variables |
|---|
| 46 | integer :: iaer,l,ig,ifine |
|---|
| 47 | |
|---|
| 48 | LOGICAL firstcall |
|---|
| 49 | SAVE firstcall |
|---|
| 50 | DATA firstcall/.true./ |
|---|
| 51 | |
|---|
| 52 | !!read altitudes and haze mmrs |
|---|
| 53 | integer Nfine |
|---|
| 54 | !parameter(Nfine=21) |
|---|
| 55 | parameter(Nfine=701) |
|---|
| 56 | character(len=100) :: file_path |
|---|
| 57 | real,save :: levdat(Nfine),densdat(Nfine) |
|---|
| 58 | |
|---|
| 59 | !---------------- INPUT ------------------------------------------------ |
|---|
| 60 | |
|---|
| 61 | !! Read data |
|---|
| 62 | IF (firstcall) then |
|---|
| 63 | firstcall=.false. |
|---|
| 64 | file_path=trim(datadir)//'/haze_prop/hazemmr.txt' |
|---|
| 65 | open(224,file=file_path,form='formatted') |
|---|
| 66 | do ifine=1,Nfine |
|---|
| 67 | read(224,*) levdat(ifine), densdat(ifine) |
|---|
| 68 | enddo |
|---|
| 69 | close(224) |
|---|
| 70 | print*, 'TB22 read Haze MMR profile' |
|---|
| 71 | ENDIF |
|---|
| 72 | |
|---|
| 73 | !! Interpolate on the model vertical grid |
|---|
| 74 | do ig=1,ngrid |
|---|
| 75 | CALL interp_line(levdat,densdat,Nfine,zzlay(ig,:)/1000.,profmmr(ig,:),nlayer) |
|---|
| 76 | enddo |
|---|
| 77 | |
|---|
| 78 | !! Get profile Mass mixing ratio from number density: part.cm-3 --> m-3 --> m3 m-3 |
|---|
| 79 | ! --> kg m-3 --> kg/kg |
|---|
| 80 | do iaer=1,naerkind |
|---|
| 81 | if(iaer.eq.iaero_haze.and.1.eq.2) then !TB22 activate/deactivate mmr or part density |
|---|
| 82 | !print*, 'Haze profile is fixed' |
|---|
| 83 | do ig=1,ngrid |
|---|
| 84 | do l=1,nlayer |
|---|
| 85 | !from number density in cm-3 |
|---|
| 86 | profmmr(ig,l)=profmmr(ig,l)*1.e6*4./3.*pi*reffrad(ig,l,iaer)**3*rho_q(i_haze)/(pplay(ig,l)/(r*pt(ig,l))) |
|---|
| 87 | enddo |
|---|
| 88 | enddo |
|---|
| 89 | endif |
|---|
| 90 | enddo |
|---|
| 91 | end subroutine haze_prof |
|---|
| 92 | !================================================================== |
|---|
| 93 | |
|---|
| 94 | !================================================================== |
|---|
| 95 | end module aerosol_mod |
|---|
| 96 | !================================================================== |
|---|