Ignore:
Timestamp:
Oct 17, 2023, 9:40:14 AM (15 months ago)
Author:
slebonnois
Message:

BdeBatz? : Cleans microphysics and makes few corrections for physics

Location:
trunk/LMDZ.TITAN/libf/muphytitan
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/muphytitan/argparse.F90

    r3083 r3090  
    1 ! Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
     1! Copyright (c) (2013-2015,2017,2022) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
    22!
    33! This file is part of SWIFT
  • trunk/LMDZ.TITAN/libf/muphytitan/asciiread.f90

    r3083 r3090  
    1 ! Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
     1! Copyright (c) (2013-2015,2017,2022) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
    22!
    33! This file is part of SWIFT
  • trunk/LMDZ.TITAN/libf/muphytitan/cfgparse.F90

    r3083 r3090  
    1 ! Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
     1! Copyright (c) (2013-2015,2017,2022) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
    22!
    33! This file is part of SWIFT
  • trunk/LMDZ.TITAN/libf/muphytitan/config/config.ne15.cfg

    r1897 r3090  
    1919#    2 - SF interactions
    2020#    4 - FF interactions.
    21 # (for example: 5 = 4+1 --> SS and FF coagulation only)
     21# (for example : 5 = 4+1 --> SS and FF coagulation only)
    2222haze_coag_interactions = 7
    2323# Enable/disable Haze sedimentation process
    2424haze_sedimentation     = T
    2525# Disable Fiadero correction for sedimentation process
    26 no_fiadero             = F
     26no_fiadero             = T
    2727# Fiadero correction minimum ratio threshold
    2828fiadero_min_ratio      = 0.1
     
    3030fiadero_max_ratio      = 10.
    3131# Force settling velocity to M0
    32 wsed_m0 = T
     32wsed_m0                = T
    3333# Force settling velocity to M3
    34 wsed_m3 = F
     34wsed_m3                = F
    3535# Enable/disable clouds sedimentation process
    3636# (automatically set to F if clouds microphysics is not enabled)
     
    4141# Condensible species configuration file
    4242# (not needed if clouds microphysics is not enabled)
    43 specie_cfg             = ../datagcm/microphysics/mp2m_species.cfg
     43specie_cfg             = ../../datagcm/microphysics/mp2m_species.cfg
    4444
    4545# Enable/disable spherical mode transfert probability
     
    4747# Path of the spherical mode transfert probability look-up tables file
    4848# (optional if 'transfert_probability' is False)
    49 ps2s_file             = ../datagcm/microphysics/mmp_ps2s_rm50_ne15.nc
     49ps2s_file             = ../../datagcm/microphysics/mmp_ps2s_rm50_ne15.nc
    5050
    5151# Electric charging coagulation correction
     
    5454# Path of the electric charging correction factor.
    5555# (optional if 'electric_charging' is False)
    56 mq_file               = ../datagcm/microphysics/mmp_qmean_rm50_ne15.nc
     56mq_file               = ../../datagcm/microphysics/mmp_qmean_rm50_ne15.nc
    5757
    58 #  alpha_X sections contain the parameters of the inter-moments relation function for
    59 #  the mode X: either spherical (s) or fractal (f)
    60 #  dndr_X sections contain the parameters of the size-distribution law of the mode X
     58### Thresholds related parameters
     59### -----------------------------
     60# Aerosol spherical mode total number min. threshold
     61m0as_min = 1e-10
     62# Aerosol spherical mode min. caracteristic radius threshold
     63rcs_min  = 1e-9
     64# Aerosol fractal mode total number min. threshold
     65m0af_min = 1e-10
     66# Aerosol fractal mode min. caracteristic radius threshold (updated to monomer radius at runtime if needed)
     67rcf_min  = 1e-9
     68# cloud drop total number min. threshold
     69m0n_min = 1e-10
     70
     71
     72# =================== #
     73# alpha_k cofficients #
     74# =================== #
     75# alpha_X sections contain the parameters of the inter-moments relation function for the mode X (spherical (s) or fractal (f))
    6176[alpha_s]
    6277a =   1.5044478E-02,  -2.0948806E-01,  -1.5824302E+02,   1.1597818E-01,   9.9502283E-02,  -1.1223796E-01
    6378b =  -2.8622255E-01,   7.7089599E+00,  -1.7000626E+02,   2.6012143E+00,   5.5138784E-01,   9.2024747E-01
    6479c =  -3.0205020E-02,  -3.5510239E+01,  -2.0306468E+02,  -1.3605159E+01,  -4.1653422E+00,  -4.2571698E+00
    65 [dndr_s]
    66 rc = 4.58219580180634588E-007
    67 a0 = 86144.861255561875
    68 c  = 0d0
    69 a  = 2.48333861883769357E-040, 1.46076790655632173E-013, 1.71525517568997062E-009,
    70     1.80855172875974993E-019, 1.48212594918347503E-047, 6.87247318898338451E-081
    71 b  = 59.518212357684796, 15.507500262021228, -5.4179933012448069,
    72     -9.3500794017892854, -18.207927270524777, -27.248924688740562
     80
    7381[alpha_f]
    7482a =   1.5044478E-02,  -2.0948806E-01,  -1.5824302E+02,   1.1597818E-01,   9.9502283E-02,  -1.1223796E-01
    7583b =  -2.8622255E-01,   7.7089599E+00,  -1.7000626E+02,   2.6012143E+00,   5.5138784E-01,   9.2024747E-01
    7684c =  -3.0205020E-02,  -3.5510239E+01,  -2.0306468E+02,  -1.3605159E+01,  -4.1653422E+00,  -4.2571698E+00
    77 [dndr_f]
    78 rc = 4.58219580180634588E-007
    79 a0 = 86144.861255561875
    80 c  = 0d0
    81 a  = 2.48333861883769357E-040, 1.46076790655632173E-013, 1.71525517568997062E-009,
    82     1.80855172875974993E-019, 1.48212594918347503E-047, 6.87247318898338451E-081
    83 b  = 59.518212357684796, 15.507500262021228, -5.4179933012448069,
    84     -9.3500794017892854, -18.207927270524777, -27.248924688740562
    8585
    8686# ================= #
    8787# b^T_k cofficients #
    8888# ================= #
    89 # This section gathers the values of all the btk coefficient used in the coagulation
    90 # equations for the free-molecular regime.
     89# This section gathers the values of all the btk coefficient used in the coagulation equations for the free-molecular regime
    9190[btks]
    9291bt0 = 0.73d0, 0.73d0, 0.75d0, 0.99d0, 0.00d0
    9392bt3 = 0.97d0, 0.97d0, 0.00d0, 0.99d0, 0.99d0
    94 
    95 [optics]
    96 optic_file = /path/to/optics_look_up_table.nc
    97 
    98 
    99 
  • trunk/LMDZ.TITAN/libf/muphytitan/config/mp2m_species.cfg

    r1793 r3090  
    1 #----------------------------------------------------------------------------------------
    2 # mp_scpecies.cfg
     1# ----------------------------------------------------------------------------------------
     2# mp2m_scpecies.cfg
    33# Thermodynamic properties of chemical species used in the cloud microphysics processes.
    44# Each condensible specie that should be treated by the model must be entirely described
    55# here.
    66#
    7 # Air specie is always mandatory. It is saved in a special variable in the model and is
    8 # never used as cloud condensible specie.
    9 #-----------------------------------------------------------------------------------------
     7# ----------------------------------------------------------------------------------------
    108# PARAMETER | DESCRIPTION
    119# ----------|-----------------------------------------------------------------------------
    1210#  name     | Specie name, should be the same as the section name
    13 #  mas      | Molecular weight
    14 #  vol      | Molecular volume
    15 #  ray      | Molecular radius
    16 #  masmol   | Molar mass
    17 #  rho      | Density
    18 #  tc       | Critical temperature
    19 #  tb       | Boiling temperature
    20 #  pc       | Critical pressure (in bar !!!)
     11#  mas      | Molecular weight      [kg]
     12#  vol      | Molecular volume      [m3]
     13#  ray      | Molecular radius      [m]
     14#  masmol   | Molar mass            [kg.mol-1]
     15#  rho      | Density               [kg.m-3]
     16#  tc       | Critical temperature  [K]
     17#  tb       | Boiling temperature   [K]
     18#  pc       | Critical pressure     [bar]
     19#  tx_prod  | Production rate       [kg.m-2.s-1] (actually this is not used by the model)
    2120#  w        | Acentric factor
    22 #  a_sat    | Coefficient A of Psat equation (from Reid et al. 1986).
    23 #  b_sat    | Coefficient B of Psat equation (from Reid et al. 1986).
    24 #  c_sat    | Coefficient C of Psat equation (from Reid et al. 1986).
    25 #  d_sat    | Coefficient D of Psat equation (from Reid et al. 1986).
     21#  a_sat    | Coefficient A of Psat equation (from Reid et al. 1986)
     22#  b_sat    | Coefficient B of Psat equation (from Reid et al. 1986)
     23#  c_sat    | Coefficient C of Psat equation (from Reid et al. 1986)
     24#  d_sat    | Coefficient D of Psat equation (from Reid et al. 1986)
    2625#  mteta    | Wettability (free parameter in most cases, from 0 to 1)
    27 #  tx_prod  | Production rate (actually this is not used by the model)
    28 #-----------------------------------------------------------------------------------------
     26# -----------------------------------------------------------------------------------------
    2927
    30 ### List of actual species to be used in the model:
    31 ### WARNING : the list of species specified here should be ordered:
    32 ###    In the model, ice tracers as well as condensible gazs species must have the same
    33 ###    index.
    34 used_species = "CH4", "C2H6", "C2H2"
    35 
    36 # AIR properties (MANDATORY !!!)
    37 ################################
    38 [air]
    39 name    = "air"
    40 mas     = 4.650e-26
    41 vol     = 5.750e-29
    42 ray     = 1.750e-10
    43 masmol  = 28.e-3
    44 rho     = 808.6
    45 tc      = 126.2
    46 tb      = 77.4
    47 pc      = 33.9
    48 w       = 3.9e-2
    49 a_sat   = -6.09676
    50 b_sat   = 1.13670
    51 c_sat   = -1.04072
    52 d_sat   = -1.93306
    53 mteta   = 0.
    54 tx_prod = 0.
     28### List of actual species to be used in the model :
     29### WARNING : The list of species specified here should be ordered :
     30###           In the model, ice tracers as well as condensible gazs species must
     31###           have the same index.
     32used_species = CH4, C2H6, C2H2, HCN
    5533
    5634# CH4 properties (useful for Titan :)
    5735#####################################
    5836[CH4]
    59 name    = "CH4"
     37name    = CH4
    6038mas     = 2.6578e-26
    6139vol     = 6.252e-29
    6240ray     = 2.000e-10
    63 masmol  = 16.e-3
     41masmol  = 16.04e-3
    6442rho     = 425.
    65 tc      = 190.4
    66 tb      = 111.6
    67 pc      = 46.0
     43tc      = 190.551
     44tb      = 111.66
     45pc      = 45.992
    6846w       = 1.1e-2
    69 a_sat   = -6.00435
    70 b_sat   = 1.18850
    71 c_sat   = -0.83408
    72 d_sat   = -1.22833
    73 mteta   = 0.92
     47a_sat   = -6.02242
     48b_sat   = 1.26652
     49c_sat   = -0.5707
     50d_sat   = -1.366
     51mteta   = 0.99
    7452tx_prod = 0.
    7553
     
    7755#################
    7856[C2H6]
    79 name    = "C2H6"
     57name    = C2H6
    8058mas     = 4.983e-26
    8159vol     = 9.094e-29
    8260ray     = 2.220e-10
    83 masmol  = 30.e-3
     61masmol  = 30.07e-3
    8462rho     = 544.6
    85 tc      = 305.4
    86 tb      = 184.6
    87 pc      = 48.8
     63tc      = 305.33
     64tb      = 184.55
     65pc      = 48.71
    8866w       = 9.9e-2
    89 a_sat   = -6.34307
    90 b_sat   = 1.01163
    91 c_sat   = -1.19116
    92 d_sat   = -2.03539
    93 mteta   = 0.92
     67a_sat   = -6.47500
     68b_sat   = 1.41071
     69c_sat   = -1.1440
     70d_sat   = -1.8590
     71mteta   = 0.99
    9472tx_prod = 1.2e-12
    9573
     
    9775#################
    9876[C2H2]
    99 name    = "C2H2"
     77name    = C2H2
    10078mas     = 4.319e-26
    10179vol     = 7.020e-29
    10280ray     = 2.015e-10
    103 masmol  = 26.e-3
     81masmol  = 26.04e-3
    10482rho     = 615.
    105 tc      = 308.8
    106 tb      = 188.4
    107 pc      = 61.4
     83tc      = 308.35
     84tb      = 188.40
     85pc      = 61.39
    10886w       = 19.0e-2
    109 a_sat   = -6.90128
    110 b_sat   = 1.26873
    111 c_sat   = -2.09113
    112 d_sat   = -2.75601
    113 mteta   = 0.92
     87a_sat   = -6.87886
     88b_sat   = 1.30164
     89c_sat   = -1.22474
     90d_sat   = -3.59556
     91mteta   = 0.99
    11492tx_prod = 3.2e-13
    11593
     
    11795#################
    11896[HCN]
    119 name    = "HCN"
     97name    = HCN
    12098mas     = 4.484e-26
    12199vol     = 6.498e-29
     
    131109c_sat   = -3.004
    132110d_sat   = 1635.
    133 mteta   = 0.92
     111mteta   = 0.99
    134112tx_prod = 1e-12
    135 
  • trunk/LMDZ.TITAN/libf/muphytitan/csystem.c

    r3083 r3090  
    11/*
    2  * Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
     2 * Copyright (c) (2013-2015,2017,2022) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
    33 *
    44 * This file is part of SWIFT
  • trunk/LMDZ.TITAN/libf/muphytitan/csystem.h

    r3083 r3090  
    11/*
    2  * Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
     2 * Copyright (c) (2013-2015,2017,2022) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
    33 *
    44 * This file is part of SWIFT
  • trunk/LMDZ.TITAN/libf/muphytitan/defined.h

    r3083 r3090  
    11/*
    2  * Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
     2 * Copyright (c) (2013-2015,2017,2022) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
    33 *
    44 * This file is part of SWIFT
  • trunk/LMDZ.TITAN/libf/muphytitan/errors.F90

    r3083 r3090  
    1 ! Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
     1! Copyright (c) (2013-2015,2017,2022) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
    22!
    33! This file is part of SWIFT
  • trunk/LMDZ.TITAN/libf/muphytitan/fsystem.F90

    r3083 r3090  
    1 ! Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
     1! Copyright (c) (2013-2015,2017,2022) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
    22!
    33! This file is part of SWIFT
  • trunk/LMDZ.TITAN/libf/muphytitan/mm_clouds.f90

    r3083 r3090  
    1 ! Copyright 2013-2015,2017,2022 Université de Reims Champagne-Ardenne
    2 ! Contributors: J. Burgalat (GSMA, URCA), B. de Batz de Trenquelléon (GSMA, URCA)
     1! Copyright (2013-2015,2017,2022-2023) Université de Reims Champagne-Ardenne
     2! Contributors : J. Burgalat (GSMA, URCA), B. de Batz de Trenquelléon (GSMA, URCA)
    33! email of the author : jeremie.burgalat@univ-reims.fr
    44!
     
    3535!! summary: Clouds microphysics module
    3636!! author: J. Burgalat
    37 !! date: 2013-2015,2017,2022
    38 !! corrections: B. de Batz de Trenquelléon (2023)
     37!! date: 2013-2015,2017,2022-2023
     38!! modifications: B. de Batz de Trenquelléon
    3939
    4040MODULE MM_CLOUDS
     
    109109      call mm_cloud_sedimentation(zdm0n,zdm3n,zdm3i)
    110110
    111       ! computes precipitation, settling velocity and flux of ices
     111      ! Computes settling velocity [m.s-1] of clouds (ccn and ices)
     112      mm_ccn_vsed(:) = wsettle(mm_play,mm_temp,mm_zlay,mm_drho,mm_drad)
     113
     114      ! Computes flux [kg.m-2.s-1] and precipitation [m.iphysiq] of ccn
     115      mm_ccn_flux(:) = get_mass_flux(mm_rhoaer,mm_m3ccn(:))
    112116      mm_ccn_prec = SUM(zdm3n*mm_dzlev)
    113       mm_ccn_w(:) = wsettle(mm_play,mm_temp,mm_zlay,mm_drho,mm_drad)
    114       mm_ccn_flux(:) = get_mass_flux(mm_rhoaer,mm_m3ccn(:))
    115 
    116       DO i=1, mm_nesp
     117
     118      ! Computes flux [kg.m-2.s-1] and precipitation [m.iphysiq] of ices
     119      DO i = 1, mm_nesp
     120        mm_ice_fluxes(:,i) = get_mass_flux(mm_xESPS(i)%rho,(3._mm_wp*mm_m3ice(:,i))/(4._mm_wp*mm_pi))
    117121        mm_ice_prec(i) = SUM(zdm3i(:,i)*mm_dzlev)
    118         mm_ice_fluxes(:,i) = get_mass_flux(mm_xESPS(i)%rho,mm_m3ice(:,i))
    119122      ENDDO
     123
    120124      ! updates tendencies
    121125      dm0n = dm0n + zdm0n
     
    724728    REAL(kind=mm_wp), INTENT(in) :: rad !! Radius of the particle (m).
    725729    REAL(kind=mm_wp) :: w               !! Settling velocity (\(m.s^{-1}\)).
    726     REAL(kind=mm_wp) :: Us, Fc
     730    REAL(kind=mm_wp) :: Us, Fc, kn
     731    REAL(kind=mm_wp), PARAMETER :: ra = 1.75e-10_mm_wp
     732   
     733    ! Knudsen number
     734    kn = (mm_kboltz * t) / (p * 4._mm_wp * sqrt(2._mm_wp) * mm_pi * ra**2) / rad
     735
     736    ! Computes slip-flow correction : Fc = 1 + (mm_akn * mm_lambda_g(t,p) / rad)
     737    Fc = (1._mm_wp + 1.2517_mm_wp*kn + 0.4_mm_wp*kn*dexp(-1.1_mm_wp/kn))
    727738   
    728739    ! Computes Stokes settling velocity
    729740    Us = (2._mm_wp * rad**2 * rho * mm_effg(z)) / (9._mm_wp * mm_eta_g(t))
    730741   
    731     ! Apply slip-flow correction
    732     Fc = 1 + (mm_akn * mm_lambda_g(t,p) / rad)
    733 
    734     ! Computes settling velocity
    735     w = Us * Fc
    736     !>>> [TEMPO : BBT]
    737     !w = Us * Fc * 5.
    738     !<<< [TEMPO : BBT]
     742    ! Computes settling velocity (correction factor : x2.0)
     743    w = Us * Fc * 2._mm_wp
    739744  END FUNCTION wsettle
    740745
     
    753758    REAL(kind=mm_wp), INTENT(in), DIMENSION(:) :: m3
    754759    !! Vertical profile of the total volume of tracer (i.e. M3) from __TOP__ to __GROUND__ (\(m^{3}.m^{-3}\)).
    755     REAL(kind=mm_wp), DIMENSION(SIZE(m3)) :: flx
     760    REAL(kind=mm_wp), DIMENSION(SIZE(m3))      :: flx
    756761    !! Mass sedimentation fluxes at each layer from __TOP__ to __GROUND__ (\(kg.m^{-2}.s^{-1}\)).
    757     REAL(kind=mm_wp), SAVE :: fac = 4._mm_wp/3._mm_wp * mm_pi
    758     flx = fac * rho * m3 * wsettle(mm_play,mm_temp,mm_zlay,mm_drho,mm_drad)
     762    REAL(kind=mm_wp), SAVE :: pifac = (4._mm_wp * mm_pi) / 3._mm_wp
     763    flx = rho * pifac * m3 * wsettle(mm_play,mm_temp,mm_zlay,mm_drho,mm_drad)
    759764    RETURN
    760765  END FUNCTION get_mass_flux
  • trunk/LMDZ.TITAN/libf/muphytitan/mm_globals.f90

    r3083 r3090  
    1 ! Copyright 2013-2015,2017,2022 Université de Reims Champagne-Ardenne
    2 ! Contributor: J. Burgalat (GSMA, URCA)
     1! Copyright (2013-2015,2017,2022-2023) Université de Reims Champagne-Ardenne
     2! Contributors : J. Burgalat (GSMA, URCA), B. de Batz de Trenquelléon (GSMA, URCA)
    33! email of the author : jeremie.burgalat@univ-reims.fr
    44!
     
    3535!! summary: Parameters and global variables module.
    3636!! author: J. Burgalat
    37 !! date: 2013-2015,2017,2022
     37!! date: 2013-2015,2017,2022-2023
     38!! modifications: B. de Batz de Trenquelléon
    3839
    3940MODULE MM_GLOBALS
     
    274275
    275276  ! Thresholds !
    276 
    277277  !> (min.) Total number of aerosols minimum threshold for the spherical mode.
    278278  REAL(kind=mm_wp), SAVE :: mm_m0as_min = 1.e-10_mm_wp
    279 
    280279  !> (min.) Total volume of aerosols minimum threshold for the spherical mode.
    281280  REAL(kind=mm_wp), SAVE :: mm_m3as_min = 1.e-40_mm_wp
    282 
    283281  !> Characteristic radius minimum threshold for the spherical mode.
    284282  REAL(kind=mm_wp), SAVE :: mm_rcs_min = 1.e-9_mm_wp
     
    286284  !> (min.) Total number of aerosols minimum threshold for the fractal mode.
    287285  REAL(kind=mm_wp), SAVE :: mm_m0af_min = 1.e-10_mm_wp
    288 
    289286  !> (min.) Total volume of aerosols minimum threshold for the fractal mode.
    290287  REAL(kind=mm_wp), SAVE :: mm_m3af_min = 1.e-40_mm_wp
    291 
    292288  !> Characteristic radius minimum threshold for the fractal mode.
    293289  REAL(kind=mm_wp), SAVE :: mm_rcf_min = 1.e-9_mm_wp
     
    295291  !> (min.) Total number of cloud drop minimum threshold.
    296292  REAL(kind=mm_wp), SAVE :: mm_m0n_min = 1.e-10_mm_wp
    297 
    298293  !> (min.) Total volume of cloud drop minimum threshold.
    299294  REAL(kind=mm_wp), SAVE :: mm_m3cld_min = 1.e-40_mm_wp
     295  !> Minimum cloud drop radius
     296  REAL(kind=mm_wp), SAVE :: mm_drad_min = 1.e-9_mm_wp
     297  !> Maximum cloud drop radius
     298  REAL(kind=mm_wp), SAVE :: mm_drad_max = 1.e-3_mm_wp
    300299
    301300  !> Characteristic radius threshold.
    302301  REAL(kind=mm_wp), SAVE :: mm_rc_min = 1.e-200_mm_wp
    303 
    304   !> Minimum cloud drop radius
    305   REAL(kind=mm_wp), SAVE :: mm_drad_min = 1.e-9_mm_wp
    306 
    307   !> Maximum cloud drop radius
    308   REAL(kind=mm_wp), SAVE :: mm_drad_max = 1.e-3_mm_wp
    309302
    310303  !> Name of condensible species.
     
    442435  REAL(kind=mm_wp), SAVE :: mm_aer_prec = 0._mm_wp
    443436
     437  !> CCN precipitations (m).
     438  !! It is updated in [[mm_clouds(module):mm_cloud_microphysics(subroutine)]].
     439  REAL(kind=mm_wp), SAVE :: mm_ccn_prec = 0._mm_wp
     440
    444441  !> Spherical mode \(M_{0}\) settling velocity (\(m.s^{-1}\)).
    445442  !!
     
    478475  REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_m3af_vsed
    479476
     477  !> CCN settling velocity (\(m.s^{-1}\)).
     478  !!
     479  !! It is a vector with the vertical layers that contains the
     480  !! settling velocity for CCN (and ices).
     481  !! It is updated in [[mm_clouds(module):mm_cloud_microphysics(subroutine)]].
     482  REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_ccn_vsed
     483
    480484  !> Spherical aerosol mass fluxes (\(kg.m^{-2}.s^{-1}\)).
    481485  !!
     
    493497  !! This variable is always negative.
    494498  REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_aer_f_flux
    495 
    496   !> CCN precipitations (m).
    497   !! It is updated in [[mm_clouds(module):mm_cloud_microphysics(subroutine)]].
    498   REAL(kind=mm_wp), SAVE :: mm_ccn_prec = 0._mm_wp
    499 
    500   !> CCN settling velocity (\(m.s^{-1}\)).
    501   !!
    502   !! It is a vector with the vertical layers that contains the
    503   !! settling velocity for CCN (and ices).
    504   !! It is updated in [[mm_clouds(module):mm_cloud_microphysics(subroutine)]].
    505   !! @note
    506   !! This variable is always positive.
    507   REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_ccn_w
    508499 
    509500  !> CCN mass fluxes (\(kg.m^{-2}.s^{-1}\)).
     
    512503  !! mass fluxes for CCN.
    513504  !! It is updated in [[mm_clouds(module):mm_cloud_microphysics(subroutine)]].
    514   !! @note
    515   !! This variable is always positive.
    516505  REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_ccn_flux
    517506
     
    593582  !$OMP THREADPRIVATE(mm_m0ccn,mm_m3ccn,mm_m3ice,mm_gazs)
    594583  !$OMP THREADPRIVATE(mm_rcs,mm_rcf,mm_drad,mm_drho)
    595   !$OMP THREADPRIVATE(mm_aer_s_flux,mm_aer_f_flux,mm_ccn_w,mm_ccn_flux,mm_ice_prec,mm_ice_fluxes,mm_gazs_sat)
    596584  !$OMP THREADPRIVATE(mm_m0as_vsed,mm_m3as_vsed,mm_m0af_vsed,mm_m3af_vsed)
     585  !$OMP THREADPRIVATE(mm_aer_s_flux,mm_aer_f_flux,mm_ccn_vsed,mm_ccn_flux,mm_ice_prec,mm_ice_fluxes,mm_gazs_sat)
    597586  !$OMP THREADPRIVATE(mm_m0as_min,mm_m3as_min,mm_rcs_min,mm_m0af_min,mm_m3af_min,mm_rcf_min,mm_m0n_min,mm_m3cld_min)
    598587  !$OMP THREADPRIVATE(mm_nla,mm_nle)
     
    997986    err = mm_check_opt(cfg_get_value(cfg,"fiadero_min_ratio",mm_fiadero_min),mm_fiadero_min,zfiamin,wlog=mm_log)
    998987    err = mm_check_opt(cfg_get_value(cfg,"fiadero_max_ratio",mm_fiadero_max),mm_fiadero_max,zfiamax,wlog=mm_log)
    999 
    1000988    err = mm_check_opt(cfg_get_value(cfg,"m0as_min",mm_m0as_min),mm_m0as_min,1e-10_mm_wp,wlog=mm_log)
    1001989    err = mm_check_opt(cfg_get_value(cfg,"rcs_min",mm_rcs_min),mm_rcs_min,1e-9_mm_wp,wlog=mm_log)
     
    1003991    err = mm_check_opt(cfg_get_value(cfg,"rcf_min",mm_rcf_min),mm_rcf_min,mm_rm,wlog=mm_log)
    1004992    err = mm_check_opt(cfg_get_value(cfg,"m0n_min",mm_m0n_min),mm_m0n_min,1e-10_mm_wp,wlog=mm_log)
    1005 
    1006993
    1007994    ! force fractal radius minimum threshold to monomer radius ^^
     
    11521139    IF (.NOT.ALLOCATED(mm_rcf))     ALLOCATE(mm_rcf(mm_nla))
    11531140    ! Allocate memory for diagnostics
     1141    IF (.NOT.ALLOCATED(mm_m0as_vsed)) THEN
     1142      ALLOCATE(mm_m0as_vsed(mm_nla)) ; mm_m0as_vsed(:) = 0._mm_wp
     1143    ENDIF
     1144    IF (.NOT.ALLOCATED(mm_m3as_vsed)) THEN
     1145      ALLOCATE(mm_m3as_vsed(mm_nla)) ; mm_m3as_vsed(:) = 0._mm_wp
     1146    ENDIF
     1147    IF (.NOT.ALLOCATED(mm_m0af_vsed)) THEN
     1148      ALLOCATE(mm_m0af_vsed(mm_nla)) ; mm_m0af_vsed(:) = 0._mm_wp
     1149    ENDIF
     1150    IF (.NOT.ALLOCATED(mm_m3af_vsed)) THEN
     1151      ALLOCATE(mm_m3af_vsed(mm_nla)) ; mm_m3af_vsed(:) = 0._mm_wp
     1152    ENDIF
    11541153    IF (.NOT.ALLOCATED(mm_aer_s_flux)) THEN
    11551154      ALLOCATE(mm_aer_s_flux(mm_nla)) ; mm_aer_s_flux(:) = 0._mm_wp
     
    11571156    IF (.NOT.ALLOCATED(mm_aer_f_flux)) THEN
    11581157      ALLOCATE(mm_aer_f_flux(mm_nla)) ; mm_aer_f_flux(:) = 0._mm_wp
    1159     ENDIF
    1160     IF (.NOT.ALLOCATED(mm_m0as_vsed)) THEN
    1161       ALLOCATE(mm_m0as_vsed(mm_nla)) ; mm_m0as_vsed(:) = 0._mm_wp
    1162     ENDIF
    1163     IF (.NOT.ALLOCATED(mm_m3as_vsed)) THEN
    1164       ALLOCATE(mm_m3as_vsed(mm_nla)) ; mm_m3as_vsed(:) = 0._mm_wp
    1165     ENDIF
    1166     IF (.NOT.ALLOCATED(mm_m0af_vsed)) THEN
    1167       ALLOCATE(mm_m0af_vsed(mm_nla)) ; mm_m0af_vsed(:) = 0._mm_wp
    1168     ENDIF
    1169     IF (.NOT.ALLOCATED(mm_m3af_vsed)) THEN
    1170       ALLOCATE(mm_m3af_vsed(mm_nla)) ; mm_m3af_vsed(:) = 0._mm_wp
    11711158    ENDIF
    11721159    ! note : mm_dzlev is already from top to ground
     
    12411228    IF (.NOT.ALLOCATED(mm_drho))    ALLOCATE(mm_drho(mm_nla))
    12421229    ! Allocate memory for diagnostics
    1243     IF (.NOT.ALLOCATED(mm_ccn_w)) THEN
    1244       ALLOCATE(mm_ccn_w(mm_nla)) ; mm_ccn_w(:) = 0._mm_wp
     1230    IF (.NOT.ALLOCATED(mm_ccn_vsed)) THEN
     1231      ALLOCATE(mm_ccn_vsed(mm_nla)) ; mm_ccn_vsed(:) = 0._mm_wp
    12451232    ENDIF
    12461233    IF (.NOT.ALLOCATED(mm_ccn_flux)) THEN
     
    14441431    ! Initialization :
    14451432    Ntot = m0ccn
    1446     Vtot = pifac * m3ccn + SUM(m3ice)
    1447     Wtot = pifac * ((m3ccn*mm_rhoaer) + SUM(m3ice*mm_xESPS(:)%rho))
     1433    Vtot = pifac*m3ccn + SUM(m3ice)
     1434    Wtot = pifac*m3ccn*mm_rhoaer + SUM(m3ice*mm_xESPS(:)%rho)
    14481435
    14491436    IF (Ntot <= mm_m0n_min .OR. Vtot <= mm_m3cld_min) THEN
  • trunk/LMDZ.TITAN/libf/muphytitan/mm_haze.f90

    r3083 r3090  
    731731      cslf = mm_akn * mm_lambda_g(mm_btemp(i),mm_plev(i))
    732732      wth(i) = - csto/(rb2ra*afun(k)) * (rc(i-1)**ar1 * afun(af1) + cslf/rb2ra * rc(i-1)**ar2 * afun(af2))
    733 
    734       ! >>> [TEMPO : BBT]
    735       !wth(i) = wth(i) * (2574e3 / (2574e3+mm_zlev(i)))**4
    736       ! <<< [TEMPO : BBT]
    737733     
    738734      ! now correct velocity to reduce numerical diffusion
  • trunk/LMDZ.TITAN/libf/muphytitan/mm_methods.f90

    r3083 r3090  
    1 ! Copyright 2013-2015,2017,2022 Université de Reims Champagne-Ardenne
    2 ! Contributors: J. Burgalat (GSMA, URCA), B. de Batz de Trenquelléon (GSMA, URCA)
     1! Copyright (2013-2015,2017,2022-2023) Université de Reims Champagne-Ardenne
     2! Contributors : J. Burgalat (GSMA, URCA), B. de Batz de Trenquelléon (GSMA, URCA)
    33! email of the author : jeremie.burgalat@univ-reims.fr
    44!
     
    3535!! summary: Model miscellaneous methods module.
    3636!! author: J. Burgalat
    37 !! date: 2013-2015,2017,2022
    38 !! corrections: B. de Batz de Trenquelléon (2023)
     37!! date: 2013-2015,2017,2022-2023
     38!! modifications: B. de Batz de Trenquelléon
    3939
    4040MODULE MM_METHODS
     
    133133  !!
    134134  !! The method computes the molar mixing ratio at saturation of a given specie at given temperature(s)
    135   !! and pressure level(s) [Fray and Schmidt (2009)].
     135  !! and pressure level(s).
    136136  !!
    137137  !! ```fortran
     
    314314    !!
    315315    !! @warning
    316     !! The method applies a multiplicative factor of 0.85 if the specie is CH4 :
     316    !! The method applies a multiplicative factor of 0.80 if the specie is CH4 :
    317317    !! this is done to account for dissolution in N2 and is somehow specific to Titan atmosphere.
    318318    REAL(kind=mm_wp), INTENT(in) :: temp !! Temperature (K).
    319319    REAL(kind=mm_wp), INTENT(in) :: pres !! Pressure level (Pa).
    320     TYPE(mm_esp), INTENT(in)    :: xESP !! Specie properties.
    321     REAL(kind=mm_wp) :: res              !! Mass mixing ratio of the specie.
    322     REAL(kind=mm_wp) :: psat
     320    TYPE(mm_esp), INTENT(in)     :: xESP !! Specie properties.
     321    REAL(kind=mm_wp)             :: res  !! Mass mixing ratio of the specie.
     322    REAL(kind=mm_wp)             :: psat
    323323    psat = mm_psatX(temp,xESP)
    324324    res = (psat / pres) * xESP%fmol2fmas
    325     ! Peculiar case : CH4 : x0.85 (dissolution in N2)
     325    ! Peculiar case of CH4 : x0.80 (dissolution in N2)
    326326    IF (xESP%name == "CH4") THEN
    327       res = res * 0.85_mm_wp
     327      res = res * 0.80_mm_wp
    328328      IF (mm_debug) WRITE(*,'(a)') "[DEBUG] mm_qsat: applying .85 factor to qsat for CH4 specie (N2 dissolution)"
    329329    ENDIF
     
    339339    REAL(kind=mm_wp), INTENT(in), DIMENSION(:) :: pres !! Pressure levels (Pa).
    340340    TYPE(mm_esp), INTENT(in)                   :: xESP !! Specie properties.
    341     REAL(kind=mm_wp), DIMENSION(SIZE(temp)) :: res     !! Mass mixing ratios of the specie.
    342     REAL(kind=mm_wp), DIMENSION(SIZE(temp)) :: psat
     341    REAL(kind=mm_wp), DIMENSION(SIZE(temp))    :: res  !! Mass mixing ratios of the specie.
     342    REAL(kind=mm_wp), DIMENSION(SIZE(temp))    :: psat
    343343    psat = mm_psatX(temp,xESP)
    344344    res = (psat / pres) * xESP%fmol2fmas
    345     ! Peculiar case : CH4 : x0.85 (dissolution in N2)
     345    ! Peculiar case of CH4 : x0.80 (dissolution in N2)
    346346    IF (xESP%name == "CH4") THEN
    347       res = res * 0.85_mm_wp
     347      res = res * 0.80_mm_wp
    348348      IF (mm_debug) WRITE(*,'(a)') "[DEBUG] mm_qsat: applying .85 factor to qsat for CH4 specie (N2 dissolution)"
    349349    ENDIF
     
    352352  FUNCTION ysatX_sc(temp,pres,xESP) RESULT(res)
    353353    !! Get the molar mixing ratio of a given specie at saturation (scalar).
     354    !! Compute saturation profiles (mol/mol) for condensable tracers
    354355    !!
    355356    !! @warning
    356     !! The method applies a multiplicative factor of 0.85 if the specie is CH4 :
     357    !! The method applies a multiplicative factor of 0.80 if the specie is CH4 :
    357358    !! this is done to account for dissolution in N2 and is somehow specific to Titan atmosphere.
    358359    REAL(kind=mm_wp), INTENT(in) :: temp !! Temperature (K).
     
    361362    REAL(kind=mm_wp)             :: res  !! Molar mixing ratio of the specie.
    362363
    363     ! Fray and Schmidt (2009)
    364364    IF(xESP%name == "C2H2") THEN
     365      ! Fray and Schmidt (2009)
    365366      res = (1.0e5 / pres) * exp(1.340e1 - 2.536e3/temp)
    366367   
    367368    ELSE IF(xESP%name == "C2H6") THEN
     369      ! Fray and Schmidt (2009)
    368370      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)
    369371   
    370372    ELSE IF(xESP%name == "HCN") THEN
     373      ! Fray and Schmidt (2009)
    371374      res = (1.0e5 / pres) * exp(1.393e1 - 3.624e3/temp - 1.325e5/temp**2 + 6.314e6/temp**3 - 1.128e8/temp**4)
    372375   
    373376    ELSE IF (xESP%name == "CH4") THEN
     377      ! Fray and Schmidt (2009)
    374378      res = (1.0e5 / pres) * exp(1.051e1 - 1.110e3/temp - 4.341e3/temp**2 + 1.035e5/temp**3 - 7.910e5/temp**4)
    375       res = res * 0.85_mm_wp
    376       !IF (res < 0.014) THEN
    377       !  res = 0.014
    378       !ENDIF
     379      ! Peculiar case of CH4 : x0.80 (dissolution in N2)
     380      res = res * 0.80_mm_wp
     381      ! Forcing CH4 to 1.4% minimum
     382      IF (res < 0.014) THEN
     383        res = 0.014
     384      ENDIF
    379385    ENDIF
    380386  END FUNCTION ysatX_sc
     
    382388  FUNCTION ysatX_ve(temp,pres,xESP) RESULT(res)
    383389    !! Get the molar mixing ratio of a given specie at saturation (vector).
     390    !! Compute saturation profiles (mol/mol) for condensable tracers
    384391    !!
    385392    !! @warning
    386     !! The method applies a multiplicative factor of 0.85 if the specie is CH4 :
     393    !! The method applies a multiplicative factor of 0.80 if the specie is CH4 :
    387394    !! this is done to account for dissolution in N2 and is somehow specific to Titan atmosphere.
    388395    REAL(kind=mm_wp), INTENT(in), DIMENSION(:) :: temp !! Temperatures (K).
     
    391398    REAL(kind=mm_wp), DIMENSION(SIZE(temp))    :: res  !! Molar mixing ratios of the specie.
    392399
    393     ! Fray and Schmidt (2009)
    394400    IF(xESP%name == "C2H2") THEN
     401      ! Fray and Schmidt (2009)
    395402      res = (1.0e5 / pres) * exp(1.340e1 - 2.536e3/temp)
    396403   
    397404    ELSE IF(xESP%name == "C2H6") THEN
     405      ! Fray and Schmidt (2009)
    398406      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)
    399407   
    400408    ELSE IF(xESP%name == "HCN") THEN
     409      ! Fray and Schmidt (2009)
    401410      res = (1.0e5 / pres) * exp(1.393e1 - 3.624e3/temp - 1.325e5/temp**2 + 6.314e6/temp**3 - 1.128e8/temp**4)
    402411   
     
    404413    ELSE IF (xESP%name == "CH4") THEN
    405414      res = (1.0e5 / pres) * exp(1.051e1 - 1.110e3/temp - 4.341e3/temp**2 + 1.035e5/temp**3 - 7.910e5/temp**4)
    406       res = res * 0.85_mm_wp
    407       !WHERE (res(:) < 0.014) res(:) = 0.014
     415      ! Peculiar case of CH4 : x0.80 (dissolution in N2)
     416      res = res * 0.80_mm_wp
     417      ! Forcing CH4 to 1.4% minimum
     418      WHERE (res(:) < 0.014) res(:) = 0.014
    408419    ENDIF
    409420  END FUNCTION ysatX_ve
  • trunk/LMDZ.TITAN/libf/muphytitan/mm_microphysic.f90

    r3083 r3090  
    1 ! Copyright 2013-2015,2017,2022 Université de Reims Champagne-Ardenne
    2 ! Contributor: J. Burgalat (GSMA, URCA)
     1! Copyright (2013-2015,2017,2022-2023) Université de Reims Champagne-Ardenne
     2! Contributors : J. Burgalat (GSMA, URCA), B. de Batz de Trenquelléon (GSMA, URCA)
    33! email of the author : jeremie.burgalat@univ-reims.fr
    44!
     
    3535!! brief: Microphysic processes interface module.
    3636!! author: J. Burgalat
    37 !! date: 2013-2015,2017,2022
     37!! date: 2013-2015,2017,2022-2023
     38!! modifications: B. de Batz de Trenquelléon
    3839
    3940MODULE MM_MICROPHYSIC
     
    114115      dm0n   = dm0n(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1)
    115116      dm3n   = dm3n(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1)
    116       ! sanity check for clouds tendencies : call mm_check_tendencies(mm_m0ccn,dm0n)
    117       ! sanity check for clouds tendencies : call mm_check_tendencies(mm_m3ccn,dm3n)
    118117      DO i=1,mm_nesp
    119118        dm3i(:,i)  = dm3i(mm_nla:1:-1,i) * mm_dzlev(mm_nla:1:-1)
    120         ! sanity check for clouds tendencies : call mm_check_tendencies(mm_m3ice,dm3i)
    121119        dgazs(:,i) = dgazs(mm_nla:1:-1,i)
    122         ! no sanity check for gazs, let's prey.
    123120      ENDDO
    124121    ELSE
     
    130127    dm0a_f = dm0a_f(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1)
    131128    dm3a_f = dm3a_f(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1)
    132     ! sanity check
    133     ! sanity check : call mm_check_tendencies(mm_m0aer_s,dm0a_s)
    134     ! sanity check : call mm_check_tendencies(mm_m3aer_s,dm3a_s)
    135     ! sanity check : call mm_check_tendencies(mm_m0aer_f,dm0a_f)
    136     ! sanity check : call mm_check_tendencies(mm_m3aer_f,dm3a_f)
    137129    RETURN
    138130  END FUNCTION muphys_all
     
    168160    dm0a_f = dm0a_f(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1)
    169161    dm3a_f = dm3a_f(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1)
    170     ! sanity check
    171     ! sanity check : call mm_check_tendencies(mm_m0aer_s,dm0a_s)
    172     ! sanity check : call mm_check_tendencies(mm_m3aer_s,dm3a_s)
    173     ! sanity check : call mm_check_tendencies(mm_m0aer_f,dm0a_f)
    174     ! sanity check : call mm_check_tendencies(mm_m3aer_f,dm3a_f)
    175162    RETURN
    176163  END FUNCTION muphys_nocld
     
    219206      IF (PRESENT(ccn_prec))   ccn_prec   = ABS(mm_ccn_prec)
    220207      IF (PRESENT(ice_prec))   ice_prec   = ABS(mm_ice_prec)
    221       IF (PRESENT(ccn_w))      ccn_w      = mm_ccn_w(mm_nla:1:-1)
    222       IF (PRESENT(ccn_flux))   ccn_flux   = -mm_ccn_flux(mm_nla:1:-1)
     208      IF (PRESENT(ccn_w))      ccn_w      = mm_ccn_vsed(mm_nla:1:-1)
     209      IF (PRESENT(ccn_flux))   ccn_flux   = mm_ccn_flux(mm_nla:1:-1)
    223210      IF (PRESENT(ice_fluxes)) ice_fluxes = mm_ice_fluxes(mm_nla:1:-1,:)
    224       IF (PRESENT(gazs_sat))   gazs_sat   =  mm_gazs_sat(mm_nla:1:-1,:)
     211      IF (PRESENT(gazs_sat))   gazs_sat   = mm_gazs_sat(mm_nla:1:-1,:)
    225212    ELSE
    226213      IF (PRESENT(ccn_prec))   ccn_prec   = 0._mm_wp
  • trunk/LMDZ.TITAN/libf/muphytitan/mmp_gcm.f90

    r3083 r3090  
    1 ! Copyright 2017 Université de Reims Champagne-Ardenne
    2 ! Contributor: J. Burgalat (GSMA, URCA)
     1! Copyright (2017,2022-2023) Université de Reims Champagne-Ardenne
     2! Contributors : J. Burgalat (GSMA, URCA), B. de Batz de Trenquelléon (GSMA, URCA)
    33! email of the author : jeremie.burgalat@univ-reims.fr
    44!
     
    3535!! summary: YAMMS interfaces for the LMDZ GCM.
    3636!! author: J. Burgalat
    37 !! date: 2017
     37!! date: 2017,2022,2023
     38!! modifications: B. de Batz de Trenquelléon
    3839MODULE MMP_GCM
    3940  !! Interface to YAMMS for the LMDZ GCM.
     
    247248    WRITE(*,'(a,L2)')     "electric_charging    : ", mmp_w_qe
    248249    call mm_dump_parameters()
    249 
    250250    IF (clouds) THEN
    251251      DO i=1, size(mm_xESPS)
  • trunk/LMDZ.TITAN/libf/muphytitan/string_op.F90

    r3083 r3090  
    1 ! Copyright (c) (2013-2015,2017) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
     1! Copyright (c) (2013-2015,2017,2022) Jeremie Burgalat (jeremie.burgalat@univ-reims.fr).
    22!
    33! This file is part of SWIFT
Note: See TracChangeset for help on using the changeset viewer.