subroutine cond_muphy(ngrid,nlayer,pt,dqmuficond,dtlc) use comcstfi_mod, only: cpp ! Heat capacity of the atmosphere [J.kg-1.K-1] use tracer_h implicit none !==================================================================== ! ! Purpose ! ------- ! The routine calculates the latent heat ! from condensation of species from microphysics ! ! INPUT ! ----- ! ngrid = Number of grid points in the chunk [-] ! nlayer = Number of vertical layers [-] ! pt = Temperature [K] ! dqmuficond = Trend of gas condensed in the microphysics [kg.kg_air-1.s-1] ! ! OUTPUT ! ------ ! dtlc = Condensation heating rate [K.s-1] ! ! Author ! ------ ! B. de Batz de Trenquelléon (07/2023) !==================================================================== !------------------------------------ ! 0. DECLARATIONS !------------------------------------ ! Inputs : !--------- integer, intent(in) :: ngrid integer, intent(in) :: nlayer real, intent(in) :: pt(ngrid,nlayer) real, intent(in) :: dqmuficond(ngrid,nlayer,size(ices_indx)) ! Outputs : !---------- real, intent(out) :: dtlc(ngrid,nlayer) ! Local variables : !------------------ integer :: iq real*8 :: Lc(ngrid,nlayer,size(ices_indx)) ! Condensation latente heat [J.kg-1] !------------------------------------ ! 1. INITIALISATION !------------------------------------ ! Variables set to 0 : ! ~~~~~~~~~~~~~~~~~~~~ dtlc(:,:) = 0.0D0 Lc(:,:,:) = 0.0D0 ! Computes Lc for ices [J.kg-1] : ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ call calc_condlh(ngrid,nlayer,pt,Lc) ! Sum of condensation latent heat [J.kg_air-1.s-1] : ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do iq = 1, size(ices_indx) dtlc(:,:) = dtlc(:,:) + (dqmuficond(:,:,iq) * Lc(:,:,iq)) enddo ! Condensation heating rate : ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! If ice formation : dqmuficond > 0 --> dtlc > 0 ! Else vaporisation : dqmuficond < 0 --> dtlc < 0 dtlc(:,:) = dtlc(:,:) / cpp ! [K.s-1] return end subroutine cond_muphy