Ignore:
Timestamp:
Apr 3, 2026, 5:21:58 PM (7 days ago)
Author:
lrosset
Message:

Titan PCM : 1. Adding a flag to enable/disable the fixed minimal methane concentration ; 2. Moving the latent heat calculation from physics to microphysics, and putting it under flag ; 3. All write_diagfi calls are put under flag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90

    r4153 r4171  
    249249      real zdtsw1(ngrid,nlayer), zdtlw1(ngrid,nlayer) ! Callcorrk routine.
    250250      real zdtlc(ngrid,nlayer)                        ! Condensation heating rate.
    251       real refCorr, time                              ! for hrcorr_mod routines.
     251      real zdtlcfi(ngrid,nlayer)                      ! Condensation heating rate computed in the physics
    252252                             
    253253      ! For Surface Tracers : (kg/m2/s)
     
    268268      real zdqfibar(ngrid,nlayer,nq)   ! For 2D chemistry
    269269      real zdqmufibar(ngrid,nlayer,nq) ! For 2D chemistry
     270      real zdtlcbar(ngrid,nlayer)      ! For 2D chemistry
    270271                       
    271272      ! For Winds : (m/s/s)
     
    394395    !   Or one can put calmufi in MMP_GCM module (in muphytitan).
    395396    INTERFACE
    396       SUBROUTINE calmufi(dt, plev, zlev, play, zlay, g3d, temp, pq, zdqfi, zdq)
     397      SUBROUTINE calmufi(dt, plev, zlev, play, zlay, g3d, temp, pq, zdqfi, zdq, zdt)
    397398        REAL(kind=8), INTENT(IN)                 :: dt    !! Physics timestep (s).
    398399        REAL(kind=8), DIMENSION(:,:), INTENT(IN) :: plev  !! Pressure levels (Pa).
     
    405406        REAL(kind=8), DIMENSION(:,:,:), INTENT(IN)  :: zdqfi !! Tendency from former processes for tracers (\(X.kg^{-1}}\)).
    406407        REAL(kind=8), DIMENSION(:,:,:), INTENT(OUT) :: zdq   !! Microphysical tendency for tracers (\(X.kg^{-1}}\)).
     408        REAL(kind=8), DIMENSION(:,:),   INTENT(OUT) :: zdt   !! Temperature tendencies due to condensation/evaporation (\(K.s^{-1}\)).
    407409      END SUBROUTINE calmufi
    408410    END INTERFACE
     
    441443!        ~~~~~~~~~~~~~~~~~~
    442444         dtrad(:,:) = 0.D0
    443          zdtlc(:,:) = 0.D0
    444445         fluxrad(:) = 0.D0
    445446         zdtsw(:,:) = 0.D0
    446447         zdtlw(:,:) = 0.D0
     448         zdtlc(:,:) = 0.D0
     449         zdtlcfi(:,:) = 0.D0
    447450         zpopthi(:,:,:,:) = 0.D0
    448451         zpopthv(:,:,:,:) = 0.D0
     
    11291132#ifdef USE_QTEST
    11301133            dtpq(:,:,:) = 0.D0 ! we want tpq to go only through mufi
    1131             call calmufi(ptimestep,pplev,zzlev,pplay,zzlay,gzlat,pt,tpq,dtpq,zdqmufi)
     1134            call calmufi(ptimestep,pplev,zzlev,pplay,zzlay,gzlat,pt,tpq,dtpq,zdqmufi,zdtlc)
    11321135            tpq(:,:,:) = tpq(:,:,:) + zdqmufi(:,:,:)*ptimestep ! only manipulation of tpq->*ptimestep here
    11331136
    11341137#else   
    1135             call calmufi(ptimestep,pplev,zzlev,pplay,zzlay,gzlat,pt,pq,pdq,zdqmufi)
     1138            call calmufi(ptimestep,pplev,zzlev,pplay,zzlay,gzlat,pt,pq,pdq,zdqmufi,zdtlc)
    11361139            pdq(:,:,:) = pdq(:,:,:) + zdqmufi(:,:,:)
    11371140
     
    11841187               zdqfibar(:,:,:) = 0.D0 ! We work in zonal average -> forget processes other than condensation
    11851188               call calmufi(ptimestep,zplevbar,zzlevbar,zplaybar,zzlaybar, &
    1186                             gzlat,ztfibar,zqfibar,zdqfibar,zdqmufibar)
     1189                            gzlat,ztfibar,zqfibar,zdqfibar,zdqmufibar,zdtlcbar)
    11871190               ! TODO : Add a sanity check here !
    11881191            endif
    11891192         
    11901193            ! Condensation heating rate :
    1191             if (callclouds) then
     1194            if (callclouds .and. latent_heat) then
    11921195               ! Default value -> no condensation [kg/kg_air/s] :
    11931196               dmuficond(:,:,:) = 0.D0
     
    11951198                  dmuficond(:,:,iq) = zdqmufi(:,:,gazs_indx(iq))
    11961199               enddo
    1197                call cond_muphy(ngrid,nlayer,pt,dmuficond,zdtlc)
    1198                if (latent_heat) then
    1199                   pdt(:,:) = pdt(:,:) + zdtlc(:,:)
    1200                endif
     1200               call cond_muphy(ngrid,nlayer,pt,dmuficond,zdtlcfi)
     1201               pdt(:,:) = pdt(:,:) + zdtlc
    12011202            endif
    12021203         endif ! callmufi
     
    13601361               zdmassmr_col(ig)=SUM(zdmassmr(ig,:))
    13611362            enddo
    1362            
    1363             call writediagfi(ngrid,"mass_evap","mass gain"," ",3,zdmassmr)
    1364             call writediagfi(ngrid,"mass_evap_col","mass gain col"," ",2,zdmassmr_col)
    1365             call writediagfi(ngrid,"mass","mass","kg/m2",3,mass)
     1363
     1364            #ifndef CPP_XIOS
     1365               call writediagfi(ngrid,"mass_evap","mass gain"," ",3,zdmassmr)
     1366               call writediagfi(ngrid,"mass_evap_col","mass gain col"," ",2,zdmassmr_col)
     1367               call writediagfi(ngrid,"mass","mass","kg/m2",3,mass)
     1368            #endif
    13661369
    13671370            call mass_redistribution(ngrid,nlayer,nq,ptimestep,                     &
     
    16311634!-----------------------------------------------------------------------------------------------------
    16321635
     1636#ifndef CPP_XIOS
    16331637
    16341638      call writediagfi(ngrid,"Ls","solar longitude","deg",0,zls*180./pi)
     
    17151719           i2e(:,:) = ( pplev(:,1:nlayer)-pplev(:,2:nlayer+1) ) / gzlat(:,1:nlayer) /(zzlev(:,2:nlayer+1)-zzlev(:,1:nlayer))
    17161720
    1717 #ifdef USE_QTEST
     1721   #ifdef USE_QTEST
    17181722            ! Microphysical tracers passed through dyn+phys(except mufi)
    17191723            call writediagfi(ngrid,"mu_m0as_dp","Dynphys only spherical mode 0th order moment",'m-3',3,zq(:,:,micro_indx(1))*i2e)
     
    17261730            call writediagfi(ngrid,"mu_m0af_mo","Mufi only fractal mode 0th order moment",'m-3',3,tpq(:,:,micro_indx(3))*i2e)
    17271731            call writediagfi(ngrid,"mu_m3af_mo","Mufi only fractal mode 3rd order moment",'m3/m3',3,tpq(:,:,micro_indx(4))*i2e)
    1728 #else
     1732   #else
    17291733            call writediagfi(ngrid,"mu_m0as","Spherical mode 0th order moment",'m-3',3,zq(:,:,micro_indx(1))*i2e)
    17301734            call writediagfi(ngrid,"mu_m3as","Spherical mode 3rd order moment",'m3/m3',3,zq(:,:,micro_indx(2))*i2e)
    17311735            call writediagfi(ngrid,"mu_m0af","Fractal mode 0th order moment",'m-3',3,zq(:,:,micro_indx(3))*i2e)
    17321736            call writediagfi(ngrid,"mu_m3af","Fractal mode 3rd order moment",'m3/m3',3,zq(:,:,micro_indx(4))*i2e)
    1733 #endif
     1737   #endif ! USE_QTEST
    17341738           
    17351739            ! Microphysical diagnostics
     
    17511755
    17521756       endif ! end of 'tracer'
     1757#endif ! not CPP_XIOS
    17531758
    17541759#ifdef CPP_XIOS
     
    18211826      CALL send_xios_field("dtdif",zdtdif)
    18221827      CALL send_xios_field("dtadj",zdtadj(:,:))
    1823       IF (callclouds) THEN
     1828      IF (callclouds .and. latent_heat) THEN
    18241829         CALL send_xios_field("dtlc",zdtlc)
     1830         CALL send_xios_field("dtlcfi",zdtlcfi)
    18251831      ENDIF
    18261832
     
    19521958      !--------------------------------------------------------
    19531959      IF (callmufi) THEN
     1960         ! Microphysical tracers are expressed in unit/m3.
     1961         ! convert X.kg-1 --> X.m-3 (whereas for optics was -> X.m-2)
     1962         i2e(:,:) = ( pplev(:,1:nlayer)-pplev(:,2:nlayer+1) ) / gzlat(:,1:nlayer) /(zzlev(:,2:nlayer+1)-zzlev(:,1:nlayer))
    19541963         ! Atmosphere (3D) :
    19551964         ! Moments M0 and M3 :
     
    20122021
    20132022         ! Condensation tendencies from microphysics (mol/mol/s) :
    2014          IF (callclouds) THEN
     2023         IF (callclouds .and. latent_heat) THEN
    20152024            DO iq = 1, size(ices_indx)
    20162025               CALL send_xios_field('dmuficond_'//trim(nameOfTracer(gazs_indx(iq))),dmuficond(:,:,iq)/rat_mmol(gazs_indx(iq))) ! kg/kg/s -> mol/mol/s
Note: See TracChangeset for help on using the changeset viewer.