SUBROUTINE initracer() use comgeomfi_h use aerosol_mod IMPLICIT NONE c======================================================================= c subject: c -------- c Initialization related to tracer c (transported dust, water, chemical species, ice...) c c Name of the tracer c c Test of dimension : c Initialize COMMON tracer in tracer.h, using tracer names provided c by the dynamics in "advtrac.h" c c author: F.Forget c ------ c Ehouarn Millour (oct. 2008) identify tracers by their names c Tanguy Bertrand (oct. 2014) Adaptation Pluto c Tanguy Bertrand (dec. 2014) Adding tracers for haze c -precurseur c -haze c======================================================================= #include "dimensions.h" #include "dimphys.h" #include "comcstfi.h" #include "callkeys.h" #include "tracer.h" #include "advtrac.h" #include "fisice.h" #include "surfdat.h" ! real qsurf(ngridmx,nqmx) ! tracer on surface (e.g. kg.m-2) character(len=20) :: txt ! to store some text integer iq,ig,count,i real r0_lift , reff_lift, rho_haze integer nqhaze(nqmx) ! to store haze tracers ! logical :: oldnames ! =.true. if old tracer naming convention (q01,...) integer ia, block CHARACTER(LEN=20) :: tracername ! to temporarily store text c----------------------------------------------------------------------- c radius(nqmx) ! aerosol particle radius (m) c rho_q(nqmx) ! tracer densities (kg.m-3) c rho_ch4_ice ! ch4 ice density c rho_co_ice ! co ice density c varian ! Characteristic variance of log-normal distribution c----------------------------------------------------------------------- ! Initialization: get tracer names from the dynamics and check if we are ! using 'old' tracer convention ('q01',q02',...) ! or new convention (full tracer names) ! copy tracer names from dynamics do iq=1,nqmx noms(iq)=tnom(iq) enddo print*,'initracer : number of tracers nqmx=',nqmx ! Identify tracers by their names: (and set corresponding values of mmol) ! 0. initialize tracer indexes to zero: ! NB: igcm_* indexes are commons in 'tracer.h' igcm_n2=0 igcm_ch4_gas=0 igcm_ch4_ice=0 igcm_prec_haze=0 igcm_co_gas=0 igcm_co_ice=0 nqhaze(:)=0 i=0 DO iq=1,nqmx txt=noms(iq) IF (txt(1:4).eq."haze") THEN i=i+1 nqhaze(i)=iq ENDIF ENDDO if ((haze.or.fasthaze).and.i==0) then print*, 'Haze active but no haze tracer in traceur.def' stop endif igcm_haze=0 igcm_haze10=0 igcm_haze30=0 igcm_haze50=0 igcm_haze100=0 ! Eddy diffusion tracers igcm_eddy1e6=0 igcm_eddy1e7=0 igcm_eddy5e7=0 igcm_eddy1e8=0 igcm_eddy5e8=0 write(*,*) 'initracer: noms() ', noms c Radius and densities rho_n2=1000 ! n2 ice rho_ch4_ice=520. ! rho ch4 ice rho_co_ice=520. ! rho ch4 ice rho_haze=800. ! haze ! first initialization call zerophys(nqmx,rho_q) call zerophys(nqmx,radius) ! find tracers count=0 do iq=1,nqmx if (noms(iq).eq."n2") then igcm_n2=iq mmol(igcm_n2)=28. count=count+1 write(*,*) 'Tracer ',count,' = n2' endif if (noms(iq).eq."ch4_gas") then igcm_ch4_gas=iq mmol(igcm_ch4_gas)=16. count=count+1 write(*,*) 'Tracer ',count,' = ch4 gas' endif if (noms(iq).eq."ch4_ice") then igcm_ch4_ice=iq mmol(igcm_ch4_ice)=16. radius(iq)=3.e-6 rho_q(iq)=rho_ch4_ice count=count+1 write(*,*) 'Tracer ',count,' = ch4 ice' endif if (noms(iq).eq."co_gas") then igcm_co_gas=iq mmol(igcm_co_gas)=28. count=count+1 write(*,*) 'Tracer ',count,' = co gas' endif if (noms(iq).eq."co_ice") then igcm_co_ice=iq mmol(igcm_co_ice)=28. radius(iq)=3.e-6 rho_q(iq)=rho_co_ice count=count+1 write(*,*) 'Tracer ',count,' = co ice' endif if (noms(iq).eq."prec_haze") then igcm_prec_haze=iq count=count+1 write(*,*) 'Tracer ',count,' = prec haze' endif if (noms(iq).eq."haze") then igcm_haze=iq count=count+1 radius(iq)=rad_haze rho_q(iq)=rho_haze write(*,*) 'Tracer ',count,' = haze' endif if (noms(iq).eq."haze10") then igcm_haze10=iq count=count+1 radius(iq)=10.e-9 rho_q(iq)=rho_haze write(*,*) 'Tracer ',count,' = haze10' endif if (noms(iq).eq."haze30") then igcm_haze30=iq count=count+1 radius(iq)=30.e-9 rho_q(iq)=rho_haze write(*,*) 'Tracer ',count,' = haze30' endif if (noms(iq).eq."haze50") then igcm_haze50=iq count=count+1 radius(iq)=50.e-9 rho_q(iq)=rho_haze write(*,*) 'Tracer ',count,' = haze50' endif if (noms(iq).eq."haze100") then igcm_haze100=iq count=count+1 radius(iq)=100.e-9 rho_q(iq)=rho_haze write(*,*) 'Tracer ',count,' = haze100' endif ! Eddy diffusion tracers if (noms(iq).eq."eddy1e6") then igcm_eddy1e6=iq count=count+1 write(*,*) 'Tracer ',count,' = eddy1e6' endif if (noms(iq).eq."eddy1e7") then igcm_eddy1e7=iq count=count+1 write(*,*) 'Tracer ',count,' = eddy1e7' endif if (noms(iq).eq."eddy5e7") then igcm_eddy5e7=iq count=count+1 write(*,*) 'Tracer ',count,' = eddy5e7' endif if (noms(iq).eq."eddy1e8") then igcm_eddy1e8=iq count=count+1 write(*,*) 'Tracer ',count,' = eddy1e8' endif if (noms(iq).eq."eddy5e8") then igcm_eddy5e8=iq count=count+1 write(*,*) 'Tracer ',count,' = eddy5e8' endif enddo ! of do iq=1,nqmx ! check that we identified all tracers: if (count.ne.nqmx) then write(*,*) "initracer: found only ",count," tracers" write(*,*) " expected ",nqmx do iq=1,count write(*,*)' ',iq,' ',trim(noms(iq)) enddo stop else write(*,*) "initracer: found all expected tracers, namely:" do iq=1,nqmx write(*,*)' ',iq,' ',trim(noms(iq)) enddo endif c------------------------------------------------------------ c Initialisation tracers .... c------------------------------------------------------------ c Other initializations c ------------------------------ c Latent heat : lw_co=274000. lw_ch4=586700. lw_n2=2.5e5 c HAZE: if (haze) then ! the sedimentation radius remains radius(igcm_haze) if (fractal) then nmono=nb_monomer else nmono=1 endif ia=0 if (aerohaze) then ia=ia+1 iaero_haze=ia write(*,*) '--- number of haze aerosol = ', iaero_haze block=0 ! Only one type of haze is active : the first one set in traceur.def do iq=1,nqmx tracername=noms(iq) write(*,*) "--> tracername ",iq,'/',nqmx,' = ',tracername if (tracername(1:4).eq."haze".and.block.eq.0) then i_haze=iq block=1 write(*,*) "i_haze=",i_haze write(*,*) "Careful: if you set many haze traceurs in & traceur.def,only ",tracername," will be radiatively active & (first one in traceur.def)" endif enddo endif endif c Output for records: c ~~~~~~~~~~~~~~~~~~ write(*,*) Write(*,*) '******** initracer : parameters :' write(*,*) 'radius = ', radius write(*,*) 'density = ', rho_q write(*,*) write(*,*) 'monomers = ', nmono end