Ignore:
Timestamp:
Jan 20, 2025, 10:17:54 AM (9 hours ago)
Author:
debatzbr
Message:

Connecting microphysics to radiative transfer + miscellaneous cleans

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/libf/phypluto/initracer.F90

    r3572 r3585  
    123123         ALLOCATE(is_recomb_qotf(nqtot))
    124124       ENDIF
    125        IF (.NOT. allocated(is_condensable)) allocate(is_condensable(nq)) !LT
    126        IF (.NOT. allocated(is_rgcs)) allocate(is_rgcs(nq)) !LT
    127        IF (.NOT. allocated(constants_mass)) allocate(constants_mass(nq))
    128        IF (.NOT. allocated(constants_delta_gasH)) allocate(constants_delta_gasH(nq))
    129        IF (.NOT. allocated(constants_Tref)) allocate(constants_Tref(nq))
    130        IF (.NOT. allocated(constants_Pref)) allocate(constants_Pref(nq))
    131        IF (.NOT. allocated(constants_RLVTT_generic)) allocate(constants_RLVTT_generic(nq))
    132        IF (.NOT. allocated(constants_RCPV_generic)) allocate(constants_RCPV_generic(nq))
    133125
    134126       !! initialization
     
    148140       radius(:)=0.
    149141       qext(:)=0.
    150 
    151        ! For condensable tracers, by Lucas Teinturier and Noé Clément (2022)
    152 
    153        is_condensable(:)= 0
    154        is_rgcs(:) = 0
    155        constants_mass(:)=0
    156        constants_delta_gasH(:)=0
    157        constants_Tref(:)=0
    158        constants_Pref(:)=0
    159        constants_RLVTT_generic(:)=0
    160        constants_RCPV_generic(:)=0
    161142
    162143       rho_q(:) = 0. !need to be init here if we want to read it from modern traceur with get_tracdat
     
    403384      if (is_master) close(407)
    404385
    405       ! Get specific data of condensable tracers
    406       do iq=1,nq
    407         if((is_condensable(iq)==1)) then
    408                 write(*,*) "There is a specie which is condensable, for generic condensation : ", noms(iq)
    409                 write(*,*) 'looking specie parameters for : ',noms(iq)(1:len(trim(noms(iq)))-4)
    410                 ! call specie_parameters_table(noms(iq)(1:len(trim(noms(iq)))-4))
    411                 ! constants_mass(iq)=m
    412                 ! constants_delta_gasH(iq)=delta_gasH
    413                 ! constants_Tref(iq)=Tref
    414                 ! constants_Pref(iq)=Pref
    415                 ! constants_RLVTT_generic(iq)=RLVTT_generic
    416                 ! constants_RCPV_generic(iq)=RCPV_generic
    417         else
    418                 write(*,*) "This tracer is not condensable, for generic condensation :  : ", noms(iq)
    419                 write(*,*) "We keep condensable constants at zero"
    420         endif !(is_condensable(iq)==1) .and. (index(noms(iq),"vap") .ne. 0))
    421       enddo ! iq=1,nq
    422 
    423386      ! Calculate number of species in the chemistry
    424387      nesp = sum(is_chim)
    425388      write(*,*) 'Number of species in the chemistry nesp = ',nesp
    426 
    427       ! Calculate number of generic tracers
    428       ngt = sum(is_condensable)
    429       write(*,*) 'Number of generic tracer is  ngt = ',ngt
    430 
    431       ! Calculate number of radiative generic condensable species
    432       n_rgcs = sum(is_rgcs)
    433       write(*,*)'Number of Radiative Generic Condensable Species is n_rgcs = ',n_rgcs
    434       if (n_rgcs> ngt/2) then
    435         write(*,*) 'You have more Radiative Generic Condensable Species than Generic Condensable Species'
    436         write(*,*)'This is not possible: check your Modern traceur.def'
    437         call abort_physic("initracer, issue with # of RGCS and GCS")
    438       endif
    439389
    440390      ! Calculate number of microphysical tracer
     
    461411      write(*,*) "lw_n2 = ", lw_n2
    462412
    463       if (haze) then
     413      if (callmufi) then
     414        if (optichaze) then
     415          iaero_haze = 2
     416          write(*,*) 'Microphysical moment model'
     417          write(*,*) '--- number of haze aerosol = ', iaero_haze
     418        endif ! end optichaze
     419     
     420      elseif (haze) then
    464421        ! the sedimentation radius remains radius(igcm_haze)
    465422        if (fractal) then
    466            nmono=nb_monomer
     423          nmono=nb_monomer
    467424        else
    468            nmono=1
     425          nmono=1
    469426        endif ! end fractal
    470 
    471         ia=0
     427       
     428        ia = 0
    472429        if (optichaze) then
    473           ia=ia+1
    474           iaero_haze=ia
     430          ia = ia + 1
     431          iaero_haze = ia
    475432          write(*,*) '--- number of haze aerosol = ', iaero_haze
    476 
    477           block=0  ! Only one type of haze is active : the first one set in traceur.def
     433          block = 0 ! Only one type of haze is active : the first one set in traceur.def
    478434          do iq=1,nq
    479435            tracername=noms(iq)
     
    484440              write(*,*) "i_haze=",i_haze
    485441              write(*,*) "Careful: if you set many haze traceurs in &
    486                 traceur.def,only ",tracername," will be radiatively active &
    487                 (first one in traceur.def)"
     442              traceur.def,only ",tracername," will be radiatively active &
     443              (first one in traceur.def)"
    488444            endif
    489           enddo
     445            enddo
    490446        endif ! end optichaze
    491447      endif ! end callmufi or haze
     
    602558              is_recomb_qotf(iq)
    603559          end if
    604           !option is_condensable (LT)
    605           if (index(tracline,'is_condensable=') /=0) then
    606             read(tracline(index(tracline,'is_condensable=') &
    607               +len('is_condensable='):),*) is_condensable(iq)
    608             write(*,*) ' Parameter value (traceur.def) :'// &
    609               ' is_condensable=', is_condensable(iq)
    610           else
    611               write(*,*) ' Parameter value (default)     :'// &
    612               ' is_condensable=', is_condensable(iq)
    613           endif
    614560          !option radius
    615561          if (index(tracline,'radius=') .ne. 0) then
     
    632578              ' rho=', rho_q(iq)
    633579          endif
    634           !option is_rgcs
    635           if (index(tracline,'is_rgcs') .ne. 0) then
    636             read(tracline(index(tracline,'is_rgcs=') &
    637               +len('is_rgcs='):),*) is_rgcs(iq)
    638             write(*,*)'Parameter value (traceur.def) :'// &
    639               'is_rgcs=',is_rgcs(iq)
    640           else
    641             write(*,*)'Parameter value (default) : '// &
    642               'is_rgcs = ',is_rgcs(iq)
    643           endif
    644580      end subroutine get_tracdat
    645581
Note: See TracChangeset for help on using the changeset viewer.