Changeset 4171


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.

Location:
trunk/LMDZ.TITAN
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/deftank/callphys.def

    r3975 r4171  
    104104# If yes, number of ices ? (must be compatible with traceur.def AND microphysical model)
    105105nices      = 4
     106# Activate latent heat retroaction ?
     107latent_heat = .false.
     108# Constrain minimal methane concentration in the atmosphere?
     109free_ch4 = .false.
    106110# Use new optics for clouds ?
    107111opt4clouds = .true.
  • trunk/LMDZ.TITAN/libf/muphytitan/mm_clouds.f90

    r4084 r4171  
    7171  !============================================================================
    7272
    73   SUBROUTINE mm_cloud_microphysics(dm0a,dm3a,dm0n,dm3n,dm3i,dgazs)
     73  SUBROUTINE mm_cloud_microphysics(dm0a,dm3a,dm0n,dm3n,dm3i,dgazs,dtlc)
    7474    !! Get the evolution of moments tracers through clouds microphysics processes.
    7575    !!
     
    9292    REAL(kind=mm_wp), DIMENSION(:,:), INTENT(out) :: dgazs
    9393    !! Tendencies of each condensible gaz species (\(mol.mol^{-1}\)).
     94    REAL(kind=mm_wp), DIMENSION(:), INTENT(out) :: dtlc
     95    !! Temperature tendencies due to condensation/evaporation (\(K.s^{-1}\)).
    9496    REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE   :: zdm0n,zdm3n
    9597    REAL(kind=mm_wp), DIMENSION(:,:), ALLOCATABLE :: zdm3i
     98    REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE   :: lh ! Latent heat of condensation (?) (J.kg-1)
    9699    INTEGER                                    :: i
    97100    dm0a = 0._mm_wp ; dm3a = 0._mm_wp
    98101    dm0n = 0._mm_wp ; dm3n = 0._mm_wp
    99102    dm3i = 0._mm_wp ; dgazs = 0._mm_wp
     103    dtlc = 0._mm_wp
    100104
    101105    IF (mm_w_cloud_nucond) THEN
     
    103107      ! ADDED : Extraction of nucleation and growth rates
    104108      call mm_cloud_nucond(dm0a,dm3a,dm0n,dm3n,dm3i,dgazs,mm_gazs_sat,mm_nrate,mm_grate)
     109      ! Latent heat release
     110      IF (mm_latent_heat) THEN
     111        ALLOCATE(lh(mm_nla))
     112        DO i = 1, mm_nesp
     113          lh(:) = mm_lheatX(mm_temp(:),mm_xESPS(i))
     114          dtlc(:) = dtlc(:) - (dgazs(:,i)*mm_xESPS(i)%fmol2fmas)*lh(:) ! We use the tendencies of the gaseous species, thus changing the sign of variation.
     115        ENDDO
     116        dtlc(:) = dtlc(:)/mm_cpp
     117      ENDIF
    105118    ENDIF
    106119
  • trunk/LMDZ.TITAN/libf/muphytitan/mm_globals.f90

    r3682 r4171  
    9494  !! | mm_w_clouds_sed    | Enable/Disable clouds microphysics sedimentation
    9595  !! | mm_w_clouds_nucond | Enable/Disable clouds microphysics nucleation/condensation
     96  !! | mm_free_ch4        | Enable/Disable forcing minimum CH4 concentration
     97  !! | mm_latent_heat     | Enable/Disable latent heat computation
    9698  !! | mm_wsed_m0         | Force all aerosols moments to fall at M0 settling velocity
    9799  !! | mm_wsed_m3         | Force all aerosols moments to fall at M3 settling velocity
     
    135137  !! | mm_rpla     | Planet radius (m)
    136138  !! | mm_g0       | Planet acceleration due to gravity constant (ground) (\(m.s^{-2}\))
     139  !! | mm_cpp      | Specific heat capacity of the atmosphere (J.kg^{-1}.K^{-1})
    137140  !! | mm_air_rad  | Air molecules mean radius (m)
    138141  !! | mm_air_mmol | Air molecules molar mass (\(kg.mol^{-1}\))
     
    157160  PROTECTED :: mm_ini,mm_ini_col,mm_ini_aer,mm_ini_cld
    158161  ! model parameters (mm_global_init)
    159   PROTECTED :: mm_dt,mm_rhoaer,mm_df,mm_rm,mm_p_prod,mm_rc_prod,mm_tx_prod,mm_rpla,mm_g0,mm_rb2ra
     162  PROTECTED :: mm_dt,mm_rhoaer,mm_df,mm_rm,mm_p_prod,mm_rc_prod,mm_tx_prod,mm_rpla,mm_g0,mm_rb2ra,mm_cpp
    160163  ! atmospheric vertical structure (mm_column_init)
    161164  PROTECTED :: mm_nla,mm_nle,mm_zlay,mm_zlev,mm_play,mm_plev,mm_temp,mm_rhoair,mm_btemp,mm_dzlev,mm_dzlay
     
    210213  LOGICAL, SAVE :: mm_w_cloud_sed = .true.    !! Enable/Disable cloud sedimentation.
    211214  LOGICAL, SAVE :: mm_w_cloud_nucond = .true. !! Activate cloud nucleation/condensation.
     215  LOGICAL, SAVE :: mm_free_ch4 = .false.      !! Enable/Disable forcing minimum CH4 concentration
     216  LOGICAL, SAVE :: mm_latent_heat = .false.   !! Enable/Disable latent heat computation
    212217
    213218  INTEGER, PARAMETER :: mm_coag_no = 0 !! no mode interaction for coagulation (i.e. no coagulation at all).
     
    333338  !> Planet acceleration due to gravity constant (ground) (\(m.s^{-2}\)).
    334339  REAL(kind=mm_wp), SAVE                        :: mm_g0       = 1.35_mm_wp
     340  !> Specific heat capacity of the atmosphere (J.kg^{-1}.K^{-1})
     341  REAL(kind=mm_wp), SAVE                        :: mm_cpp      = 1038.73_mm_wp
    335342  !> Air molecules mean radius (m).
    336343  REAL(kind=mm_wp), SAVE                        :: mm_air_rad  = 1.75e-10_mm_wp
     
    606613CONTAINS
    607614
    608   FUNCTION mm_global_init_0(dt,df,rm,rho_aer,p_prod,tx_prod,rc_prod,rplanet,g0, &
    609     air_rad,air_mmol,coag_interactions,clouds,spcfile,  &
     615  FUNCTION mm_global_init_0(dt,df,rm,rho_aer,p_prod,tx_prod,rc_prod,rplanet,g0,cpp, &
     616    air_rad,air_mmol,coag_interactions,clouds,free_ch4,latent_heat,spcfile,  &
    610617    w_haze_prod,w_haze_sed,w_haze_coag,w_cloud_nucond,  &
    611618    w_cloud_sed,force_wsed_to_m0,force_wsed_to_m3,      &
     
    645652    REAL(kind=mm_wp), INTENT(in)           :: g0
    646653    !! Planet gravity acceleration at ground level in \(m.s^{-2}\).
     654    REAL(kind=mm_wp), INTENT(in)           :: cpp
     655    !! Specific heat capacity of the atmosphere (J.kg^{-1}.K^{-1})
    647656    REAL(kind=mm_wp), INTENT(in)           :: air_rad
    648657    !! Air molecules mean radius in meter.
     
    653662    LOGICAL, INTENT(in)                    :: clouds
    654663    !! Clouds microphysics control flag.
     664    LOGICAL, INTENT(in)                    :: free_ch4
     665    !! Methane concentration control flag.
     666    LOGICAL, INTENT(in)                    :: latent_heat
     667    !! Latent heat control flag
    655668    CHARACTER(len=*), INTENT(in)           :: spcfile
    656669    !! Clouds microphysics condensible species properties file.
     
    715728    mm_rpla        = rplanet
    716729    mm_g0          = g0
     730    mm_cpp         = cpp
    717731    mm_dt          = dt
    718732    mm_air_rad     = air_rad
    719     mm_air_mmol    = air_mmol
     733    mm_air_mmol    = air_mmol 
    720734    mm_coag_choice = coag_interactions
    721735    ! check coagulation interactions choice
     
    729743
    730744    mm_w_clouds = clouds
     745    mm_free_ch4 = free_ch4
     746    mm_latent_heat = latent_heat
    731747
    732748    ! Check clouds microphysics species file
     
    937953    IF (err/=0) RETURN
    938954    err = mm_check_opt(cfg_get_value(cfg,"g0",mm_g0),mm_g0,wlog=mm_log)
     955    IF (err/=0) RETURN
     956    err = mm_check_opt(cfg_get_value(cfg,"cpp",mm_cpp),mm_cpp,wlog=mm_log)
    939957    IF (err/=0) RETURN
    940958    err = mm_check_opt(cfg_get_value(cfg,"timestep",mm_dt),mm_dt,wlog=mm_log)
     
    13311349    WRITE(*,'(a,ES14.7)')  "mm_rpla                : ", mm_rpla
    13321350    WRITE(*,'(a,ES14.7)')  "mm_g0                  : ", mm_g0
     1351    WRITE(*,'(a,ES14.7)')  "mm_cpp                 : ", mm_cpp
    13331352    WRITE(*,'(a)')         "======================================="
    13341353  END SUBROUTINE mm_dump_parameters
  • trunk/LMDZ.TITAN/libf/muphytitan/mm_methods.f90

    r4014 r4171  
    363363
    364364    IF(xESP%name == "C2H2") THEN
    365       ! Fray and Schmidt (2009)
     365      ! Fray and Schmitt (2009)
    366366      res = (1.0e5 / pres) * exp(1.340e1 - 2.536e3/temp)
    367367   
    368368    ELSE IF(xESP%name == "C2H6") THEN
    369       ! Fray and Schmidt (2009)
     369      ! Fray and Schmitt (2009)
    370370      res = (1.0e5 / pres) * exp(1.511e1 - 2.207e3/temp - 2.411e4/temp**2 + 7.744e5/temp**3 - 1.161e7/temp**4 + 6.763e7/temp**5)
    371371   
    372372    ELSE IF(xESP%name == "AC6H6") THEN
    373       ! Fray and Schmidt (2009)
     373      ! Fray and Schmitt (2009)
    374374      res = (1.0e5 / pres) * exp(1.735e1 - 5.663e3/temp)
    375375
    376376    ELSE IF(xESP%name == "HCN") THEN
    377       ! Fray and Schmidt (2009)
     377      ! Fray and Schmitt (2009)
    378378      res = (1.0e5 / pres) * exp(1.393e1 - 3.624e3/temp - 1.325e5/temp**2 + 6.314e6/temp**3 - 1.128e8/temp**4)
    379379   
    380380    ELSE IF(xESP%name == "HC3N") THEN
    381       ! Fray and Schmidt (2009)
     381      ! Fray and Schmitt (2009)
    382382      res = (1.0e5 / pres) * exp(1.301e1 - 4.426e3/temp)
    383383   
    384384    ELSE IF (xESP%name == "CH4") THEN
    385       ! Fray and Schmidt (2009)
     385      ! Fray and Schmitt (2009)
    386386      res = (1.0e5 / pres) * exp(1.051e1 - 1.110e3/temp - 4.341e3/temp**2 + 1.035e5/temp**3 - 7.910e5/temp**4)
    387       ! Peculiar case of CH4 : x0.80 (dissolution in N2)
     387      ! Peculiar case of CH4 : x0.80 (dissolution in N2) 
    388388      res = res * 0.80_mm_wp
    389       ! Forcing CH4 to 1.4% minimum
    390       IF (res < 0.014) THEN
    391         res = 0.014
     389      IF (.NOT.mm_free_ch4) THEN
     390        ! Forcing CH4 to 1.4% minimum
     391        IF (res < 0.014) THEN
     392          res = 0.014
     393        ENDIF
    392394      ENDIF
    393395    ENDIF
     
    405407    TYPE(mm_esp), INTENT(in)                   :: xESP !! Specie properties.
    406408    REAL(kind=mm_wp), DIMENSION(SIZE(temp))    :: res  !! Molar mixing ratios of the specie.
     409    INTEGER      :: i
    407410
    408411    IF(xESP%name == "C2H2") THEN
     
    426429      res = (1.0e5 / pres) * exp(1.301e1 - 4.426e3/temp)
    427430   
    428     ! Peculiar case : CH4 : x0.85 (dissolution in N2)
     431    ! Peculiar case : CH4 : x0.85 (dissolution in N2) 
    429432    ELSE IF (xESP%name == "CH4") THEN
    430433      res = (1.0e5 / pres) * exp(1.051e1 - 1.110e3/temp - 4.341e3/temp**2 + 1.035e5/temp**3 - 7.910e5/temp**4)
    431434      ! Peculiar case of CH4 : x0.80 (dissolution in N2)
    432       res = res * 0.80_mm_wp
    433       ! Forcing CH4 to 1.4% minimum
    434       WHERE (res(:) < 0.014) res(:) = 0.014
     435      res(:) = res(:)*0.80_mm_wp
     436      IF (.NOT.mm_free_ch4) THEN
     437        ! Forcing CH4 to 1.4% minimum
     438        WHERE (res(:) < 0.014) res(:) = 0.014
     439      ENDIF
    435440    ENDIF
    436441  END FUNCTION ysatX_ve
  • trunk/LMDZ.TITAN/libf/muphytitan/mm_microphysic.f90

    r3682 r4171  
    6363
    6464
    65   FUNCTION muphys_all(dm0a_s,dm3a_s,dm0a_f,dm3a_f,dm0n,dm3n,dm3i,dgazs) RESULT(ret)
     65  FUNCTION muphys_all(dm0a_s,dm3a_s,dm0a_f,dm3a_f,dm0n,dm3n,dm3i,dgazs,dtlc) RESULT(ret)
    6666    !! Compute the evolution of moments tracers through haze and clouds microphysics processes.
    6767    !!
     
    9898    REAL(kind=mm_wp), INTENT(out), DIMENSION(:,:) :: dgazs
    9999    !! Tendencies of each condensible gaz species (\(mol.mol^{-1}\)).
     100    REAL(kind=mm_wp), INTENT(out), DIMENSION(:) :: dtlc
     101    !! Temperature tendencies due to condensation/evaporation (\(K.s^{-1}\)).
    100102    LOGICAL :: ret
    101103    !! .true. on success (i.e. model has been initialized at least once previously), .false. otherwise.
     
    109111    IF (mm_w_clouds) THEN
    110112      ! Calls cloud microphysics (-> m-3)
    111       call mm_cloud_microphysics(zdm0a_f,zdm3a_f,dm0n,dm3n,dm3i,dgazs)
     113      call mm_cloud_microphysics(zdm0a_f,zdm3a_f,dm0n,dm3n,dm3i,dgazs,dtlc)
    112114      ! add temporary aerosols tendencies (-> m-3)
    113115      dm0a_f = dm0a_f + zdm0a_f  ; dm3a_f = dm3a_f + zdm3a_f
     
    119121        dgazs(:,i) = dgazs(mm_nla:1:-1,i)
    120122      ENDDO
     123      dtlc   = dtlc(mm_nla:1:-1)
    121124    ELSE
    122       dm0n = 0._mm_wp ; dm3n = 0._mm_wp ; dm3i = 0._mm_wp ; dgazs = 0._mm_wp
     125      dm0n = 0._mm_wp ; dm3n = 0._mm_wp ; dm3i = 0._mm_wp ; dgazs = 0._mm_wp ; dtlc = 0._mm_wp
    123126    ENDIF
    124127    ! multiply by altitude thickness and reverse vectors so they go from ground to top :)
     
    155158    ! Calls haze microphysics
    156159    call mm_haze_microphysics(dm0a_s,dm3a_s,dm0a_f,dm3a_f)
    157     ! reverse vectors so they go from ground to top :)
     160    ! reverse vectors so they go from ground to top :
    158161    dm0a_s = dm0a_s(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1)
    159162    dm3a_s = dm3a_s(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1)
  • trunk/LMDZ.TITAN/libf/muphytitan/mmp_gcm.F90

    r3699 r4171  
    4848  CONTAINS
    4949
    50   SUBROUTINE mmp_initialize(dt,p_prod,tx_prod,rc_prod,rplanet,g0, air_rad,air_mmol,clouds,cfgpath)
     50  SUBROUTINE mmp_initialize(dt,p_prod,tx_prod,rc_prod,rplanet,g0,cpp,air_rad,air_mmol,clouds,free_ch4,latent_heat,cfgpath)
    5151    !! Initialize global parameters of the model.
    5252    !!
     
    7979    REAL(kind=mm_wp), INTENT(in)           :: g0
    8080      !! Planet gravity acceleration at ground level in \(m.s^{-2}\).
     81    REAL(kind=mm_wp), INTENT(in)           :: cpp
     82      !! Specific heat capacity of the atmosphere (J.kg^{-1}.K^{-1})
    8183    REAL(kind=mm_wp), INTENT(in)           :: air_rad
    8284      !! Air molecules mean radius in meter.
     
    8587    LOGICAL, INTENT(in)                    :: clouds
    8688      !! Clouds microphysics control flag.
     89    LOGICAL, INTENT(in)                    :: free_ch4
     90      !! Methane control flag
     91    LOGICAL, INTENT(in)                    :: latent_heat
     92      !! Latent heat control flag
    8793    CHARACTER(len=*), INTENT(in), OPTIONAL :: cfgpath
    8894      !! Internal microphysic configuration file.
     
    173179    ! YAMMS initialization.
    174180    ! NB: in MESOSCALE this is done in inifis EMoi
    175     err = mm_global_init_0(dt,df,rm,rho_aer,p_prod,tx_prod,rc_prod,rplanet,g0, &
    176                            air_rad,air_mmol,coag_choice,clouds,spcpath,  &
     181    err = mm_global_init_0(dt,df,rm,rho_aer,p_prod,tx_prod,rc_prod,rplanet,g0,cpp, &
     182                           air_rad,air_mmol,coag_choice,clouds,free_ch4,latent_heat,spcpath,  &
    177183                           w_h_prod,w_h_sed,w_h_coag,w_c_nucond,  &
    178184                           w_c_sed,fwsed_m0,fwsed_m3, &
  • trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90

    r4153 r4171  
    2424!$OMP THREADPRIVATE(callchim,callmufi,callclouds)
    2525      logical,save :: latent_heat
    26 !$OMP THREADPRIVATE(latent_heat)
     26      logical,save :: free_ch4
     27!$OMP THREADPRIVATE(latent_heat,free_ch4)
    2728      logical,save :: global1d
    2829!$OMP THREADPRIVATE(global1d)
  • trunk/LMDZ.TITAN/libf/phytitan/calmufi.F90

    r4048 r4171  
    11
    22
    3 SUBROUTINE calmufi(dt, plev, zlev, play, zlay, g3d, temp, pq, zdqfi, zdq)
     3SUBROUTINE calmufi(dt, plev, zlev, play, zlay, g3d, temp, pq, zdqfi, zdq, zdt)
    44
    55  !! Interface subroutine to YAMMS model for Titan LMDZ GCM.
     
    3636  REAL(kind=8), DIMENSION(:,:,:), INTENT(IN)  :: zdqfi !! Tendency from former processes for tracers (\(X.kg^{-1}}\)).
    3737  REAL(kind=8), DIMENSION(:,:,:), INTENT(OUT) :: zdq   !! Microphysical tendency for tracers (X.kg_air-1.s-1)
     38  REAL(kind=8), DIMENSION(:,:),   INTENT(OUT) :: zdt   !! Microphysical tendency for temperature (K.s^{-1}).
    3839 
    3940  REAL(kind=8), DIMENSION(:,:,:), ALLOCATABLE :: zq !! Local tracers updated from former processes (\(X.kg^{-1}}\)).
     
    5758  REAL(kind=8), DIMENSION(:,:), ALLOCATABLE :: dm3i  !! Tendencies of the 3rd order moments of each ice components (\(m^{3}.m^{-2}\)).
    5859  REAL(kind=8), DIMENSION(:,:), ALLOCATABLE :: dgazs !! Tendencies of each condensible gaz species !(\(mol.mol^{-1}\)).
     60  REAL(kind=8), DIMENSION(:),   ALLOCATABLE :: dtlc  !! Temperature tendencies due to condensation/evaporation (\(K.s^{-1}\)).
    5961
    6062  REAL(kind=8), DIMENSION(:,:), ALLOCATABLE ::  int2ext !! (kg.m-2)
     
    9395  ALLOCATE( dm3i(nlay,nices) )
    9496  ALLOCATE( dgazs(nlay,nices) )
     97  ALLOCATE( dtlc(nlay) )
    9598
    9699  ! Initialization of zdq here since intent=out and no action performed on every tracers
    97100  zdq(:,:,:) = 0.D0
     101
     102  ! Initialization of zdt
     103  zdt(:,:) = 0.D0
    98104
    99105  ! Initialize tracers updated with former processes from physics
     
    158164    ! call microphysics
    159165    IF (callclouds) THEN ! call clouds
    160       IF(.NOT.mm_muphys(dm0as,dm3as,dm0af,dm3af,dm0n,dm3n,dm3i,dgazs)) &
     166      IF(.NOT.mm_muphys(dm0as,dm3as,dm0af,dm3af,dm0n,dm3n,dm3i,dgazs,dtlc)) &
    161167        call abort_program(error("mm_muphys aborted -> initialization not done !",-1))
    162168    ELSE
     
    187193        ! We use the molar mass ratio from GCM in case there is discrepancy with the mm one
    188194      enddo
     195      zdt(ilon,:) = dtlc(:)
    189196    endif
    190197   
     
    194201  ! we want to have routines spitting tendencies in s-1 -> let's divide !
    195202  zdq(:,:,:) = zdq(:,:,:) / dt
     203  zdt(:,:) = zdt(:,:) / dt
    196204
    197205END SUBROUTINE calmufi
  • trunk/LMDZ.TITAN/libf/phytitan/cond_muphy.F90

    r4047 r4171  
    4848!------------------
    4949integer :: iq
    50 real*8  :: Lc(ngrid,nlayer,size(ices_indx)) ! Condensation latente heat [J.kg-1]
     50real*8  :: Lc(ngrid,nlayer,size(ices_indx)) ! Condensation latent heat [J.kg-1]
    5151
    5252
     
    6565call calc_condlh(ngrid,nlayer,pt,Lc)
    6666
    67 
    6867! Sum of condensation latent heat [J.kg_air-1.s-1] :
    6968! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    7574! Condensation heating rate :
    7675! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    77 ! If ice formation  : dqmuficond < 0 --> dtlc > 0
    78 ! Else vaporisation : dqmuficond > 0 --> dtlc < 0
     76! If ice formation  : dqmuficond > 0 --> dtlc > 0
     77! Else vaporisation : dqmuficond < 0 --> dtlc < 0
    7978dtlc(:,:) = dtlc(:,:) / cpp ! [K.s-1]
    8079
  • trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90

    r4153 r4171  
    505505     write(*,*)" latent_heat = ",latent_heat
    506506
     507     write(*,*) "Constrain minimal methane concentration in the atmosphere?"
     508     free_ch4=.false. ! default value
     509     call getin_p("free_ch4",free_ch4)
     510     write(*,*)" free_ch4 = ",free_ch4
     511
    507512     write(*,*) "Disable the coupling of microphysics within rad. transf. ?"
    508513     write(*,*) "If disabled we will assume a planetwide vert. profile of extinction ..."
  • trunk/LMDZ.TITAN/libf/phytitan/inimufi.F90

    r3656 r4171  
    22
    33  use mmp_gcm
    4   use callkeys_mod, only : callclouds, p_prod, tx_prod, rc_prod, air_rad, eff_gz
     4  use callkeys_mod, only : callclouds, p_prod, tx_prod, rc_prod, air_rad, eff_gz, free_ch4, latent_heat
    55  use tracer_h
    6   use comcstfi_mod, only : g, rad, mugaz
     6  use comcstfi_mod, only : g, rad, mugaz, cpp
    77  use datafile_mod
    88
     
    5151 
    5252  call mmp_initialize(ptimestep,p_prod,tx_prod,rc_prod, &
    53         rad,g,air_rad,mugaz,callclouds,config_mufi)
     53        rad,g,cpp,air_rad,mugaz,callclouds,free_ch4,latent_heat,config_mufi)
    5454
    5555   ! -------------------------
  • 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.