[3184] | 1 | !================================================================== |
---|
| 2 | module aerosol_mod |
---|
| 3 | implicit none |
---|
| 4 | |
---|
| 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 set via iniaerosol |
---|
[3195] | 10 | integer, save :: iaero_haze = 0 |
---|
| 11 | integer, save :: i_haze = 0 |
---|
[3572] | 12 | !$OMP THREADPRIVATE(iaero_haze,i_haze) |
---|
[3184] | 13 | |
---|
| 14 | !================================================================== |
---|
| 15 | |
---|
| 16 | contains |
---|
| 17 | |
---|
[3195] | 18 | !================================================================== |
---|
| 19 | subroutine haze_prof(ngrid,nlayer,zzlay,pplay,pt,reffrad,profmmr) |
---|
| 20 | !================================================================== |
---|
| 21 | ! Purpose |
---|
| 22 | ! ------- |
---|
| 23 | ! Get fixed haze properties |
---|
| 24 | ! profile of haze (from txt file) and fixed radius profile |
---|
[3184] | 25 | ! |
---|
[3195] | 26 | !================================================================== |
---|
| 27 | use radinc_h, only: naerkind |
---|
| 28 | use datafile_mod |
---|
| 29 | use tracer_h |
---|
| 30 | use comcstfi_mod, only: r, pi |
---|
[3184] | 31 | |
---|
[3195] | 32 | !----------------------------------------------------------------------- |
---|
| 33 | ! Arguments |
---|
| 34 | Implicit none |
---|
[3184] | 35 | |
---|
[3195] | 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) |
---|
[3184] | 42 | |
---|
[3195] | 43 | real, intent(out) :: profmmr(ngrid,nlayer) ! mmr haze kg/kg |
---|
[3184] | 44 | |
---|
[3195] | 45 | ! Local variables |
---|
| 46 | integer :: iaer,l,ig,ifine |
---|
[3184] | 47 | |
---|
[3195] | 48 | LOGICAL firstcall |
---|
| 49 | SAVE firstcall |
---|
| 50 | DATA firstcall/.true./ |
---|
[3184] | 51 | |
---|
[3195] | 52 | !!read altitudes and haze mmrs |
---|
| 53 | integer Nfine |
---|
| 54 | !parameter(Nfine=21) |
---|
| 55 | parameter(Nfine=701) |
---|
| 56 | character(len=100) :: file_path |
---|
[3353] | 57 | character(len=100) :: file_name |
---|
[3195] | 58 | real,save :: levdat(Nfine),densdat(Nfine) |
---|
[3184] | 59 | |
---|
[3195] | 60 | !---------------- INPUT ------------------------------------------------ |
---|
[3184] | 61 | |
---|
[3195] | 62 | !! Read data |
---|
| 63 | IF (firstcall) then |
---|
| 64 | firstcall=.false. |
---|
[3353] | 65 | |
---|
| 66 | if (hazemmr_file/='None')then |
---|
| 67 | file_name = hazemmr_file |
---|
| 68 | print*, 'Read Haze MMR file: ',hazemmr_file |
---|
| 69 | else if(hazedens_file/='None')then |
---|
| 70 | file_name = hazedens_file |
---|
| 71 | print*, 'Read Haze density: ',hazedens_file |
---|
| 72 | else |
---|
| 73 | STOP "No filename given for haze profile. Either set hazemmr_file or hazedens_file" |
---|
| 74 | endif |
---|
| 75 | |
---|
| 76 | file_path=trim(datadir)//'/haze_prop/'//file_name |
---|
[3195] | 77 | open(224,file=file_path,form='formatted') |
---|
| 78 | do ifine=1,Nfine |
---|
| 79 | read(224,*) levdat(ifine), densdat(ifine) |
---|
| 80 | enddo |
---|
| 81 | close(224) |
---|
[3353] | 82 | print*, 'Read Haze profile: ',file_path |
---|
[3195] | 83 | ENDIF |
---|
[3184] | 84 | |
---|
[3195] | 85 | !! Interpolate on the model vertical grid |
---|
| 86 | do ig=1,ngrid |
---|
| 87 | CALL interp_line(levdat,densdat,Nfine,zzlay(ig,:)/1000.,profmmr(ig,:),nlayer) |
---|
| 88 | enddo |
---|
[3184] | 89 | |
---|
[3195] | 90 | !! Get profile Mass mixing ratio from number density: part.cm-3 --> m-3 --> m3 m-3 |
---|
| 91 | ! --> kg m-3 --> kg/kg |
---|
| 92 | do iaer=1,naerkind |
---|
[3353] | 93 | if(iaer.eq.iaero_haze.and.hazedens_file/='None') then !AF24 activate/deactivate mmr or part density |
---|
[3195] | 94 | !print*, 'Haze profile is fixed' |
---|
| 95 | do ig=1,ngrid |
---|
| 96 | do l=1,nlayer |
---|
| 97 | !from number density in cm-3 |
---|
| 98 | 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))) |
---|
[3353] | 99 | ! print*, profmmr(ig,l) |
---|
[3195] | 100 | enddo |
---|
| 101 | enddo |
---|
| 102 | endif |
---|
| 103 | enddo |
---|
| 104 | end subroutine haze_prof |
---|
| 105 | !================================================================== |
---|
[3184] | 106 | |
---|
| 107 | |
---|
| 108 | end module aerosol_mod |
---|
| 109 | !================================================================== |
---|