!================================================================== module aerosol_mod implicit none save !================================================================== ! aerosol indexes: these are initialized to be 0 if the ! corresponding aerosol was not activated in callphys.def ! -- otherwise a value is given in iniaerosol integer :: iaero_haze = 0 integer :: i_haze = 0 contains !================================================================== subroutine haze_prof(ngrid,nlayer,zzlay,pplay,pt,reffrad,profmmr) !================================================================== ! Purpose ! ------- ! Get fixed haze properties ! profile of haze (from txt file) and fixed radius profile ! !================================================================== use radinc_h, only: naerkind use datafile_mod Implicit none #include "dimensions.h" #include "dimphys.h" #include "tracer.h" #include "callkeys.h" #include "comcstfi.h" !----------------------------------------------------------------------- ! Arguments integer,intent(in) :: ngrid integer,intent(in) :: nlayer real,intent(in) :: zzlay(ngrid,nlayer) real,intent(in) :: pplay(ngrid,nlayer) real,intent(in) :: pt(ngrid,nlayer) real, intent(in) :: reffrad(ngrid,nlayer,naerkind) ! haze particles radii (m) real, intent(out) :: profmmr(ngrid,nlayer) ! mmr haze kg/kg ! Local variables integer :: iaer,l,ig,ifine LOGICAL firstcall SAVE firstcall DATA firstcall/.true./ !!read altitudes and haze mmrs integer Nfine !parameter(Nfine=21) parameter(Nfine=701) character(len=100) :: file_path character(len=100) :: file_name real,save :: levdat(Nfine),densdat(Nfine) !---------------- INPUT ------------------------------------------------ !! Read data IF (firstcall) then firstcall=.false. if (hazemmr_file/='None')then file_name = hazemmr_file print*, 'Read Haze MMR file: ',hazemmr_file else if(hazedens_file/='None')then file_name = hazedens_file print*, 'Read Haze density: ',hazedens_file else STOP "No filename given for haze profile. Either set hazemmr_file or hazedens_file" endif file_path=trim(datadir)//'/haze_prop/'//file_name open(224,file=file_path,form='formatted') do ifine=1,Nfine read(224,*) levdat(ifine), densdat(ifine) enddo close(224) print*, 'AF24 read Haze MMR profile ',file_path ENDIF !! Interpolate on the model vertical grid do ig=1,ngrid CALL interp_line(levdat,densdat,Nfine,zzlay(ig,:)/1000.,profmmr(ig,:),nlayer) enddo !! Get profile Mass mixing ratio from number density: part.cm-3 --> m-3 --> m3 m-3 ! --> kg m-3 --> kg/kg do iaer=1,naerkind if(iaer.eq.iaero_haze.and.hazedens_file/='None') then !AF24 activate/deactivate mmr or part density !print*, 'Haze profile is fixed' do ig=1,ngrid do l=1,nlayer !from number density in cm-3 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))) enddo enddo endif enddo end subroutine haze_prof !================================================================== !================================================================== end module aerosol_mod !==================================================================