Changeset 3090 for trunk/LMDZ.TITAN/libf
- Timestamp:
- Oct 17, 2023, 9:40:14 AM (14 months ago)
- Location:
- trunk/LMDZ.TITAN/libf
- Files:
-
- 35 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). 2 2 ! 3 3 ! 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). 2 2 ! 3 3 ! 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). 2 2 ! 3 3 ! This file is part of SWIFT -
trunk/LMDZ.TITAN/libf/muphytitan/config/config.ne15.cfg
r1897 r3090 19 19 # 2 - SF interactions 20 20 # 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) 22 22 haze_coag_interactions = 7 23 23 # Enable/disable Haze sedimentation process 24 24 haze_sedimentation = T 25 25 # Disable Fiadero correction for sedimentation process 26 no_fiadero = F26 no_fiadero = T 27 27 # Fiadero correction minimum ratio threshold 28 28 fiadero_min_ratio = 0.1 … … 30 30 fiadero_max_ratio = 10. 31 31 # Force settling velocity to M0 32 wsed_m0 = T32 wsed_m0 = T 33 33 # Force settling velocity to M3 34 wsed_m3 = F34 wsed_m3 = F 35 35 # Enable/disable clouds sedimentation process 36 36 # (automatically set to F if clouds microphysics is not enabled) … … 41 41 # Condensible species configuration file 42 42 # (not needed if clouds microphysics is not enabled) 43 specie_cfg = ../ datagcm/microphysics/mp2m_species.cfg43 specie_cfg = ../../datagcm/microphysics/mp2m_species.cfg 44 44 45 45 # Enable/disable spherical mode transfert probability … … 47 47 # Path of the spherical mode transfert probability look-up tables file 48 48 # (optional if 'transfert_probability' is False) 49 ps2s_file = ../ datagcm/microphysics/mmp_ps2s_rm50_ne15.nc49 ps2s_file = ../../datagcm/microphysics/mmp_ps2s_rm50_ne15.nc 50 50 51 51 # Electric charging coagulation correction … … 54 54 # Path of the electric charging correction factor. 55 55 # (optional if 'electric_charging' is False) 56 mq_file = ../ datagcm/microphysics/mmp_qmean_rm50_ne15.nc56 mq_file = ../../datagcm/microphysics/mmp_qmean_rm50_ne15.nc 57 57 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 61 m0as_min = 1e-10 62 # Aerosol spherical mode min. caracteristic radius threshold 63 rcs_min = 1e-9 64 # Aerosol fractal mode total number min. threshold 65 m0af_min = 1e-10 66 # Aerosol fractal mode min. caracteristic radius threshold (updated to monomer radius at runtime if needed) 67 rcf_min = 1e-9 68 # cloud drop total number min. threshold 69 m0n_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)) 61 76 [alpha_s] 62 77 a = 1.5044478E-02, -2.0948806E-01, -1.5824302E+02, 1.1597818E-01, 9.9502283E-02, -1.1223796E-01 63 78 b = -2.8622255E-01, 7.7089599E+00, -1.7000626E+02, 2.6012143E+00, 5.5138784E-01, 9.2024747E-01 64 79 c = -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 73 81 [alpha_f] 74 82 a = 1.5044478E-02, -2.0948806E-01, -1.5824302E+02, 1.1597818E-01, 9.9502283E-02, -1.1223796E-01 75 83 b = -2.8622255E-01, 7.7089599E+00, -1.7000626E+02, 2.6012143E+00, 5.5138784E-01, 9.2024747E-01 76 84 c = -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-00779 a0 = 86144.86125556187580 c = 0d081 a = 2.48333861883769357E-040, 1.46076790655632173E-013, 1.71525517568997062E-009,82 1.80855172875974993E-019, 1.48212594918347503E-047, 6.87247318898338451E-08183 b = 59.518212357684796, 15.507500262021228, -5.4179933012448069,84 -9.3500794017892854, -18.207927270524777, -27.24892468874056285 85 86 86 # ================= # 87 87 # b^T_k cofficients # 88 88 # ================= # 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 91 90 [btks] 92 91 bt0 = 0.73d0, 0.73d0, 0.75d0, 0.99d0, 0.00d0 93 92 bt3 = 0.97d0, 0.97d0, 0.00d0, 0.99d0, 0.99d0 94 95 [optics]96 optic_file = /path/to/optics_look_up_table.nc97 98 99 -
trunk/LMDZ.TITAN/libf/muphytitan/config/mp2m_species.cfg
r1793 r3090 1 # ----------------------------------------------------------------------------------------2 # mp _scpecies.cfg1 # ---------------------------------------------------------------------------------------- 2 # mp2m_scpecies.cfg 3 3 # Thermodynamic properties of chemical species used in the cloud microphysics processes. 4 4 # Each condensible specie that should be treated by the model must be entirely described 5 5 # here. 6 6 # 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 # ---------------------------------------------------------------------------------------- 10 8 # PARAMETER | DESCRIPTION 11 9 # ----------|----------------------------------------------------------------------------- 12 10 # 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) 21 20 # 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) 26 25 # 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 # ----------------------------------------------------------------------------------------- 29 27 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. 32 used_species = CH4, C2H6, C2H2, HCN 55 33 56 34 # CH4 properties (useful for Titan :) 57 35 ##################################### 58 36 [CH4] 59 name = "CH4"37 name = CH4 60 38 mas = 2.6578e-26 61 39 vol = 6.252e-29 62 40 ray = 2.000e-10 63 masmol = 16. e-341 masmol = 16.04e-3 64 42 rho = 425. 65 tc = 190. 466 tb = 111.6 67 pc = 4 6.043 tc = 190.551 44 tb = 111.66 45 pc = 45.992 68 46 w = 1.1e-2 69 a_sat = -6.0 043570 b_sat = 1. 1885071 c_sat = -0. 8340872 d_sat = -1. 2283373 mteta = 0.9 247 a_sat = -6.02242 48 b_sat = 1.26652 49 c_sat = -0.5707 50 d_sat = -1.366 51 mteta = 0.99 74 52 tx_prod = 0. 75 53 … … 77 55 ################# 78 56 [C2H6] 79 name = "C2H6"57 name = C2H6 80 58 mas = 4.983e-26 81 59 vol = 9.094e-29 82 60 ray = 2.220e-10 83 masmol = 30. e-361 masmol = 30.07e-3 84 62 rho = 544.6 85 tc = 305. 486 tb = 184. 687 pc = 48. 863 tc = 305.33 64 tb = 184.55 65 pc = 48.71 88 66 w = 9.9e-2 89 a_sat = -6. 3430790 b_sat = 1. 0116391 c_sat = -1.1 911692 d_sat = - 2.0353993 mteta = 0.9 267 a_sat = -6.47500 68 b_sat = 1.41071 69 c_sat = -1.1440 70 d_sat = -1.8590 71 mteta = 0.99 94 72 tx_prod = 1.2e-12 95 73 … … 97 75 ################# 98 76 [C2H2] 99 name = "C2H2"77 name = C2H2 100 78 mas = 4.319e-26 101 79 vol = 7.020e-29 102 80 ray = 2.015e-10 103 masmol = 26. e-381 masmol = 26.04e-3 104 82 rho = 615. 105 tc = 308. 8106 tb = 188.4 107 pc = 61. 483 tc = 308.35 84 tb = 188.40 85 pc = 61.39 108 86 w = 19.0e-2 109 a_sat = -6. 90128110 b_sat = 1. 26873111 c_sat = - 2.09113112 d_sat = - 2.75601113 mteta = 0.9 287 a_sat = -6.87886 88 b_sat = 1.30164 89 c_sat = -1.22474 90 d_sat = -3.59556 91 mteta = 0.99 114 92 tx_prod = 3.2e-13 115 93 … … 117 95 ################# 118 96 [HCN] 119 name = "HCN"97 name = HCN 120 98 mas = 4.484e-26 121 99 vol = 6.498e-29 … … 131 109 c_sat = -3.004 132 110 d_sat = 1635. 133 mteta = 0.9 2111 mteta = 0.99 134 112 tx_prod = 1e-12 135 -
trunk/LMDZ.TITAN/libf/muphytitan/csystem.c
r3083 r3090 1 1 /* 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). 3 3 * 4 4 * This file is part of SWIFT -
trunk/LMDZ.TITAN/libf/muphytitan/csystem.h
r3083 r3090 1 1 /* 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). 3 3 * 4 4 * This file is part of SWIFT -
trunk/LMDZ.TITAN/libf/muphytitan/defined.h
r3083 r3090 1 1 /* 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). 3 3 * 4 4 * 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). 2 2 ! 3 3 ! 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). 2 2 ! 3 3 ! This file is part of SWIFT -
trunk/LMDZ.TITAN/libf/muphytitan/mm_clouds.f90
r3083 r3090 1 ! Copyright 2013-2015,2017,2022Université de Reims Champagne-Ardenne2 ! 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) 3 3 ! email of the author : jeremie.burgalat@univ-reims.fr 4 4 ! … … 35 35 !! summary: Clouds microphysics module 36 36 !! 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 39 39 40 40 MODULE MM_CLOUDS … … 109 109 call mm_cloud_sedimentation(zdm0n,zdm3n,zdm3i) 110 110 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(:)) 112 116 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_nesp117 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)) 117 121 mm_ice_prec(i) = SUM(zdm3i(:,i)*mm_dzlev) 118 mm_ice_fluxes(:,i) = get_mass_flux(mm_xESPS(i)%rho,mm_m3ice(:,i))119 122 ENDDO 123 120 124 ! updates tendencies 121 125 dm0n = dm0n + zdm0n … … 724 728 REAL(kind=mm_wp), INTENT(in) :: rad !! Radius of the particle (m). 725 729 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)) 727 738 728 739 ! Computes Stokes settling velocity 729 740 Us = (2._mm_wp * rad**2 * rho * mm_effg(z)) / (9._mm_wp * mm_eta_g(t)) 730 741 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 739 744 END FUNCTION wsettle 740 745 … … 753 758 REAL(kind=mm_wp), INTENT(in), DIMENSION(:) :: m3 754 759 !! 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)) :: flx760 REAL(kind=mm_wp), DIMENSION(SIZE(m3)) :: flx 756 761 !! 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_pi758 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) 759 764 RETURN 760 765 END FUNCTION get_mass_flux -
trunk/LMDZ.TITAN/libf/muphytitan/mm_globals.f90
r3083 r3090 1 ! Copyright 2013-2015,2017,2022Université de Reims Champagne-Ardenne2 ! 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) 3 3 ! email of the author : jeremie.burgalat@univ-reims.fr 4 4 ! … … 35 35 !! summary: Parameters and global variables module. 36 36 !! author: J. Burgalat 37 !! date: 2013-2015,2017,2022 37 !! date: 2013-2015,2017,2022-2023 38 !! modifications: B. de Batz de Trenquelléon 38 39 39 40 MODULE MM_GLOBALS … … 274 275 275 276 ! Thresholds ! 276 277 277 !> (min.) Total number of aerosols minimum threshold for the spherical mode. 278 278 REAL(kind=mm_wp), SAVE :: mm_m0as_min = 1.e-10_mm_wp 279 280 279 !> (min.) Total volume of aerosols minimum threshold for the spherical mode. 281 280 REAL(kind=mm_wp), SAVE :: mm_m3as_min = 1.e-40_mm_wp 282 283 281 !> Characteristic radius minimum threshold for the spherical mode. 284 282 REAL(kind=mm_wp), SAVE :: mm_rcs_min = 1.e-9_mm_wp … … 286 284 !> (min.) Total number of aerosols minimum threshold for the fractal mode. 287 285 REAL(kind=mm_wp), SAVE :: mm_m0af_min = 1.e-10_mm_wp 288 289 286 !> (min.) Total volume of aerosols minimum threshold for the fractal mode. 290 287 REAL(kind=mm_wp), SAVE :: mm_m3af_min = 1.e-40_mm_wp 291 292 288 !> Characteristic radius minimum threshold for the fractal mode. 293 289 REAL(kind=mm_wp), SAVE :: mm_rcf_min = 1.e-9_mm_wp … … 295 291 !> (min.) Total number of cloud drop minimum threshold. 296 292 REAL(kind=mm_wp), SAVE :: mm_m0n_min = 1.e-10_mm_wp 297 298 293 !> (min.) Total volume of cloud drop minimum threshold. 299 294 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 300 299 301 300 !> Characteristic radius threshold. 302 301 REAL(kind=mm_wp), SAVE :: mm_rc_min = 1.e-200_mm_wp 303 304 !> Minimum cloud drop radius305 REAL(kind=mm_wp), SAVE :: mm_drad_min = 1.e-9_mm_wp306 307 !> Maximum cloud drop radius308 REAL(kind=mm_wp), SAVE :: mm_drad_max = 1.e-3_mm_wp309 302 310 303 !> Name of condensible species. … … 442 435 REAL(kind=mm_wp), SAVE :: mm_aer_prec = 0._mm_wp 443 436 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 444 441 !> Spherical mode \(M_{0}\) settling velocity (\(m.s^{-1}\)). 445 442 !! … … 478 475 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_m3af_vsed 479 476 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 480 484 !> Spherical aerosol mass fluxes (\(kg.m^{-2}.s^{-1}\)). 481 485 !! … … 493 497 !! This variable is always negative. 494 498 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_wp499 500 !> CCN settling velocity (\(m.s^{-1}\)).501 !!502 !! It is a vector with the vertical layers that contains the503 !! settling velocity for CCN (and ices).504 !! It is updated in [[mm_clouds(module):mm_cloud_microphysics(subroutine)]].505 !! @note506 !! This variable is always positive.507 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_ccn_w508 499 509 500 !> CCN mass fluxes (\(kg.m^{-2}.s^{-1}\)). … … 512 503 !! mass fluxes for CCN. 513 504 !! It is updated in [[mm_clouds(module):mm_cloud_microphysics(subroutine)]]. 514 !! @note515 !! This variable is always positive.516 505 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_ccn_flux 517 506 … … 593 582 !$OMP THREADPRIVATE(mm_m0ccn,mm_m3ccn,mm_m3ice,mm_gazs) 594 583 !$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)596 584 !$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) 597 586 !$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) 598 587 !$OMP THREADPRIVATE(mm_nla,mm_nle) … … 997 986 err = mm_check_opt(cfg_get_value(cfg,"fiadero_min_ratio",mm_fiadero_min),mm_fiadero_min,zfiamin,wlog=mm_log) 998 987 err = mm_check_opt(cfg_get_value(cfg,"fiadero_max_ratio",mm_fiadero_max),mm_fiadero_max,zfiamax,wlog=mm_log) 999 1000 988 err = mm_check_opt(cfg_get_value(cfg,"m0as_min",mm_m0as_min),mm_m0as_min,1e-10_mm_wp,wlog=mm_log) 1001 989 err = mm_check_opt(cfg_get_value(cfg,"rcs_min",mm_rcs_min),mm_rcs_min,1e-9_mm_wp,wlog=mm_log) … … 1003 991 err = mm_check_opt(cfg_get_value(cfg,"rcf_min",mm_rcf_min),mm_rcf_min,mm_rm,wlog=mm_log) 1004 992 err = mm_check_opt(cfg_get_value(cfg,"m0n_min",mm_m0n_min),mm_m0n_min,1e-10_mm_wp,wlog=mm_log) 1005 1006 993 1007 994 ! force fractal radius minimum threshold to monomer radius ^^ … … 1152 1139 IF (.NOT.ALLOCATED(mm_rcf)) ALLOCATE(mm_rcf(mm_nla)) 1153 1140 ! 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 1154 1153 IF (.NOT.ALLOCATED(mm_aer_s_flux)) THEN 1155 1154 ALLOCATE(mm_aer_s_flux(mm_nla)) ; mm_aer_s_flux(:) = 0._mm_wp … … 1157 1156 IF (.NOT.ALLOCATED(mm_aer_f_flux)) THEN 1158 1157 ALLOCATE(mm_aer_f_flux(mm_nla)) ; mm_aer_f_flux(:) = 0._mm_wp 1159 ENDIF1160 IF (.NOT.ALLOCATED(mm_m0as_vsed)) THEN1161 ALLOCATE(mm_m0as_vsed(mm_nla)) ; mm_m0as_vsed(:) = 0._mm_wp1162 ENDIF1163 IF (.NOT.ALLOCATED(mm_m3as_vsed)) THEN1164 ALLOCATE(mm_m3as_vsed(mm_nla)) ; mm_m3as_vsed(:) = 0._mm_wp1165 ENDIF1166 IF (.NOT.ALLOCATED(mm_m0af_vsed)) THEN1167 ALLOCATE(mm_m0af_vsed(mm_nla)) ; mm_m0af_vsed(:) = 0._mm_wp1168 ENDIF1169 IF (.NOT.ALLOCATED(mm_m3af_vsed)) THEN1170 ALLOCATE(mm_m3af_vsed(mm_nla)) ; mm_m3af_vsed(:) = 0._mm_wp1171 1158 ENDIF 1172 1159 ! note : mm_dzlev is already from top to ground … … 1241 1228 IF (.NOT.ALLOCATED(mm_drho)) ALLOCATE(mm_drho(mm_nla)) 1242 1229 ! Allocate memory for diagnostics 1243 IF (.NOT.ALLOCATED(mm_ccn_ w)) THEN1244 ALLOCATE(mm_ccn_ w(mm_nla)) ; mm_ccn_w(:) = 0._mm_wp1230 IF (.NOT.ALLOCATED(mm_ccn_vsed)) THEN 1231 ALLOCATE(mm_ccn_vsed(mm_nla)) ; mm_ccn_vsed(:) = 0._mm_wp 1245 1232 ENDIF 1246 1233 IF (.NOT.ALLOCATED(mm_ccn_flux)) THEN … … 1444 1431 ! Initialization : 1445 1432 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) 1448 1435 1449 1436 IF (Ntot <= mm_m0n_min .OR. Vtot <= mm_m3cld_min) THEN -
trunk/LMDZ.TITAN/libf/muphytitan/mm_haze.f90
r3083 r3090 731 731 cslf = mm_akn * mm_lambda_g(mm_btemp(i),mm_plev(i)) 732 732 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)))**4736 ! <<< [TEMPO : BBT]737 733 738 734 ! now correct velocity to reduce numerical diffusion -
trunk/LMDZ.TITAN/libf/muphytitan/mm_methods.f90
r3083 r3090 1 ! Copyright 2013-2015,2017,2022Université de Reims Champagne-Ardenne2 ! 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) 3 3 ! email of the author : jeremie.burgalat@univ-reims.fr 4 4 ! … … 35 35 !! summary: Model miscellaneous methods module. 36 36 !! 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 39 39 40 40 MODULE MM_METHODS … … 133 133 !! 134 134 !! 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). 136 136 !! 137 137 !! ```fortran … … 314 314 !! 315 315 !! @warning 316 !! The method applies a multiplicative factor of 0.8 5if the specie is CH4 :316 !! The method applies a multiplicative factor of 0.80 if the specie is CH4 : 317 317 !! this is done to account for dissolution in N2 and is somehow specific to Titan atmosphere. 318 318 REAL(kind=mm_wp), INTENT(in) :: temp !! Temperature (K). 319 319 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) :: psat320 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 323 323 psat = mm_psatX(temp,xESP) 324 324 res = (psat / pres) * xESP%fmol2fmas 325 ! Peculiar case : CH4 : x0.85(dissolution in N2)325 ! Peculiar case of CH4 : x0.80 (dissolution in N2) 326 326 IF (xESP%name == "CH4") THEN 327 res = res * 0.8 5_mm_wp327 res = res * 0.80_mm_wp 328 328 IF (mm_debug) WRITE(*,'(a)') "[DEBUG] mm_qsat: applying .85 factor to qsat for CH4 specie (N2 dissolution)" 329 329 ENDIF … … 339 339 REAL(kind=mm_wp), INTENT(in), DIMENSION(:) :: pres !! Pressure levels (Pa). 340 340 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)) :: psat341 REAL(kind=mm_wp), DIMENSION(SIZE(temp)) :: res !! Mass mixing ratios of the specie. 342 REAL(kind=mm_wp), DIMENSION(SIZE(temp)) :: psat 343 343 psat = mm_psatX(temp,xESP) 344 344 res = (psat / pres) * xESP%fmol2fmas 345 ! Peculiar case : CH4 : x0.85(dissolution in N2)345 ! Peculiar case of CH4 : x0.80 (dissolution in N2) 346 346 IF (xESP%name == "CH4") THEN 347 res = res * 0.8 5_mm_wp347 res = res * 0.80_mm_wp 348 348 IF (mm_debug) WRITE(*,'(a)') "[DEBUG] mm_qsat: applying .85 factor to qsat for CH4 specie (N2 dissolution)" 349 349 ENDIF … … 352 352 FUNCTION ysatX_sc(temp,pres,xESP) RESULT(res) 353 353 !! Get the molar mixing ratio of a given specie at saturation (scalar). 354 !! Compute saturation profiles (mol/mol) for condensable tracers 354 355 !! 355 356 !! @warning 356 !! The method applies a multiplicative factor of 0.8 5if the specie is CH4 :357 !! The method applies a multiplicative factor of 0.80 if the specie is CH4 : 357 358 !! this is done to account for dissolution in N2 and is somehow specific to Titan atmosphere. 358 359 REAL(kind=mm_wp), INTENT(in) :: temp !! Temperature (K). … … 361 362 REAL(kind=mm_wp) :: res !! Molar mixing ratio of the specie. 362 363 363 ! Fray and Schmidt (2009)364 364 IF(xESP%name == "C2H2") THEN 365 ! Fray and Schmidt (2009) 365 366 res = (1.0e5 / pres) * exp(1.340e1 - 2.536e3/temp) 366 367 367 368 ELSE IF(xESP%name == "C2H6") THEN 369 ! Fray and Schmidt (2009) 368 370 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) 369 371 370 372 ELSE IF(xESP%name == "HCN") THEN 373 ! Fray and Schmidt (2009) 371 374 res = (1.0e5 / pres) * exp(1.393e1 - 3.624e3/temp - 1.325e5/temp**2 + 6.314e6/temp**3 - 1.128e8/temp**4) 372 375 373 376 ELSE IF (xESP%name == "CH4") THEN 377 ! Fray and Schmidt (2009) 374 378 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 379 385 ENDIF 380 386 END FUNCTION ysatX_sc … … 382 388 FUNCTION ysatX_ve(temp,pres,xESP) RESULT(res) 383 389 !! Get the molar mixing ratio of a given specie at saturation (vector). 390 !! Compute saturation profiles (mol/mol) for condensable tracers 384 391 !! 385 392 !! @warning 386 !! The method applies a multiplicative factor of 0.8 5if the specie is CH4 :393 !! The method applies a multiplicative factor of 0.80 if the specie is CH4 : 387 394 !! this is done to account for dissolution in N2 and is somehow specific to Titan atmosphere. 388 395 REAL(kind=mm_wp), INTENT(in), DIMENSION(:) :: temp !! Temperatures (K). … … 391 398 REAL(kind=mm_wp), DIMENSION(SIZE(temp)) :: res !! Molar mixing ratios of the specie. 392 399 393 ! Fray and Schmidt (2009)394 400 IF(xESP%name == "C2H2") THEN 401 ! Fray and Schmidt (2009) 395 402 res = (1.0e5 / pres) * exp(1.340e1 - 2.536e3/temp) 396 403 397 404 ELSE IF(xESP%name == "C2H6") THEN 405 ! Fray and Schmidt (2009) 398 406 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) 399 407 400 408 ELSE IF(xESP%name == "HCN") THEN 409 ! Fray and Schmidt (2009) 401 410 res = (1.0e5 / pres) * exp(1.393e1 - 3.624e3/temp - 1.325e5/temp**2 + 6.314e6/temp**3 - 1.128e8/temp**4) 402 411 … … 404 413 ELSE IF (xESP%name == "CH4") THEN 405 414 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 408 419 ENDIF 409 420 END FUNCTION ysatX_ve -
trunk/LMDZ.TITAN/libf/muphytitan/mm_microphysic.f90
r3083 r3090 1 ! Copyright 2013-2015,2017,2022Université de Reims Champagne-Ardenne2 ! 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) 3 3 ! email of the author : jeremie.burgalat@univ-reims.fr 4 4 ! … … 35 35 !! brief: Microphysic processes interface module. 36 36 !! author: J. Burgalat 37 !! date: 2013-2015,2017,2022 37 !! date: 2013-2015,2017,2022-2023 38 !! modifications: B. de Batz de Trenquelléon 38 39 39 40 MODULE MM_MICROPHYSIC … … 114 115 dm0n = dm0n(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1) 115 116 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)118 117 DO i=1,mm_nesp 119 118 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)121 119 dgazs(:,i) = dgazs(mm_nla:1:-1,i) 122 ! no sanity check for gazs, let's prey.123 120 ENDDO 124 121 ELSE … … 130 127 dm0a_f = dm0a_f(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1) 131 128 dm3a_f = dm3a_f(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1) 132 ! sanity check133 ! 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)137 129 RETURN 138 130 END FUNCTION muphys_all … … 168 160 dm0a_f = dm0a_f(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1) 169 161 dm3a_f = dm3a_f(mm_nla:1:-1) * mm_dzlev(mm_nla:1:-1) 170 ! sanity check171 ! 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)175 162 RETURN 176 163 END FUNCTION muphys_nocld … … 219 206 IF (PRESENT(ccn_prec)) ccn_prec = ABS(mm_ccn_prec) 220 207 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) 223 210 IF (PRESENT(ice_fluxes)) ice_fluxes = mm_ice_fluxes(mm_nla:1:-1,:) 224 IF (PRESENT(gazs_sat)) gazs_sat = 211 IF (PRESENT(gazs_sat)) gazs_sat = mm_gazs_sat(mm_nla:1:-1,:) 225 212 ELSE 226 213 IF (PRESENT(ccn_prec)) ccn_prec = 0._mm_wp -
trunk/LMDZ.TITAN/libf/muphytitan/mmp_gcm.f90
r3083 r3090 1 ! Copyright 2017Université de Reims Champagne-Ardenne2 ! 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) 3 3 ! email of the author : jeremie.burgalat@univ-reims.fr 4 4 ! … … 35 35 !! summary: YAMMS interfaces for the LMDZ GCM. 36 36 !! author: J. Burgalat 37 !! date: 2017 37 !! date: 2017,2022,2023 38 !! modifications: B. de Batz de Trenquelléon 38 39 MODULE MMP_GCM 39 40 !! Interface to YAMMS for the LMDZ GCM. … … 247 248 WRITE(*,'(a,L2)') "electric_charging : ", mmp_w_qe 248 249 call mm_dump_parameters() 249 250 250 IF (clouds) THEN 251 251 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). 2 2 ! 3 3 ! This file is part of SWIFT -
trunk/LMDZ.TITAN/libf/phytitan/calc_condlh.F90
r3083 r3090 21 21 ! Lcx = Condensation latente heat [J.kg-1] 22 22 ! 23 ! Author (s)24 ! ------ ---23 ! Author 24 ! ------ 25 25 ! B. de Batz de Trenquelléon (07/2023) 26 26 ! … … 28 28 ! --------------- 29 29 ! We suppose a given order of tracers ! 30 ! Tracers come from microphysics (ices_indx) : 30 31 ! CH4 --> 1 31 32 ! C2H2 --> 2 32 33 ! C2H6 --> 3 33 ! HCN --> 4 (TO DO)34 ! HCN --> 4 34 35 !==================================================================== 35 36 -
trunk/LMDZ.TITAN/libf/phytitan/calc_rayleigh.F90
r3083 r3090 7 7 ! Average the Rayleigh scattering in each band, weighting the 8 8 ! average by the blackbody function at temperature tstellar. 9 ! Works for an arbitrary mix of gases (currently CO2, N2 and10 ! H2are possible).9 ! Works for an arbitrary mix of gases (currently N2, H2 10 ! and CH4 are possible). 11 11 ! 12 12 ! Authors … … 64 64 typeknown=.false. 65 65 do igas=1,ngasmx 66 66 if(gfrac(igas,nivref).lt.1.e-2)then 67 67 print*,'Ignoring ',trim(gnom(igas)),' in Rayleigh scattering '// & 68 'as its mixing ratio is less than 0.01.'68 'as its mixing ratio is less than 0.01.' 69 69 ! ignore variable gas in Rayleigh calculation 70 70 ! ignore gases of mixing ratio < 0.01 in Rayleigh calculation … … 78 78 ! uses n=1.000132 from Optics, Fourth Edition. 79 79 ! was out by a factor 2! 80 81 82 83 84 85 86 87 88 80 elseif(igas.eq.igas_CH4)then 81 ! For CH4 we use the formalism of exo_k (developed by Jeremy Leconte) 82 ! the relation between exo_k formalism and LMDZ formalism is : (tauconsti*tauvari)=scalep*sigma_exok/(gravity*molecular_mass) 83 ! Values are taken from Caldas (2019), equation 12 & appendix D 84 ! 24.*pi**3/(1E5/(1.380648813E-23*273.15))**2 is a constant 85 ! 4/9=(2/3)**2 is approximately ((n+1)/(n**2+2))**2 86 ! 1E24 = (1E6)**4 because wavelength is in micron 87 ! 16.04*1.6726*1E-27 is CH4 molecular mass 88 tauconsti(igas) = 24.*pi**3/(1E5/(1.380648813E-23*273.15))**2 * 4./9. * 1E24 * (1/( g *16.04*1.6726*1E-27)) * scalep 89 89 else 90 90 print*,'Error in calc_rayleigh: Gas species not recognised!' -
trunk/LMDZ.TITAN/libf/phytitan/calc_ysat.F90
r3083 r3090 12 12 ! J. Vatant d'Ollone 13 13 ! -> 2017 : Adapt to new physics, move to F90 and compute every grid point 14 ! -> 2018 : Update saturation profiles from recent litterature ( Vuitton 2019 ) 14 ! -> 2018 : Update saturation profiles from recent litterature (Vuitton 2019) 15 ! Modified 16 ! -------- 17 ! B. de Batz de Trenquelléon 18 ! -> 2022 : Update saturation profiles and correct the pressure unit 15 19 ! ============================================================================== 16 20 … … 40 44 ALLOCATE(x(nlon,nlay)) 41 45 42 ! By default, ysat=1, meaning we do not condense46 ! By default, ysat = 1, meaning we do not condense 43 47 ysat(:,:,:) = 1.0 44 48 45 ! Main loop 46 47 do ic=1,nkim 48 49 if(trim(cnames(ic)).eq."CH4") then 50 51 !where (temp(:,:).lt.90.65) 52 ! ysat(:,:,ic) = 10.0**(4.42507e0 - ( ( ( 1165560.7e0 / temp(:,:) & 53 ! - 115352.19e0 ) / temp(:,:) + 4055.6016e0 ) / temp(:,:) & 54 ! + 453.92414e0 ) / temp(:,:) ) / press(:,:) * 1013.25e0 55 !elsewhere 56 ! ysat(:,:,ic) = 10.0**(3.901408e0 - ( ( 154567.02e0 / temp(:,:) - 1598.8512e0 ) & 57 ! / temp(:,:) + 437.54809e0 ) / temp(:,:)) / press(:,:) * 1013.25e0 58 !endwhere 59 60 ! Fray and Schmidt (2009) 61 ysat(:,:,ic) = (1000. / press(:,:)) * exp(1.051e1 - 1.110e3/temp(:,:) & 62 - 4.341e3/temp(:,:)**2 + 1.035e5/temp(:,:)**3 - 7.910e5/temp(:,:)**4) 63 64 ! Forcing CH4 to 1.4% minimum 65 where (ysat(:,:,ic).lt.0.014) ysat(:,:,ic) = 0.014 66 67 else if(trim(cnames(ic)).eq."C2H2") then 68 69 ! ysat(:,:,ic) = 10.0**(6.09748e0-1644.1e0/temp(:,:)+7.42346e0 & 70 ! * alog10(1.0e3/temp(:,:)) ) / press(:,:)*1013.25e0/760.0 71 72 ysat(:,:,ic) = (1000. / press(:,:)) * exp(1.340e1 - 2.536e3/temp(:,:)) ! Fray and Schmidt (2009) 73 74 else if(trim(cnames(ic)).eq."C2H4") then 75 76 where (temp(:,:).lt.89.0) ! not far from Fray and Schmidt, 2009 77 ysat(:,:,ic) = 10.0**(1.5477e0 + (1.0e0/temp(:,:) - 0.011e0) & 78 * (16537.0e0*(1.0e0/temp(:,:) - 0.011e0) - 1038.1e0)) & 79 / press(:,:) * 1.01325e0 / 760.0 80 elsewhere (temp(:,:).lt.104.0) ! not far from Fray and Schmidt, 2009 81 ysat(:,:,ic) = 10.0**(8.724e0 - 901.6e0/(temp(:,:) - 2.555e0) ) & 82 / press(:,:) * 1013.25e0 / 760.0 83 elsewhere (temp(:,:).lt.120.0) 84 ysat(:,:,ic) = 10.0**(50.79e0 - 1703.0e0/temp(:,:) - 17.141e0 & 85 * alog10(temp(:,:)) ) / press(:,:) * 1013.25e0 / 760.0 86 elsewhere (temp(:,:).lt.155.0) 87 ysat(:,:,ic) = 10.0**(6.74756e0 - 585.0e0/(temp(:,:) - 18.16e0) ) & 88 / press(:,:) * 1013.25e0 / 760.0 89 endwhere 90 91 else if(trim(cnames(ic)).eq."C2H6") then 92 93 ! where (temp(:,:).lt.90.) 94 ! ysat(:,:,ic) = 10.0**(10.01e0-1085.0e0/(temp(:,:)-0.561e0) ) & 95 ! / press(:,:) * 1013.25e0 / 760.0e0 96 ! ysat(:,:,ic) = 1.E5 * exp ( 15.11 - 2207./temp(:,:) - 24110./(temp(:,:)**2) & 97 ! + 7.744E5/(temp(:,:)**3) - 1.161E7/(temp(:,:)**4) & 98 ! + 6.763E7/(temp(:,:)**5) ) / press(:,:) ! Fray and Schmidt (2009) 99 ! elsewhere 100 ! ysat(:,:,ic) = 10.0**(5.9366e0 - 1086.17e0/temp(:,:) + 3.83464e0 & 101 ! * alog10(1.0e3/temp(:,:)) ) / press(:,:)*1013.25e0/760.0 102 ! endwhere 103 ysat(:,:,ic) = (1000. / press(:,:)) * exp(1.511e1 - 2.207e3/temp(:,:) & 104 - 2.411e4/temp(:,:)**2 + 7.744e5/temp(:,:)**3 - 1.161e7/temp(:,:)**4 & 105 + 6.763e7/temp(:,:)**5) 106 107 else if((trim(cnames(ic)).eq."CH3CCH") .or. (trim(cnames(ic)).eq."CH2CCH2")) then 108 109 ysat(:,:,ic) = 10.0**(2.8808e0 - 4.5e0*(249.9e0 - temp(:,:)) & 49 ! Main loop 50 do ic = 1, nkim 51 52 ! CH4 : 53 !------ 54 if(trim(cnames(ic)).eq."CH4") then 55 !where (temp(:,:).lt.90.65) 56 ! ysat(:,:,ic) = 10.0**(4.42507e0 - ( ( ( 1165560.7e0 / temp(:,:) & 57 ! - 115352.19e0 ) / temp(:,:) + 4055.6016e0 ) / temp(:,:) & 58 ! + 453.92414e0 ) / temp(:,:) ) / press(:,:) * 1013.25e0 59 !elsewhere 60 ! ysat(:,:,ic) = 10.0**(3.901408e0 - ( (154567.02e0 / temp(:,:) - 1598.8512e0) & 61 ! / temp(:,:) + 437.54809e0 ) / temp(:,:)) / press(:,:) * 1013.25e0 62 !endwhere 63 64 ! Fray and Schmidt (2009) 65 ysat(:,:,ic) = (1.e3 / press(:,:)) * exp(1.051e1 - 1.110e3/temp(:,:) & 66 - 4.341e3/temp(:,:)**2 + 1.035e5/temp(:,:)**3 - 7.910e5/temp(:,:)**4) 67 68 ! Forcing CH4 to 1.4% minimum 69 where (ysat(:,:,ic).lt.0.014) ysat(:,:,ic) = 0.014 70 71 ! C2H2 : 72 !------- 73 else if(trim(cnames(ic)).eq."C2H2") then 74 !ysat(:,:,ic) = 10.0**(6.09748e0-1644.1e0/temp(:,:)+7.42346e0 & 75 ! * alog10(1.0e3/temp(:,:)) ) / press(:,:)*1013.25e0/760.0 76 77 ! Fray and Schmidt (2009) 78 ysat(:,:,ic) = (1.e3 / press(:,:)) * exp(1.340e1 - 2.536e3/temp(:,:)) 79 80 ! C2H4 : 81 !------- 82 else if(trim(cnames(ic)).eq."C2H4") then 83 ! not far from Fray and Schmidt (2009) 84 where (temp(:,:).lt.89.0) 85 ysat(:,:,ic) = 10.0**(1.5477e0 + (1.0e0/temp(:,:) - 0.011e0) & 86 * (16537.0e0*(1.0e0/temp(:,:) - 0.011e0) - 1038.1e0)) & 87 / press(:,:) * 1.01325e0 / 760.0 88 elsewhere (temp(:,:).lt.104.0) 89 ysat(:,:,ic) = 10.0**(8.724e0 - 901.6e0/(temp(:,:) - 2.555e0) ) & 90 / press(:,:) * 1013.25e0 / 760.0 91 elsewhere (temp(:,:).lt.120.0) 92 ysat(:,:,ic) = 10.0**(50.79e0 - 1703.0e0/temp(:,:) - 17.141e0 & 93 * alog10(temp(:,:)) ) / press(:,:) * 1013.25e0 / 760.0 94 elsewhere (temp(:,:).lt.155.0) 95 ysat(:,:,ic) = 10.0**(6.74756e0 - 585.0e0/(temp(:,:) - 18.16e0) ) & 96 / press(:,:) * 1013.25e0 / 760.0 97 endwhere 98 99 ! C2H6 : 100 !------- 101 else if(trim(cnames(ic)).eq."C2H6") then 102 where (temp(:,:).lt.90.) 103 !ysat(:,:,ic) = 10.0**(10.01e0-1085.0e0/(temp(:,:)-0.561e0) ) & 104 ! / press(:,:) * 1013.25e0 / 760.0e0 105 ! Fray and Schmidt (2009) 106 ysat(:,:,ic) = (1.e3 / press(:,:)) * exp ( 15.11 - 2207./temp(:,:) & 107 - 24110./(temp(:,:)**2) + 7.744E5/(temp(:,:)**3) & 108 - 1.161E7/(temp(:,:)**4) + 6.763E7/(temp(:,:)**5)) 109 elsewhere 110 ysat(:,:,ic) = 10.0**(5.9366e0 - 1086.17e0/temp(:,:) + 3.83464e0 & 111 * alog10(1.0e3/temp(:,:)) ) / press(:,:)*1013.25e0/760.0 112 endwhere 113 114 ! CH3CCH : 115 !--------- 116 else if((trim(cnames(ic)).eq."CH3CCH") .or. (trim(cnames(ic)).eq."CH2CCH2")) then 117 ysat(:,:,ic) = 10.0**(2.8808e0 - 4.5e0*(249.9e0 - temp(:,:)) & 110 118 / (1.15e0*temp(:,:) - 37.485e0) ) / press(:,:) * 1013.25e0 / 760.0e0 111 119 112 else if(trim(cnames(ic)).eq."C3H6") then 113 114 ysat(:,:,ic) = 10.0**(7.4463e0 - 1028.5654e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 115 120 ! C3H6 : 121 !------- 122 else if(trim(cnames(ic)).eq."C3H6") then 123 ysat(:,:,ic) = 10.0**(7.4463e0 - 1028.5654e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 124 125 ! C3H8 : 126 !------- 116 127 else if(trim(cnames(ic)).eq."C3H8") then 117 118 128 ysat(:,:,ic) = 10.0**(7.217e0 - 994.30251e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 119 129 120 else if((trim(cnames(ic)).eq."C4H2").or.(trim(cnames(ic)).eq."C4H2s")) then 121 122 ysat(:,:,ic) = 10.0**(96.26781e0 - 4651.872e0/temp(:,:) - 31.68595e0 & 130 ! C4H2 : 131 !------- 132 else if((trim(cnames(ic)).eq."C4H2").or.(trim(cnames(ic)).eq."C4H2s")) then 133 ysat(:,:,ic) = 10.0**(96.26781e0 - 4651.872e0/temp(:,:) - 31.68595e0 & 123 134 * alog10(temp(:,:)) ) / press(:,:) * 1013.25e0 / 760.0e0 124 125 else if(trim(cnames(ic)).eq."C4H4") then 126 127 ysat(:,:,ic)= 1.0e3 * exp(9.3898e0 - 2203.57/(temp(:,:)-43.15e0) ) / press(:,:) 128 129 else if(trim(cnames(ic)).eq."C4H6") then 130 131 ysat(:,:,ic)= 10.0**(2.8808e0 - 4.6e0*(262.3e0 - temp(:,:)) & 135 136 ! C4H4 : 137 !------- 138 else if(trim(cnames(ic)).eq."C4H4") then 139 ysat(:,:,ic)= 1.0e3 * exp(9.3898e0 - 2203.57/(temp(:,:)-43.15e0) ) / press(:,:) 140 141 ! C4H6 : 142 !------- 143 else if(trim(cnames(ic)).eq."C4H6") then 144 ysat(:,:,ic)= 10.0**(2.8808e0 - 4.6e0*(262.3e0 - temp(:,:)) & 132 145 /(1.15e0*temp(:,:) - 39.345e0) ) / press(:,:) * 1013.25e0 / 760.0e0 133 146 134 else if(trim(cnames(ic)).eq."C4H10") then 135 136 ysat(:,:,ic)= 10.0**(8.446e0 - 1461.2e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 137 138 else if(trim(cnames(ic)).eq."C6H2") then 139 140 ysat(:,:,ic)= 10.0**(4.666e0 - 4956e0/temp(:,:) + 25.845e0 * & 147 ! C4H10 : 148 !-------- 149 else if(trim(cnames(ic)).eq."C4H10") then 150 ysat(:,:,ic)= 10.0**(8.446e0 - 1461.2e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 151 152 ! C6H2 : 153 !------- 154 else if(trim(cnames(ic)).eq."C6H2") then 155 ysat(:,:,ic)= 10.0**(4.666e0 - 4956e0/temp(:,:) + 25.845e0 * & 141 156 alog10(1.0e3/temp(:,:)) ) / press(:,:) * 1013.25e0 / 760.0e0 142 157 143 else if(trim(cnames(ic)).eq."C8H2") then 144 145 ysat(:,:,ic)= 10.0**(3.95e0 - 6613e0/temp(:,:) + 35.055e0 * & 158 ! C8H2 : 159 !------- 160 else if(trim(cnames(ic)).eq."C8H2") then 161 ysat(:,:,ic)= 10.0**(3.95e0 - 6613e0/temp(:,:) + 35.055e0 * & 146 162 alog10(1.0e3/temp(:,:)) ) / press(:,:) * 1013.25e0 / 760.0e0 147 163 148 else if(trim(cnames(ic)).eq."AC6H6") then 149 150 !x = 1.0e0 - temp(:,:) / 562.2e0 151 !ysat(:,:,ic)= 48.9e3 * exp( ( 1.33213 * x**1.5 - 6.98273 * x & 152 ! - x**3 * (2.62863 + 3.33399 * x**3) ) * 562.2e0/temp(:,:) ) / press(:,:) 153 154 ysat(:,:,ic) = 1.E5 * exp (17.35-5663./temp(:,:)) / press(:,:) ! Fray and Schmidt (2009) 155 156 else if(trim(cnames(ic)).eq."HCN") then 157 158 !ysat(:,:,ic)= 10.0**(8.6165e0 - 1516.5e0/(temp(:,:) - 26.2e0) ) / press(:,:) * 1013.25e0 / 760.0e0 159 160 ysat(:,:,ic) = (1000. / press(:,:)) * exp (1.393e1 - 3.624e3/temp(:,:) & 161 - 1.325e5/temp(:,:)**2 + 6.314e6/temp(:,:)**3 - 1.128e8/temp(:,:)**4) ! Fray and Schmidt (2009) 162 163 else if(trim(cnames(ic)).eq."CH3CN") then 164 165 ysat(:,:,ic)= 10.0**(8.458e0 - 1911.7e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 166 167 else if(trim(cnames(ic)).eq."C2H3CN") then 168 169 ysat(:,:,ic)= 10.0**(9.3051e0 - 2782.21/(temp(:,:) - 51.15e0) ) / press(:,:) * 1013.25e0 / 760.0e0 170 171 else if(trim(cnames(ic)).eq."NCCN") then 172 173 ysat(:,:,ic)= 10.0**(7.454e0 - 1832e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 174 175 else if(trim(cnames(ic)).eq."HC3N") then 176 177 ysat(:,:,ic)= 10.0**(7.7446e0 - 1453.5609e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 178 179 else if(trim(cnames(ic)).eq."C4N2") then 180 181 ysat(:,:,ic)= 10.0**(8.269e0 - 2155.0e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 182 183 endif 164 ! C6H6 : 165 !------- 166 else if(trim(cnames(ic)).eq."AC6H6") then 167 !x = 1.0e0 - temp(:,:) / 562.2e0 168 !ysat(:,:,ic)= 48.9e3 * exp( ( 1.33213 * x**1.5 - 6.98273 * x & 169 ! - x**3 * (2.62863 + 3.33399 * x**3) ) * 562.2e0/temp(:,:) ) / press(:,:) 170 171 ! Fray and Schmidt (2009) 172 ysat(:,:,ic) = (1.e3 / press(:,:)) * exp (17.35-5663./temp(:,:)) 173 174 ! HCN : 175 !------- 176 else if(trim(cnames(ic)).eq."HCN") then 177 !ysat(:,:,ic)= 10.0**(8.6165e0 - 1516.5e0/(temp(:,:) - 26.2e0) ) / press(:,:) * 1013.25e0 / 760.0e0 178 179 ! Fray and Schmidt (2009) 180 ysat(:,:,ic) = (1.e3 / press(:,:)) * exp (1.393e1 - 3.624e3/temp(:,:) & 181 - 1.325e5/temp(:,:)**2 + 6.314e6/temp(:,:)**3 - 1.128e8/temp(:,:)**4) 182 183 ! CH3CN : 184 !-------- 185 else if(trim(cnames(ic)).eq."CH3CN") then 186 ysat(:,:,ic)= 10.0**(8.458e0 - 1911.7e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 187 188 ! C2H3CN : 189 !------- 190 else if(trim(cnames(ic)).eq."C2H3CN") then 191 ysat(:,:,ic)= 10.0**(9.3051e0 - 2782.21/(temp(:,:) - 51.15e0) ) / press(:,:) * 1013.25e0 / 760.0e0 192 193 ! NCCN : 194 !------- 195 else if(trim(cnames(ic)).eq."NCCN") then 196 ysat(:,:,ic)= 10.0**(7.454e0 - 1832e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 197 198 ! HC3N : 199 !------- 200 else if(trim(cnames(ic)).eq."HC3N") then 201 ysat(:,:,ic)= 10.0**(7.7446e0 - 1453.5609e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 202 203 ! C4N2 : 204 !------- 205 else if(trim(cnames(ic)).eq."C4N2") then 206 ysat(:,:,ic)= 10.0**(8.269e0 - 2155.0e0/temp(:,:) ) / press(:,:) * 1013.25e0 / 760.0e0 207 208 endif 184 209 enddo 185 210 -
trunk/LMDZ.TITAN/libf/phytitan/callcorrk.F90
r3083 r3090 35 35 ! Emmanuel 01/2001, Forget 09/2001 36 36 ! Robin Wordsworth (2009) 37 ! Jan Vatant d'Ollone (2018) -> corrk recombining case 38 ! Bruno de Batz de Trenquelléon (2023) --> Optics of Titan's haze and coulds 37 ! 38 ! Modified 39 ! -------- 40 ! Jan Vatant d'Ollone (2018) 41 ! --> corrk recombining case 42 ! B. de Batz de Trenquelléon (2023) 43 ! --> Titan's haze and could optics 44 ! --> clear/dark columns method 45 ! --> optical diagnostics 39 46 ! 40 47 !================================================================== … … 80 87 REAL,INTENT(OUT) :: int_dtaui(ngrid,nlayer,L_NSPECTI) ! IR optical thickness of layers within narrowbands for diags (). 81 88 REAL,INTENT(OUT) :: int_dtauv(ngrid,nlayer,L_NSPECTV) ! VI optical thickness of layers within narrowbands for diags (). 89 ! Diagnostics 90 REAL,INTENT(OUT) :: popthi(ngrid,nlayer,L_NSPECTI,5) ! IR optical properties of haze within narrowbands (dtau,tau,k,w,g). 82 91 REAL,INTENT(OUT) :: popthv(ngrid,nlayer,L_NSPECTV,5) ! VI optical properties of haze within narrowbands (dtau,tau,k,w,g). 92 REAL,INTENT(OUT) :: poptci(ngrid,nlayer,L_NSPECTI,5) ! IR optical properties of haze and clouds within narrowbands (dtau,tau,k,w,g). 83 93 REAL,INTENT(OUT) :: poptcv(ngrid,nlayer,L_NSPECTV,5) ! VI optical properties of haze and clouds within narrowbands (dtau,tau,k,w,g). 84 REAL,INTENT(OUT) :: popthi(ngrid,nlayer,L_NSPECTI,5) ! IR optical properties of haze within narrowbands (dtau,tau,k,w,g).85 REAL,INTENT(OUT) :: poptci(ngrid,nlayer,L_NSPECTI,5) ! IR optical properties of haze and clouds within narrowbands (dtau,tau,k,w,g).86 94 87 95 … … 97 105 ! Optical values for the optci/cv subroutines 98 106 REAL*8 stel(L_NSPECTV),stel_fract(L_NSPECTV) 99 107 ! IR 100 108 REAL*8 dtaui(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 109 REAL*8 taucumi(L_LEVELS,L_NSPECTI,L_NGAUSS) 110 REAL*8 wbari(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 111 REAL*8 cosbi(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 112 ! VI 113 REAL*8 dtauv(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 114 REAL*8 tauv(L_NLEVRAD,L_NSPECTV,L_NGAUSS) 115 REAL*8 taucumv(L_LEVELS,L_NSPECTV,L_NGAUSS) 116 REAL*8 wbarv(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 117 REAL*8 cosbv(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 118 119 ! Temporary optical values for the optci/cv subroutines (clear column) 101 120 REAL*8 dtaui_cc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 121 REAL*8 dtauv_cc(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 122 REAL*8 tauv_cc(L_NLEVRAD,L_NSPECTV,L_NGAUSS) 123 REAL*8 taucumi_cc(L_LEVELS,L_NSPECTI,L_NGAUSS) 124 REAL*8 taucumv_cc(L_LEVELS,L_NSPECTV,L_NGAUSS) 125 REAL*8 wbari_cc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 126 REAL*8 wbarv_cc(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 127 REAL*8 cosbi_cc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 128 REAL*8 cosbv_cc(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 129 ! Temporary optical values for the optci/cv subroutines (dark column) 102 130 REAL*8 dtaui_dc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 103 REAL*8 dtauv(L_NLAYRAD,L_NSPECTV,L_NGAUSS)104 REAL*8 dtauv_cc(L_NLAYRAD,L_NSPECTV,L_NGAUSS)105 131 REAL*8 dtauv_dc(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 106 107 REAL*8 cosbv(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 108 REAL*8 cosbv_cc(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 132 REAL*8 tauv_dc(L_NLEVRAD,L_NSPECTV,L_NGAUSS) 133 REAL*8 taucumi_dc(L_LEVELS,L_NSPECTI,L_NGAUSS) 134 REAL*8 taucumv_dc(L_LEVELS,L_NSPECTV,L_NGAUSS) 135 REAL*8 wbari_dc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 136 REAL*8 wbarv_dc(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 137 REAL*8 cosbi_dc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 109 138 REAL*8 cosbv_dc(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 110 REAL*8 cosbi(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 111 REAL*8 cosbi_cc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 112 REAL*8 cosbi_dc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 113 114 REAL*8 wbari(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 115 REAL*8 wbari_cc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 116 REAL*8 wbari_dc(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 117 REAL*8 wbarv(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 118 REAL*8 wbarv_cc(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 119 REAL*8 wbarv_dc(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 120 121 REAL*8 tauv(L_NLEVRAD,L_NSPECTV,L_NGAUSS) 122 REAL*8 tauv_cc(L_NLEVRAD,L_NSPECTV,L_NGAUSS) 123 REAL*8 tauv_dc(L_NLEVRAD,L_NSPECTV,L_NGAUSS) 124 125 REAL*8 taucumv(L_LEVELS,L_NSPECTV,L_NGAUSS) 126 REAL*8 taucumv_cc(L_LEVELS,L_NSPECTV,L_NGAUSS) 127 REAL*8 taucumv_dc(L_LEVELS,L_NSPECTV,L_NGAUSS) 128 REAL*8 taucumi(L_LEVELS,L_NSPECTI,L_NGAUSS) 129 REAL*8 taucumi_cc(L_LEVELS,L_NSPECTI,L_NGAUSS) 130 REAL*8 taucumi_dc(L_LEVELS,L_NSPECTI,L_NGAUSS) 131 139 140 ! Optical diagnostics 141 REAL*8 popt_hazei(L_LEVELS,L_NSPECTI,3) 132 142 REAL*8 popt_hazev(L_LEVELS,L_NSPECTV,3) 143 REAL*8 popt_cloudsi(L_LEVELS,L_NSPECTI,3) 144 REAL*8 popt_cloudsv(L_LEVELS,L_NSPECTV,3) 145 ! Temporary optical diagnostics (clear column) 146 REAL*8 popt_hazei_cc(L_LEVELS,L_NSPECTI,3) 133 147 REAL*8 popt_hazev_cc(L_LEVELS,L_NSPECTV,3) 148 REAL*8 popt_cloudsi_cc(L_LEVELS,L_NSPECTI,3) 149 REAL*8 popt_cloudsv_cc(L_LEVELS,L_NSPECTV,3) 150 ! Temporary optical diagnostics (dark column) 151 REAL*8 popt_hazei_dc(L_LEVELS,L_NSPECTI,3) 134 152 REAL*8 popt_hazev_dc(L_LEVELS,L_NSPECTV,3) 135 REAL*8 popt_hazei(L_LEVELS,L_NSPECTI,3) 136 REAL*8 popt_hazei_cc(L_LEVELS,L_NSPECTI,3) 137 REAL*8 popt_hazei_dc(L_LEVELS,L_NSPECTI,3) 138 139 REAL*8 popt_cloudsv(L_LEVELS,L_NSPECTV,3) 140 REAL*8 popt_cloudsv_cc(L_LEVELS,L_NSPECTV,3) 153 REAL*8 popt_cloudsi_dc(L_LEVELS,L_NSPECTI,3) 141 154 REAL*8 popt_cloudsv_dc(L_LEVELS,L_NSPECTV,3) 142 REAL*8 popt_cloudsi(L_LEVELS,L_NSPECTI,3) 143 REAL*8 popt_cloudsi_cc(L_LEVELS,L_NSPECTI,3) 144 REAL*8 popt_cloudsi_dc(L_LEVELS,L_NSPECTI,3) 155 145 156 146 157 REAL*8 nfluxtopv,nfluxtopi,nfluxtop,fluxtopvdn … … 546 557 endwhere 547 558 ! Diagnostics for clouds : 548 where (popt_cloudsv_cc(:,:,1) .lt. 1.d-30) 549 popt_cloudsv_cc(:,:,1) = 1.d-30 550 endwhere 551 where (popt_cloudsv_dc(:,:,1) .lt. 1.d-30) 552 popt_cloudsv_dc(:,:,1) = 1.d-30 553 endwhere 554 popt_cloudsv(:,:,1) = -log( (1-Fcloudy)*exp(-popt_cloudsv_cc(:,:,1)) + Fcloudy*exp(-popt_cloudsv_dc(:,:,1)) ) 555 popt_cloudsv(:,:,2) = ((popt_cloudsv_cc(:,:,1)*popt_cloudsv_cc(:,:,2) + popt_cloudsv_dc(:,:,1)*popt_cloudsv_dc(:,:,2)) & 556 / (popt_cloudsv_cc(:,:,1) + popt_cloudsv_dc(:,:,1))) 557 where ((popt_cloudsv_cc(:,:,2).gt.0.0D0) .or. (popt_cloudsv_dc(:,:,2).gt.0.0D0)) 558 popt_cloudsv(:,:,3) = (popt_cloudsv_cc(:,:,1)*popt_cloudsv_cc(:,:,2)*popt_cloudsv_cc(:,:,3) + popt_cloudsv_dc(:,:,1)*popt_cloudsv_dc(:,:,2)*popt_cloudsv_dc(:,:,3)) & 559 / (popt_cloudsv_cc(:,:,1)*popt_cloudsv_cc(:,:,2) + popt_cloudsv_dc(:,:,1)*popt_cloudsv_dc(:,:,2)) 560 elsewhere 561 popt_cloudsv(:,:,3) = 0.0D0 562 endwhere 559 if (callclouds) then 560 where (popt_cloudsv_cc(:,:,1) .lt. 1.d-30) 561 popt_cloudsv_cc(:,:,1) = 1.d-30 562 endwhere 563 where (popt_cloudsv_dc(:,:,1) .lt. 1.d-30) 564 popt_cloudsv_dc(:,:,1) = 1.d-30 565 endwhere 566 popt_cloudsv(:,:,1) = -log( (1-Fcloudy)*exp(-popt_cloudsv_cc(:,:,1)) + Fcloudy*exp(-popt_cloudsv_dc(:,:,1)) ) 567 popt_cloudsv(:,:,2) = ((popt_cloudsv_cc(:,:,1)*popt_cloudsv_cc(:,:,2) + popt_cloudsv_dc(:,:,1)*popt_cloudsv_dc(:,:,2)) & 568 / (popt_cloudsv_cc(:,:,1) + popt_cloudsv_dc(:,:,1))) 569 where ((popt_cloudsv_cc(:,:,2).gt.0.0D0) .or. (popt_cloudsv_dc(:,:,2).gt.0.0D0)) 570 popt_cloudsv(:,:,3) = (popt_cloudsv_cc(:,:,1)*popt_cloudsv_cc(:,:,2)*popt_cloudsv_cc(:,:,3) + popt_cloudsv_dc(:,:,1)*popt_cloudsv_dc(:,:,2)*popt_cloudsv_dc(:,:,3)) & 571 / (popt_cloudsv_cc(:,:,1)*popt_cloudsv_cc(:,:,2) + popt_cloudsv_dc(:,:,1)*popt_cloudsv_dc(:,:,2)) 572 elsewhere 573 popt_cloudsv(:,:,3) = 0.0D0 574 endwhere 575 endif 563 576 564 577 if(fract(ig) .ge. 1.0e-4) then ! Only during daylight. … … 666 679 endwhere 667 680 ! Diagnostics for clouds : 668 where (popt_cloudsi_cc(:,:,1) .lt. 1.d-30) 669 popt_cloudsi_cc(:,:,1) = 1.d-30 670 endwhere 671 where (popt_cloudsi_dc(:,:,1) .lt. 1.d-30) 672 popt_cloudsi_dc(:,:,1) = 1.d-30 673 endwhere 674 popt_cloudsi(:,:,1) = -log( (1-Fcloudy)*exp(-popt_cloudsi_cc(:,:,1)) + Fcloudy*exp(-popt_cloudsi_dc(:,:,1)) ) 675 popt_cloudsi(:,:,2) = ((popt_cloudsi_cc(:,:,1)*popt_cloudsi_cc(:,:,2) + popt_cloudsi_dc(:,:,1)*popt_cloudsi_dc(:,:,2)) & 676 / (popt_cloudsi_cc(:,:,1) + popt_cloudsi_dc(:,:,1))) 677 where ((popt_cloudsi_cc(:,:,2).gt.0.0D0) .or. (popt_cloudsi_dc(:,:,2).gt.0.0D0)) 678 popt_cloudsi(:,:,3) = (popt_cloudsi_cc(:,:,1)*popt_cloudsi_cc(:,:,2)*popt_cloudsi_cc(:,:,3) + popt_cloudsi_dc(:,:,1)*popt_cloudsi_dc(:,:,2)*popt_cloudsi_dc(:,:,3)) & 679 / (popt_cloudsi_cc(:,:,1)*popt_cloudsi_cc(:,:,2) + popt_cloudsi_dc(:,:,1)*popt_cloudsi_dc(:,:,2)) 680 elsewhere 681 popt_cloudsi(:,:,3) = 0.0D0 682 endwhere 681 if (callclouds) then 682 where (popt_cloudsi_cc(:,:,1) .lt. 1.d-30) 683 popt_cloudsi_cc(:,:,1) = 1.d-30 684 endwhere 685 where (popt_cloudsi_dc(:,:,1) .lt. 1.d-30) 686 popt_cloudsi_dc(:,:,1) = 1.d-30 687 endwhere 688 popt_cloudsi(:,:,1) = -log( (1-Fcloudy)*exp(-popt_cloudsi_cc(:,:,1)) + Fcloudy*exp(-popt_cloudsi_dc(:,:,1)) ) 689 popt_cloudsi(:,:,2) = ((popt_cloudsi_cc(:,:,1)*popt_cloudsi_cc(:,:,2) + popt_cloudsi_dc(:,:,1)*popt_cloudsi_dc(:,:,2)) & 690 / (popt_cloudsi_cc(:,:,1) + popt_cloudsi_dc(:,:,1))) 691 where ((popt_cloudsi_cc(:,:,2).gt.0.0D0) .or. (popt_cloudsi_dc(:,:,2).gt.0.0D0)) 692 popt_cloudsi(:,:,3) = (popt_cloudsi_cc(:,:,1)*popt_cloudsi_cc(:,:,2)*popt_cloudsi_cc(:,:,3) + popt_cloudsi_dc(:,:,1)*popt_cloudsi_dc(:,:,2)*popt_cloudsi_dc(:,:,3)) & 693 / (popt_cloudsi_cc(:,:,1)*popt_cloudsi_cc(:,:,2) + popt_cloudsi_dc(:,:,1)*popt_cloudsi_dc(:,:,2)) 694 elsewhere 695 popt_cloudsi(:,:,3) = 0.0D0 696 endwhere 697 endif 683 698 684 699 call sfluxi(plevrad,tlevrad,dtaui,taucumi,ubari,albi, & … … 758 773 759 774 760 ! Optical properties of haze and clouds (dtau, tau, k, w, g) :775 ! Diagnostics : optical properties of haze and clouds (dtau, tau, k, w, g) : 761 776 do l = 2, L_LEVELS, 2 762 777 lev2lay = L_NLAYRAD+1 - l/2 763 764 778 ! Visible : 765 779 do nw = 1, L_NSPECTV … … 768 782 ! Optical thickness (dtau) : 769 783 popthv(ig,lev2lay,nw,1) = (popt_hazev(l,nw,1) + popt_hazev(l+1,nw,1)) / 2.0 770 poptcv(ig,lev2lay,nw,1) = (popt_cloudsv(l,nw,1) + popt_cloudsv(l+1,nw,1)) / 2.0 784 if (callclouds) then 785 poptcv(ig,lev2lay,nw,1) = (popt_cloudsv(l,nw,1) + popt_cloudsv(l+1,nw,1)) / 2.0 786 endif 771 787 ! Opacity (tau) : 772 788 do k = L_NLAYRAD, lev2lay, -1 773 789 popthv(ig,lev2lay,nw,2) = popthv(ig,lev2lay,nw,2) + popthv(ig,k,nw,1) 774 poptcv(ig,lev2lay,nw,2) = poptcv(ig,lev2lay,nw,2) + poptcv(ig,k,nw,1) 790 if (callclouds) then 791 poptcv(ig,lev2lay,nw,2) = poptcv(ig,lev2lay,nw,2) + poptcv(ig,k,nw,1) 792 endif 775 793 enddo 776 794 ! Extinction (k) : 777 795 popthv(ig,lev2lay,nw,3) = popthv(ig,lev2lay,nw,1) / (zzlev(ig,lev2lay+1) - zzlev(ig,lev2lay)) 778 poptcv(ig,lev2lay,nw,3) = poptcv(ig,lev2lay,nw,1) / (zzlev(ig,lev2lay+1) - zzlev(ig,lev2lay)) 796 if (callclouds) then 797 poptcv(ig,lev2lay,nw,3) = poptcv(ig,lev2lay,nw,1) / (zzlev(ig,lev2lay+1) - zzlev(ig,lev2lay)) 798 endif 779 799 ! Simple Scattering Albedo (w) and Asymmetry Parameter (g) : 780 800 popthv(ig,lev2lay,nw,4) = (popt_hazev(l,nw,2) + popt_hazev(l+1,nw,2)) / 2.0 781 poptcv(ig,lev2lay,nw,4) = (popt_cloudsv(l,nw,2) + popt_cloudsv(l+1,nw,2)) / 2.0782 801 popthv(ig,lev2lay,nw,5) = (popt_hazev(l,nw,3) + popt_hazev(l+1,nw,3)) / 2.0 783 poptcv(ig,lev2lay,nw,5) = (popt_cloudsv(l,nw,3) + popt_cloudsv(l+1,nw,3)) / 2.0 802 if (callclouds) then 803 poptcv(ig,lev2lay,nw,4) = (popt_cloudsv(l,nw,2) + popt_cloudsv(l+1,nw,2)) / 2.0 804 poptcv(ig,lev2lay,nw,5) = (popt_cloudsv(l,nw,3) + popt_cloudsv(l+1,nw,3)) / 2.0 805 endif 784 806 enddo 785 786 807 ! Infra-Red 787 808 do nw=1,L_NSPECTI … … 790 811 ! Optical thickness (dtau) : 791 812 popthi(ig,lev2lay,nw,1) = (popt_hazei(l,nw,1) + popt_hazei(l+1,nw,1)) / 2.0 792 poptci(ig,lev2lay,nw,1) = (popt_cloudsi(l,nw,1) + popt_cloudsi(l+1,nw,1)) / 2.0 813 if (callclouds) then 814 poptci(ig,lev2lay,nw,1) = (popt_cloudsi(l,nw,1) + popt_cloudsi(l+1,nw,1)) / 2.0 815 endif 793 816 ! Opacity (tau) : 794 817 do k = L_NLAYRAD, lev2lay, -1 795 818 popthi(ig,lev2lay,nw,2) = popthi(ig,lev2lay,nw,2) + popthi(ig,k,nw,1) 796 poptci(ig,lev2lay,nw,2) = poptci(ig,lev2lay,nw,2) + poptci(ig,k,nw,1) 819 if (callclouds) then 820 poptci(ig,lev2lay,nw,2) = poptci(ig,lev2lay,nw,2) + poptci(ig,k,nw,1) 821 endif 797 822 enddo 798 823 ! Extinction (k) : 799 824 popthi(ig,lev2lay,nw,3) = popthi(ig,lev2lay,nw,1) / (zzlev(ig,lev2lay+1) - zzlev(ig,lev2lay)) 800 poptci(ig,lev2lay,nw,3) = poptci(ig,lev2lay,nw,1) / (zzlev(ig,lev2lay+1) - zzlev(ig,lev2lay)) 825 if (callclouds) then 826 poptci(ig,lev2lay,nw,3) = poptci(ig,lev2lay,nw,1) / (zzlev(ig,lev2lay+1) - zzlev(ig,lev2lay)) 827 endif 801 828 ! Simple Scattering Albedo (w) and Asymmetry Parameter (g) : 802 829 popthi(ig,lev2lay,nw,4) = (popt_hazei(l,nw,2) + popt_hazei(l+1,nw,2)) / 2.0 803 poptci(ig,lev2lay,nw,4) = (popt_cloudsi(l,nw,2) + popt_cloudsi(l+1,nw,2)) / 2.0804 830 popthi(ig,lev2lay,nw,5) = (popt_hazei(l,nw,3) + popt_hazei(l+1,nw,3)) / 2.0 805 poptci(ig,lev2lay,nw,5) = (popt_cloudsi(l,nw,3) + popt_cloudsi(l+1,nw,3)) / 2.0 831 if (callclouds) then 832 poptci(ig,lev2lay,nw,4) = (popt_cloudsi(l,nw,2) + popt_cloudsi(l+1,nw,2)) / 2.0 833 poptci(ig,lev2lay,nw,5) = (popt_cloudsi(l,nw,3) + popt_cloudsi(l+1,nw,3)) / 2.0 834 endif 806 835 enddo 807 836 enddo … … 826 855 real(-nfluxtopv),real(nfluxtopi) 827 856 close(116) 828 829 857 830 858 ! USEFUL COMMENT - Do Not Remove. -
trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90
r3083 r3090 58 58 real,save :: FHIR 59 59 !$OMP THREADPRIVATE(Fcloudy,Fssa,FHVIS,FHIR) 60 60 61 logical,save :: resCH4_inf 61 62 !$OMP THREADPRIVATE(resCH4_inf) -
trunk/LMDZ.TITAN/libf/phytitan/calmufi.F90
r3083 r3090 18 18 !! done elsewhere. 19 19 !! 20 !! Authors : J.Burgalat, J.Vatant d'Ollone - 2017, B. de Batz de Trenquelléon (2023) 20 !! Authors : J.Burgalat, J.Vatant d'Ollone - 2017 21 !! Modified : B. de Batz de Trenquelléon (2023) 21 22 !! 22 23 USE MMP_GCM -
trunk/LMDZ.TITAN/libf/phytitan/cond_muphy.F90
r3083 r3090 24 24 ! dtlc = Condensation heating rate [K.s-1] 25 25 ! 26 ! Author (s)27 ! ------ ---26 ! Author 27 ! ------ 28 28 ! B. de Batz de Trenquelléon (07/2023) 29 29 !==================================================================== -
trunk/LMDZ.TITAN/libf/phytitan/disr_haze.F90
r3083 r3090 17 17 ! Jan Vatant d'Ollone (2016) 18 18 ! 19 ! Modified : 20 ! B. de Batz de Trenquelléon (2022) 19 21 ! ========================================================================== 20 22 -
trunk/LMDZ.TITAN/libf/phytitan/evapCH4.F90
r3083 r3090 44 44 ! 45 45 ! 46 ! Author (s)47 ! ------ ---46 ! Author 47 ! ------ 48 48 ! B. de Batz de Trenquelléon (10/2022) 49 49 ! … … 79 79 real, parameter :: humCH4 = 0.5 ! Imposed surface humidity for CH4 [-] 80 80 81 real, parameter :: Flnp = 0.0 1! Fraction occupied by lakes (North Pole)81 real, parameter :: Flnp = 0.05 ! Fraction occupied by lakes (North Pole) 82 82 real, parameter :: Flsp = 0.005 ! Fraction occupied by lakes (South Pole) 83 83 … … 129 129 qsatCH4 = (1.0e5 / pplev(ig,1)) * exp(1.051e1 - 1.110e3/tsurf(ig) - 4.341e3/tsurf(ig)**2 + 1.035e5/tsurf(ig)**3 - 7.910e5/tsurf(ig)**4) 130 130 qsatCH4 = humCH4 * qsatCH4 131 ! CH4 : 0.8 5* qsat because of dissolution in N2132 qsatCH4 = 0.8 5* qsatCH4131 ! CH4 : 0.80 * qsat because of dissolution in N2 132 qsatCH4 = 0.80 * qsatCH4 133 133 134 134 ! Flux at the surface [kg.m-2.s-1] : … … 196 196 dtsurfevap(ig) = - (fluxCH4 * LvCH4) / Cplake 197 197 198 ! >>> [TEMPO : BBT]199 !open(501,file='Evap_CH4.out')200 !if(REAL(latitude_deg(ig)) .ge. 70.) then201 ! write(501,*) '-----------------------------------'202 ! write(501,*) 'Latitude =', REAL(latitude_deg(ig))203 ! write(501,*) ''204 ! write(501,*) 'Initialisation variables :'205 ! write(501,*) 'Air density =', rhoair, 'kg.m-3'206 ! write(501,*) 'Horizontal wind =', ws, 'm.s-1'207 ! write(501,*) 'Turbulent term =', Cd208 ! write(501,*) 'CH4 saturation at the surface =', qsatCH4, 'mol.mol-1'209 ! write(501,*) ''210 ! write(501,*) 'Flux :'211 ! write(501,*) 'Flux of CH4 =', fluxCH4, 'kg.m-2.s-1.mol.mol-1'212 ! write(501,*) ''213 ! write(501,*) 'Variation of CH4 :'214 ! write(501,*) 'New molar fraction of CH4 =', newpqCH4, 'mol.mol-1'215 ! write(501,*) 'Trend of CH4 =', pdqCH4(ig), 'mol.mol-1.s-1'216 ! write(501,*) 'Variation of CH4 tank =', dtankCH4, 'm'217 ! write(501,*) ''218 ! write(501,*) 'Latent Heat :'219 ! write(501,*) 'Latente heat of CH4 vaporisation =', LvCH4, 'J.kg-1.mol.mol-1.s-1'220 ! write(501,*) 'dtsurfevap :', dtsurfevap(ig), 'K.s-1'221 ! write(501,*) '-----------------------------------'222 !endif223 !close(501)224 ! <<< [TEMPO : BBT]225 226 198 enddo ! End of main loop on the horizontal grid 227 199 -
trunk/LMDZ.TITAN/libf/phytitan/get_haze_and_cloud_opacity.F90
r3083 r3090 43 43 ! 44 44 ! 45 ! Author s46 ! ------ -45 ! Author 46 ! ------ 47 47 ! B. de Batz de Trenquelleon (08/2022). 48 48 ! -
trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90
r3083 r3090 33 33 ! author: Frederic Hourdin 15 / 10 /93 34 34 ! ------- 35 ! modified: Sebastien Lebonnois 11/06/2003 (new callphys.def) 36 ! Ehouarn Millour (oct. 2008) tracers are now identified 37 ! by their names and may not be contiguously 38 ! stored in the q(:,:,:,:) array 39 ! E.M. (june 2009) use getin routine to load parameters 35 ! modified: -Sebastien Lebonnois 11/06/2003 (new callphys.def) 36 ! -Ehouarn Millour (oct. 2008) tracers are now identified 37 ! by their names and may not be contiguously 38 ! stored in the q(:,:,:,:) array 39 ! -Ehouarn Millour (june 2009) use getin routine 40 ! to load parameters 41 ! -Bruno de Batz de Trenquelléon (2023) minor changes and 42 ! new initialisations 40 43 ! 41 44 ! -
trunk/LMDZ.TITAN/libf/phytitan/inimufi.F90
r3083 r3090 23 23 ! ------- 24 24 ! J. Vatant d'Ollone, J.Burgalat, S.Lebonnois (09/2017) 25 ! B. de Batz de Trenquelléon (02/2023)25 ! Modified : B. de Batz de Trenquelléon (02/2023) 26 26 ! 27 27 !============================================================================ -
trunk/LMDZ.TITAN/libf/phytitan/optci.F90
r3083 r3090 33 33 ! ------- 34 34 ! Adapted from the NASA Ames code by R. Wordsworth (2009) 35 ! Clean and adaptation to Titan by J. Vatant d'Ollone (2016-17) 36 ! Clean and correction to Titan by B. de Batz de Trenquelléon (2022) 37 ! New optics added for Titan's clouds by B. de Batz de Trenquelléon (2023) 38 ! The whole routine needs to be redone... 35 ! 36 ! Modified 37 ! -------- 38 ! J. Vatant d'Ollone (2016-17) 39 ! --> Clean and adaptation to Titan 40 ! B. de Batz de Trenquelléon (2022-2023) 41 ! --> Clean and correction to Titan 42 ! --> New optics added for Titan's clouds 39 43 ! 40 44 !================================================================== … … 105 109 ! Variables for new optics 106 110 integer iq, iw, FTYPE, CTYPE 107 real*8 m0as,m0af,m0ccn,m3as,m3af,m3ccn,m3 ices,m3cld111 real*8 m0as,m0af,m0ccn,m3as,m3af,m3ccn,m3cld 108 112 real*8 dtauaer_s,dtauaer_f,dtau_ccn,dtau_cld 109 113 real*8,save :: rhoaer_s(L_NSPECTI),ssa_s(L_NSPECTI),asf_s(L_NSPECTI) … … 178 182 m3as = pqmo(ilay,2) / 2.0 179 183 m3af = pqmo(ilay,4) / 2.0 180 ! Cut-off 181 IF (ilay .lt. 19) THEN182 m3as = pqmo( 19,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))183 m3af = pqmo( 19,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))184 ! Cut-off (here for p = 2.7e3Pa / alt = 70km) 185 IF (ilay .lt. 23) THEN 186 m3as = pqmo(23,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 187 m3af = pqmo(23,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 184 188 ENDIF 185 189 … … 202 206 m0as = pqmo(ilay,1) / 2.0 203 207 m3as = pqmo(ilay,2) / 2.0 204 ! If not callclouds : must have a cut-off 208 ! If not callclouds : must have a cut-off (here for p = 2.7e3Pa / alt = 70km) 205 209 IF (.NOT. callclouds) THEN 206 IF (ilay .lt. 19) THEN207 m0as = pqmo( 19,1) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))208 m3as = pqmo( 19,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))210 IF (ilay .lt. 23) THEN 211 m0as = pqmo(23,1) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 212 m3as = pqmo(23,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 209 213 ENDIF 210 214 ENDIF … … 216 220 m0af = pqmo(ilay,3) / 2.0 217 221 m3af = pqmo(ilay,4) / 2.0 218 ! If not callclouds : must have a cut-off 222 ! If not callclouds : must have a cut-off (here for p = 2.7e3Pa / alt = 70km) 219 223 IF (.NOT. callclouds) THEN 220 IF (ilay .lt. 19) THEN221 m0af = pqmo( 19,3) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))222 m3af = pqmo( 19,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))224 IF (ilay .lt. 23) THEN 225 m0af = pqmo(23,3) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 226 m3af = pqmo(23,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 223 227 ENDIF 224 228 ENDIF … … 249 253 m0ccn = pqmo(ilay,5) / 2.0 250 254 m3ccn = pqmo(ilay,6) / 2.0 251 m3ices = 0.0d0 252 m3cld = m3ccn 255 m3cld = 0.0d0 253 256 254 257 ! Clear / Dark column method : … … 261 264 IF (CDCOLUMN == 0) THEN 262 265 DO iq = 2, nice 263 m3ices = m3ices + (pqmo(ilay,ices_indx(iq)) / 2.0)264 266 m3cld = m3cld + (pqmo(ilay,ices_indx(iq)) / 2.0) 265 267 ENDDO … … 269 271 ELSEIF (CDCOLUMN == 1) THEN 270 272 DO iq = 1, nice 271 m3ices = m3ices + (pqmo(ilay,ices_indx(iq)) / 2.0)272 273 m3cld = m3cld + (pqmo(ilay,ices_indx(iq)) / 2.0) 273 274 ENDDO … … 278 279 WRITE(*,*) 'WE USE DARK COLUMN ...' 279 280 DO iq = 1, nice 280 m3ices = m3ices + (pqmo(ilay,ices_indx(iq)) / 2.0)281 281 m3cld = m3cld + (pqmo(ilay,ices_indx(iq)) / 2.0) 282 282 ENDDO … … 285 285 286 286 ! For small dropplets, opacity of nucleus dominates... 287 !ssa_cld(nw) = (ssa_ccn(nw)*m3ccn + ssa_cld(nw)*m3ices) / (m3ccn + m3ices)288 287 ssa_cld(nw) = (ssa_ccn(nw)*m3ccn + ssa_cld(nw)*m3cld) / (m3ccn + m3cld) 289 288 -
trunk/LMDZ.TITAN/libf/phytitan/optcv.F90
r3083 r3090 25 25 ! ------- 26 26 ! Adapted from the NASA Ames code by R. Wordsworth (2009) 27 ! Clean and adaptation to Titan by J. Vatant d'Ollone (2016-17) 28 ! Clean and correction to Titan by B. de Batz de Trenquelléon (2022) 29 ! New optics added for Titan's clouds by B. de Batz de Trenquelléon (2023) 30 ! The whole routine needs to be redone... 27 ! 28 ! Modified 29 ! -------- 30 ! J. Vatant d'Ollone (2016-17) 31 ! --> Clean and adaptation to Titan 32 ! B. de Batz de Trenquelléon (2022-2023) 33 ! --> Clean and correction to Titan 34 ! --> New optics added for Titan's clouds 31 35 ! 32 36 !================================================================== … … 116 120 ! Variables for new optics 117 121 integer iq, iw, FTYPE, CTYPE 118 real*8 m0as,m0af,m0ccn,m3as,m3af,m3ccn,m3 ices,m3cld122 real*8 m0as,m0af,m0ccn,m3as,m3af,m3ccn,m3cld 119 123 real*8 dtauaer_s,dtauaer_f,dtau_ccn,dtau_cld 120 124 real*8,save :: rhoaer_s(L_NSPECTV),ssa_s(L_NSPECTV),asf_s(L_NSPECTV) … … 202 206 m3as = pqmo(ilay,2) / 2.0 203 207 m3af = pqmo(ilay,4) / 2.0 204 ! Cut-off 205 IF (ilay .lt. 19) THEN206 m3as = pqmo( 19,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))207 m3af = pqmo( 19,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))208 ! Cut-off (here for p = 2.7e3Pa / alt = 70km) 209 IF (ilay .lt. 23) THEN 210 m3as = pqmo(23,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 211 m3af = pqmo(23,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 208 212 ENDIF 209 213 … … 226 230 m0as = pqmo(ilay,1) / 2.0 227 231 m3as = pqmo(ilay,2) / 2.0 228 ! If not callclouds : must have a cut-off 232 ! If not callclouds : must have a cut-off (here for p = 2.7e3Pa / alt = 70km) 229 233 IF (.NOT. callclouds) THEN 230 IF (ilay .lt. 19) THEN231 m0as = pqmo( 19,1) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))232 m3as = pqmo( 19,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))234 IF (ilay .lt. 23) THEN 235 m0as = pqmo(23,1) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 236 m3as = pqmo(23,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 233 237 ENDIF 234 238 ENDIF … … 240 244 m0af = pqmo(ilay,3) / 2.0 241 245 m3af = pqmo(ilay,4) / 2.0 242 ! If not callclouds : must have a cut-off 246 ! If not callclouds : must have a cut-off (here for p = 2.7e3Pa / alt = 70km) 243 247 IF (.NOT. callclouds) THEN 244 IF (ilay .lt. 19) THEN245 m0af = pqmo( 19,3) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))246 m3af = pqmo( 19,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(20)-zlev(19))248 IF (ilay .lt. 23) THEN 249 m0af = pqmo(23,3) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 250 m3af = pqmo(23,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23)) 247 251 ENDIF 248 252 ENDIF … … 273 277 m0ccn = pqmo(ilay,5) / 2.0 274 278 m3ccn = pqmo(ilay,6) / 2.0 275 m3ices = 0.0d0 276 m3cld = m3ccn 279 m3cld = 0.0d0 277 280 278 281 ! Clear / Dark column method : … … 285 288 IF (CDCOLUMN == 0) THEN 286 289 DO iq = 2, nice 287 m3ices = m3ices + (pqmo(ilay,ices_indx(iq)) / 2.0)288 290 m3cld = m3cld + (pqmo(ilay,ices_indx(iq)) / 2.0) 289 291 ENDDO … … 293 295 ELSEIF (CDCOLUMN == 1) THEN 294 296 DO iq = 1, nice 295 m3ices = m3ices + (pqmo(ilay,ices_indx(iq)) / 2.0)296 297 m3cld = m3cld + (pqmo(ilay,ices_indx(iq)) / 2.0) 297 298 ENDDO … … 302 303 WRITE(*,*) 'WE USE DARK COLUMN ...' 303 304 DO iq = 1, nice 304 m3ices = m3ices + (pqmo(ilay,ices_indx(iq)) / 2.0)305 305 m3cld = m3cld + (pqmo(ilay,ices_indx(iq)) / 2.0) 306 306 ENDDO … … 309 309 310 310 ! For small dropplets, opacity of nucleus dominates 311 !ssa_cld(nw) = (ssa_ccn(nw)*m3ccn + ssa_cld(nw)*m3ices) / (m3ccn + m3ices)312 311 ssa_cld(nw) = (ssa_ccn(nw)*m3ccn + ssa_cld(nw)*m3cld) / (m3ccn + m3cld) 313 312 ssa_cld(nw) = ssa_cld(nw) * Fssa -
trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90
r3083 r3090 15 15 16 16 use radinc_h, only : L_NSPECTI,L_NSPECTV 17 use radcommon_h, only: sigma, gzlat, grav, BWNV 17 use radcommon_h, only: sigma, gzlat, grav, BWNV, WNOI, WNOV 18 18 use comchem_h, only: nkim, cnames, nlaykim_up, ykim_up, ykim_tot, botCH4 19 19 use comdiurn_h, only: coslat, sinlat, coslon, sinlon … … 161 161 ! + clean of all too-generic (ocean, water, co2 ...) routines 162 162 ! + Titan's chemistry 163 ! Microphysical moment model - J.Burgalat / J.Vatant d'Ollone (2017-2018) 164 ! Improvement of microphysical moment model - B. de Batz de Trenquelléon (2022-2023) 165 ! Optics ofnn Titan's coulds - B. de Batz de Trenquelléon (2022-2023) 163 ! Microphysical moment model - J.Burgalat / B. de Batz de Trenquelléon (2022-2023) 164 ! Modified : B. de Batz de Trenquelléon (2023) 165 ! + Optical improvements (haze and cloud) 166 ! + Nudging of troposphere !! 166 167 !============================================================================================ 167 168 … … 258 259 real zdqmr(ngrid,nlayer,nq) ! Mass_redistribution routine. 259 260 260 real zdqchi(ngrid,nlayer,nq) ! Chemical tendency ( chemistry routine).261 real zdqchi(ngrid,nlayer,nq) ! Chemical tendency (chemistry routine). 261 262 262 263 real zdqmufi(ngrid,nlayer,nq) ! Microphysical tendency. … … 271 272 real zdhdif(ngrid,nlayer) ! Turbdiff/vdifc routines. 272 273 real zdhadj(ngrid,nlayer) ! Convadj routine. 273 real zdundg(ngrid,nlayer) ! Nudging for zonal wind (m/s/s).274 real zdundg(ngrid,nlayer) ! Nudging for zonal wind. 274 275 275 276 ! For Pressure and Mass : … … 301 302 real zdudyn(ngrid,nlayer) ! Dynamical Zonal Wind tendency (m.s-2). 302 303 303 real zhorizwind(ngrid,nlayer) ! Horizontal Wind ( 304 real zhorizwind(ngrid,nlayer) ! Horizontal Wind (sqrt(u*u+v*v)) 304 305 305 306 real vmr(ngrid,nlayer) ! volume mixing ratio … … 352 353 real, dimension(ngrid,nlayer,nkim) :: ysat 353 354 354 ! Fraction of CH4 [mol/mol]355 ! Temporary fraction of CH4 [mol/mol] 355 356 real, dimension(ngrid,nlayer) :: tpq_CH4 356 357 … … 467 468 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 468 469 469 if ( callchim) then470 471 if ( moyzon_ch .and. ngrid.eq.1) then470 if (callchim) then 471 472 if (moyzon_ch .and. ngrid.eq.1) then 472 473 print *, "moyzon_ch=",moyzon_ch," and ngrid=1" 473 474 print *, "Please desactivate zonal mean for 1D !" … … 483 484 ! ~~~~~~~~~~~~~~~~~~~~~~~~ 484 485 485 IF ( callmufi) THEN486 IF (callmufi) THEN 486 487 ! WARNING JB (27/03/2018): inimufi should be wrapped in an OMP SINGLE statement. 487 488 call inimufi(ptimestep) … … 619 620 write(*,*) "physiq: call initialize_xios_output" 620 621 call initialize_xios_output(pday,ptime,ptimestep,daysec, & 621 presnivs,pseudoalt )622 presnivs,pseudoalt,wnoi,wnov) 622 623 #endif 623 624 write(*,*) "physiq: end of firstcall" … … 1066 1067 if (tracer) then 1067 1068 1068 1069 1069 #ifndef MESOSCALE 1070 !! JVO 20 : For now, no chemistry or microphysics in MESOSCALE, but why not in the future ? 1071 1072 ! ------------------- 1073 ! V.1 Microphysics 1074 ! ------------------- 1075 1076 ! JVO 05/18 : We must call microphysics before chemistry, for condensation ! 1077 1070 ! ------------------- 1071 ! V.1 Microphysics 1072 ! ------------------- 1073 1074 ! We must call microphysics before chemistry, for condensation ! 1078 1075 if (callmufi) then 1079 1076 … … 1084 1081 call calmufi(ptimestep,pplev,zzlev,pplay,zzlay,gzlat,pt,tpq,dtpq,zdqmufi) 1085 1082 tpq(:,:,:) = tpq(:,:,:) + zdqmufi(:,:,:)*ptimestep ! only manipulation of tpq->*ptimestep here 1086 #else 1087 1083 1084 #else 1088 1085 call calmufi(ptimestep,pplev,zzlev,pplay,zzlay,gzlat,pt,pq,pdq,zdqmufi) 1089 1090 1086 pdq(:,:,:) = pdq(:,:,:) + zdqmufi(:,:,:) 1091 1087 1092 ! Sanity check ( way safer to be done here rather than within YAMMS)1088 ! Sanity check (way safer to be done here rather than within YAMMS) 1093 1089 ! Important : the sanity check intentionally include the former processes tendency ! 1094 1090 ! NB : Despite this sanity check there might be still some unphysical values going through : … … 1124 1120 1125 1121 ! Microphysics condensation for 2D fields to sent non-saturated fields to photochem 1126 if ( callclouds .and. moyzon_ch .and. mod(icount-1,ichim).eq.0) then1127 zdqfibar(:,:,:) = 0.D0 ! We work in zonal average -> forget processes other than condensation1128 call calmufi(ptimestep,zplevbar,zzlevbar,zplaybar,zzlaybar, &1129 gzlat,ztfibar,zqfibar,zdqfibar,zdqmufibar)1130 ! TODO : Add a sanity check here !1122 if (callclouds .and. moyzon_ch .and. mod(icount-1,ichim).eq.0) then 1123 zdqfibar(:,:,:) = 0.D0 ! We work in zonal average -> forget processes other than condensation 1124 call calmufi(ptimestep,zplevbar,zzlevbar,zplaybar,zzlaybar, & 1125 gzlat,ztfibar,zqfibar,zdqfibar,zdqmufibar) 1126 ! TODO : Add a sanity check here ! 1131 1127 endif 1132 1128 1133 ! >>> TEMPO : BBT 1134 ! Default value -> no condensation [kg/kg_air/s] : 1135 dmuficond(:,:,:) = 0.D0 1136 do iq = 1, size(ices_indx) 1137 dmuficond(:,:,iq) = zdqmufi(:,:,gazs_indx(iq)) 1138 enddo 1139 call cond_muphy(ngrid,nlayer,pt,dmuficond,zdtlc) 1140 !pdt(:,:) = pdt(:,:) + zdtlc(:,:) 1141 ! <<< TEMPO : BBT 1142 endif 1129 ! Condensation heating rate : 1130 if (callclouds) then 1131 ! Default value -> no condensation [kg/kg_air/s] : 1132 dmuficond(:,:,:) = 0.D0 1133 do iq = 1, size(ices_indx) 1134 dmuficond(:,:,iq) = zdqmufi(:,:,gazs_indx(iq)) 1135 enddo 1136 call cond_muphy(ngrid,nlayer,pt,dmuficond,zdtlc) 1137 !pdt(:,:) = pdt(:,:) + zdtlc(:,:) 1138 endif 1139 endif ! callmufi 1143 1140 1144 1141 ! ----------------- … … 1146 1143 ! ----------------- 1147 1144 ! NB : Must be call last ( brings fields back to an equilibrium ) 1148 1149 ! Known bug ? ( JVO 18 ) : If you try to use chimi_indx instead of iq+nmicro1150 ! it leads to weird results / crash on dev mod ( ok in debug ) ... Why ? Idk ...1151 1152 1145 if (callchim) then 1153 1146 … … 1155 1148 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1156 1149 do iq = 1,nkim 1157 ychim(:,:,iq) = ( pq(:,:,iq+nmicro) + pdq(:,:,iq+nmicro)*ptimestep) / rat_mmol(iq+nmicro)1150 ychim(:,:,iq) = (pq(:,:,iq+nmicro) + pdq(:,:,iq+nmicro)*ptimestep) / rat_mmol(iq+nmicro) 1158 1151 enddo 1159 1152 … … 1162 1155 ! processes ( convadj ... ) we miss them in any case as we work in zonally/diurnal 1163 1156 ! mean -> no fine diurnal/short time evolution, only seasonal evolution only. 1164 if ( moyzon_ch .and. mod(icount-1,ichim).eq. 0) then1157 if (moyzon_ch .and. mod(icount-1,ichim).eq. 0) then 1165 1158 do iq = 1,nkim 1166 1159 ychimbar(:,:,iq) = zqfibar(:,:,iq+nmicro) / rat_mmol(iq+nmicro) … … 1174 1167 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1175 1168 1176 call calc_ysat(ngrid,nlayer,pplay/100.0,pt,ysat) ! Compute saturation profiles for every grid point 1169 call calc_ysat(ngrid,nlayer,pplay/100.0,pt,ysat) ! Compute saturation profiles for every grid point (!!p in mbar!!) 1177 1170 1178 1171 dyccond(:,:,:) = 0.D0 ! Default value -> no condensation 1179 1172 1180 1173 do iq=1,nkim 1181 where ( ychim(:,:,iq).gt.ysat(:,:,iq) ) & 1182 dyccond(:,:,iq+nmicro) = ( -ychim(:,:,iq)+ysat(:,:,iq) ) / ptimestep 1174 where (ychim(:,:,iq).gt.ysat(:,:,iq)) 1175 dyccond(:,:,iq+nmicro) = (-ychim(:,:,iq)+ysat(:,:,iq)) / ptimestep 1176 endwhere 1183 1177 enddo 1184 1178 … … 1191 1185 do iq=1,nkim 1192 1186 ychim(:,:,iq) = ychim(:,:,iq) + dyccond(:,:,iq+nmicro)*ptimestep ! update molar ychim for following calchim 1193 1194 1187 pdq(:,:,iq+nmicro) = pdq(:,:,iq+nmicro) + dyccond(:,:,iq+nmicro)*rat_mmol(iq+nmicro) ! convert tendencies to mass mixing ratio 1195 1188 enddo … … 1198 1191 ! ii. 2D zonally averaged fields need to condense and evap before photochem 1199 1192 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1200 if ( moyzon_ch .and. mod(icount-1,ichim).eq. 0 ) then 1201 1202 call calc_ysat(ngrid,nlayer,zplaybar/100.0,ztfibar,ysat) ! Compute saturation profiles for every grid point for the zon-ave fields 1203 1204 dyccondbar(:,:,:) = 0.D0 ! Default value -> no condensation 1205 1206 do iq = 1,nkim 1207 where ( ychimbar(:,:,iq).gt.ysat(:,:,iq) ) & 1208 dyccondbar(:,:,iq+nmicro) = ( -ychimbar(:,:,iq)+ysat(:,:,iq) ) / ptimestep 1209 enddo 1193 if (moyzon_ch .and. mod(icount-1,ichim).eq. 0) then 1194 1195 call calc_ysat(ngrid,nlayer,zplaybar/100.0,ztfibar,ysat) ! Compute saturation profiles for every grid point for the zon-ave fields 1196 1197 dyccondbar(:,:,:) = 0.D0 ! Default value -> no condensation 1198 1199 do iq = 1,nkim 1200 where ( ychimbar(:,:,iq).gt.ysat(:,:,iq) ) 1201 dyccondbar(:,:,iq+nmicro) = ( -ychimbar(:,:,iq)+ysat(:,:,iq) ) / ptimestep 1202 endwhere 1203 enddo 1210 1204 1211 1205 if (callclouds) then … … 1215 1209 endif 1216 1210 1217 do iq=1,nkim 1218 ychimbar(:,:,iq) = ychimbar(:,:,iq) + dyccondbar(:,:,iq+nmicro)*ptimestep 1219 enddo 1220 1221 ! Pseudo-evap ( forcing constant surface humidity ) 1222 !do ig=1,ngrid 1223 ! if ( ychimbar(ig,1,7) .lt. botCH4 ) ychimbar(ig,1,7) = botCH4 1224 !enddo 1225 1226 endif ! if ( moyzon_ch .and. mod(icount-1,ichim).eq. 0 ) 1211 do iq=1,nkim 1212 ychimbar(:,:,iq) = ychimbar(:,:,iq) + dyccondbar(:,:,iq+nmicro)*ptimestep 1213 enddo 1214 1215 endif ! if ( moyzon_ch .and. mod(icount-1,ichim).eq.0 ) 1227 1216 1228 1217 ! iii. Photochemistry ( must be call after condensation (and evap of 2D) ) 1229 1218 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1230 1219 if( mod(icount-1,ichim).eq.0. ) then 1231 1232 print *, "We enter in the chemistry ..." 1220 print *, "We enter in the photochemistry ..." 1233 1221 1234 1222 if (moyzon_ch) then ! 2D zonally averaged chemistry 1235 1236 1223 ! Here we send zonal average fields ( corrected with cond ) from dynamics to chem. module 1237 1224 call calchim(ngrid,ychimbar,declin,ctimestep,ztfibar,zphibar,zphisbar, & 1238 1225 zplaybar,zplevbar,zzlaybar,zzlevbar,dycchi) 1226 1239 1227 else ! 3D chemistry (or 1D run) 1240 1228 call calchim(ngrid,ychim,declin,ctimestep,pt,pphi,phisfi, & 1241 1229 pplay,pplev,zzlay_eff,zzlev_eff,dycchi) 1242 1230 endif ! if moyzon 1243 1244 endif 1231 endif ! if (mod(icount-1,ichim).eq.0) 1245 1232 1246 1233 ! iv. Surface pseudo-evaporation 1247 1234 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1235 ! Infinite tank of CH4 (global) 1248 1236 if (resCH4_inf) then 1249 1250 if ( (ychim(ig,1,7)+dycchi(ig,1,7)*ptimestep) .lt. botCH4) then ! + dycchi because ychim not yet updated1251 1252 1253 1254 1255 1256 1257 ! >>> New evaporation flux1237 do ig=1,ngrid 1238 if ((ychim(ig,1,7)+dycchi(ig,1,7)*ptimestep) .lt. botCH4) then ! + dycchi because ychim not yet updated 1239 dycevapCH4(ig) = ( -ychim(ig,1,7)+botCH4 ) / ptimestep - dycchi(ig,1,7) 1240 else 1241 dycevapCH4(ig) = 0.D0 1242 endif 1243 enddo 1244 1245 ! Tank at the pole (for the moment infinit...) 1258 1246 else 1259 tankCH4(:) = 2. ! Pour le moment reservoir infini...1260 1261 1262 1263 1264 1265 1266 1267 1247 tankCH4(:) = 2. 1248 if (moyzon_ch) then 1249 tpq_CH4(:,:) = ychimbar(:,:,7) + dycchi(:,:,7)*ptimestep ! + dycchi because ychim not yet updated [mol/mol] 1250 else 1251 tpq_CH4(:,:) = ychim(:,:,7) + dycchi(:,:,7)*ptimestep ! + dycchi because ychim not yet updated [mol/mol] 1252 endif 1253 call evapCH4(ngrid,nlayer,ptimestep,pplev,zzlay,zzlev,& 1254 pu,pv,tsurf,tpq_CH4,tankCH4,dycevapCH4,zdtsurfevap) 1255 zdtsurf(:) = zdtsurf(:) + zdtsurfevap(:) 1268 1256 endif 1269 ! <<< New evaporation flux1270 1257 1271 1258 pdq(:,1,7+nmicro) = pdq(:,1,7+nmicro) + dycevapCH4(:)*rat_mmol(7+nmicro) … … 1286 1273 endif ! end of 'callchim' 1287 1274 1275 ! END MESOSCALE 1288 1276 #endif 1289 1277 … … 1316 1304 pdv(:,:) = pdv(:,:) + zdvmr(:,:) 1317 1305 pdpsrf(:) = pdpsrf(:) + zdpsrfmr(:) 1306 zdtsurf(:) = zdtsurf(:) + zdtsurfmr(:) 1318 1307 endif 1319 1308 … … 1362 1351 if (nudging_u) then 1363 1352 zdundg(:,:) = 0.D0 1364 1365 1353 ! boucle sur les points de grille : 1366 1354 do i = 1, ngrid 1367 1355 ! boucle sur les latitudes : 1368 1356 do j = 1, 49 1369 1370 1357 ! Nudging of the first 23 layers only !! 1371 1358 if (ABS(REAL(u_ref(j,1)) - REAL(latitude_deg(i))) .lt. 1e-2) then 1372 1359 zdundg(i,1:23) = (u_ref(j,2:24) - (pu(i,1:23)+pdu(i,1:23)*ptimestep)) / nudging_dt 1373 1360 endif 1374 1375 1361 enddo 1376 1362 enddo 1377 1378 1363 pdu(:,:) = pdu(:,:) + zdundg(:,:) 1379 1364 endif … … 1406 1391 enddo 1407 1392 1408 ! Tracers .1409 ! >>> TEMPO : BBT1410 pdq(:,1:13,gazs_indx(2)) = (2e-8 - pq(:,1:13,gazs_indx(2))) / (ptimestep * 100) ! C2H61411 pdq(:,1:12,gazs_indx(3)) = (1e-9 - pq(:,1:12,gazs_indx(3))) / (ptimestep * 100) ! C2H21412 pdq(:,1:11,gazs_indx(4)) = (1e-20 - pq(:,1:11,gazs_indx(4))) / (ptimestep * 100) ! HCN1413 ! <<< TEMPO : BBT1393 ! Tracers : for now because problem with re-evaporation in microphysics ... 1394 if (callclouds) then 1395 pdq(:,1:13,gazs_indx(2)) = (2e-8 - pq(:,1:13,gazs_indx(2))) / (ptimestep * 100) ! C2H6 1396 pdq(:,1:12,gazs_indx(3)) = (1e-9 - pq(:,1:12,gazs_indx(3))) / (ptimestep * 100) ! C2H2 1397 pdq(:,1:11,gazs_indx(4)) = (1e-20 - pq(:,1:11,gazs_indx(4))) / (ptimestep * 100) ! HCN 1398 endif 1414 1399 zq(:,:,:) = pq(:,:,:) + pdq(:,:,:)*ptimestep 1415 1400 … … 1501 1486 endif 1502 1487 1503 1504 1488 if (is_master) print*,'--> Ls =',zls*180./pi 1505 1489 … … 1555 1539 call writediagfi(ngrid,"w","Vertical wind","m.s-1",3,pw) 1556 1540 call writediagfi(ngrid,"p","Pressure","Pa",3,pplay) 1557 1558 ! Total energy balance diagnostics 1541 1542 ! Subsurface temperatures 1543 !call writediagsoil(ngrid,"tempsoil","temperature soil","K",3,tsoil) 1544 1545 ! Total energy balance diagnostics 1559 1546 if(callrad.and.(.not.newtonian))then 1560 1547 call writediagfi(ngrid,"ALB","Surface albedo"," ",2,albedo_equivalent) … … 1666 1653 ! Send fields to XIOS: (NB these fields must also be defined as 1667 1654 ! <field id="..." /> in context_lmdz_physics.xml to be correctly used) 1668 1655 1669 1656 !-------------------------------------------------------- 1670 1657 ! General diagnostics : … … 1697 1684 ENDIF 1698 1685 1686 ! Subsurface temperatures (3D) 1687 !CALL send_xios_field("tempsoil",tsoil) 1688 ! Total energy balance diagnostics (2D) 1689 !CALL send_xios_field("ALB",albedo_equivalent) 1699 1690 1700 1691 !-------------------------------------------------------- … … 1709 1700 CALL send_xios_field("dudif",zdudif) 1710 1701 CALL send_xios_field("duadj",zduadj) 1711 CALL send_xios_field("dundg",zdundg) 1702 IF (nudging_u) THEN 1703 CALL send_xios_field("dundg",zdundg) 1704 ENDIF 1712 1705 1713 1706 ! zhorizwind = sqrt(u*u + v*v) … … 1727 1720 CALL send_xios_field("dtdif",zdtdif) 1728 1721 CALL send_xios_field("dtadj",zdtadj(:,:)) 1729 CALL send_xios_field("dtlc",zdtlc) 1722 IF (callclouds) THEN 1723 CALL send_xios_field("dtlc",zdtlc) 1724 ENDIF 1730 1725 1731 1726 ! dtrad = zdtsw + zdtlw … … 1752 1747 ! Optical diagnostics : 1753 1748 !-------------------------------------------------------- 1754 ! Optics diagnostics for haze (Channel VI04 : 2.80um). 1755 CALL send_xios_field('tauhv_04',zpopthv(:,:,4,2)) 1756 CALL send_xios_field('khv_04',zpopthv(:,:,4,3)) 1757 CALL send_xios_field('wbarhv_04',zpopthv(:,:,4,4)) 1758 CALL send_xios_field('gbarhv_04',zpopthv(:,:,4,5)) 1759 ! Optics diagnostics for haze (Channel VI18 : 0.85um). 1760 CALL send_xios_field('tauhv_18',zpopthv(:,:,18,2)) 1761 CALL send_xios_field('khv_18',zpopthv(:,:,18,3)) 1762 CALL send_xios_field('wbarhv_18',zpopthv(:,:,18,4)) 1763 CALL send_xios_field('gbarhv_18',zpopthv(:,:,18,5)) 1764 ! Optics diagnostics for haze (Channel IR07 : 29.5um). 1765 CALL send_xios_field('tauhi_07',zpopthi(:,:,7,2)) 1766 CALL send_xios_field('khi_07',zpopthi(:,:,7,3)) 1767 CALL send_xios_field('wbarhi_07',zpopthi(:,:,7,4)) 1768 CALL send_xios_field('gbarhi_07',zpopthi(:,:,7,5)) 1769 ! Optics diagnostics for haze (Channel IR22 : 5.66um). 1770 CALL send_xios_field('tauhi_22',zpopthi(:,:,22,2)) 1771 CALL send_xios_field('khi_22',zpopthi(:,:,22,3)) 1772 CALL send_xios_field('wbarhi_22',zpopthi(:,:,22,4)) 1773 CALL send_xios_field('gbarhi_22',zpopthi(:,:,22,5)) 1774 1775 ! Optics diagnostics for haze + clouds (Channel VI04 : 2.80um). 1776 CALL send_xios_field('taucv_04',zpoptcv(:,:,4,2)) 1777 CALL send_xios_field('kcv_04',zpoptcv(:,:,4,3)) 1778 CALL send_xios_field('wbarcv_04',zpoptcv(:,:,4,4)) 1779 CALL send_xios_field('gbarcv_04',zpoptcv(:,:,4,5)) 1780 ! Optics diagnostics for haze + clouds (Channel VI18 : 0.85um). 1781 CALL send_xios_field('taucv_18',zpoptcv(:,:,18,2)) 1782 CALL send_xios_field('kcv_18',zpoptcv(:,:,18,3)) 1783 CALL send_xios_field('wbarcv_18',zpoptcv(:,:,18,4)) 1784 CALL send_xios_field('gbarcv_18',zpoptcv(:,:,18,5)) 1785 ! Optics diagnostics for haze + clouds (Channel IR07 : 29.5um). 1786 CALL send_xios_field('tauci_07',zpoptci(:,:,7,2)) 1787 CALL send_xios_field('kci_07',zpoptci(:,:,7,3)) 1788 CALL send_xios_field('wbarci_07',zpoptci(:,:,7,4)) 1789 CALL send_xios_field('gbarci_07',zpoptci(:,:,7,5)) 1790 ! Optics diagnostics for haze + clouds (Channel IR22 : 5.66um). 1791 CALL send_xios_field('tauci_22',zpoptci(:,:,22,2)) 1792 CALL send_xios_field('kci_22',zpoptci(:,:,22,3)) 1793 CALL send_xios_field('wbarci_22',zpoptci(:,:,22,4)) 1794 CALL send_xios_field('gbarci_22',zpoptci(:,:,22,5)) 1795 1796 ! >>> [TEMPO : BBT] 1797 !DO nw = 1, L_NSPECTV 1798 ! WRITE(str2,'(i2.2)') nw 1799 ! CALL send_xios_field('khv'//TRIM(nw),zpopthv(:,:,nw,3)) 1800 !ENDDO 1801 ! <<< [TEMPO : BBT] 1802 1749 ! Diagnostics for haze : 1750 ! IR 1751 CALL send_xios_field('dtauhi',zpopthi(:,:,:,1)) 1752 CALL send_xios_field('tauhi',zpopthi(:,:,:,2)) 1753 CALL send_xios_field('khi',zpopthi(:,:,:,3)) 1754 CALL send_xios_field('whi',zpopthi(:,:,:,4)) 1755 CALL send_xios_field('ghi',zpopthi(:,:,:,5)) 1756 ! VI 1757 CALL send_xios_field('dtauhv',zpopthv(:,:,:,1)) 1758 CALL send_xios_field('tauhv',zpopthv(:,:,:,2)) 1759 CALL send_xios_field('khv',zpopthv(:,:,:,3)) 1760 CALL send_xios_field('whv',zpopthv(:,:,:,4)) 1761 CALL send_xios_field('ghv',zpopthv(:,:,:,5)) 1762 1763 ! Diagnostics for haze and clouds : 1764 IF (callclouds) THEN 1765 ! IR 1766 CALL send_xios_field('dtaui',zpoptci(:,:,:,1)) 1767 CALL send_xios_field('taui',zpoptci(:,:,:,2)) 1768 CALL send_xios_field('ki',zpoptci(:,:,:,3)) 1769 CALL send_xios_field('wi',zpoptci(:,:,:,4)) 1770 CALL send_xios_field('gi',zpoptci(:,:,:,5)) 1771 ! VI 1772 CALL send_xios_field('dtauv',zpoptcv(:,:,:,1)) 1773 CALL send_xios_field('tauv',zpoptcv(:,:,:,2)) 1774 CALL send_xios_field('kv',zpoptcv(:,:,:,3)) 1775 CALL send_xios_field('wv',zpoptcv(:,:,:,4)) 1776 CALL send_xios_field('gv',zpoptcv(:,:,:,5)) 1777 ENDIF 1803 1778 1804 1779 !-------------------------------------------------------- … … 1831 1806 CALL send_xios_field("vsed_ccn",mmd_ccn_w(:,:)) 1832 1807 CALL send_xios_field("flux_ccn",mmd_ccn_flux(:,:)) 1833 CALL send_xios_field("flux_iCH4",mmd_ice_fluxes(:,:,1))1834 CALL send_xios_field("flux_iC2H2",mmd_ice_fluxes(:,:,2))1835 CALL send_xios_field("flux_iC2H6",mmd_ice_fluxes(:,:,3))1836 CALL send_xios_field("flux_iHCN",mmd_ice_fluxes(:,:,3))1837 1808 DO iq = 1, size(ices_indx) 1809 CALL send_xios_field('flux_i'//TRIM(nameOfTracer(gazs_indx(iq))),mmd_ice_fluxes(:,:,iq)) 1838 1810 CALL send_xios_field(TRIM(nameOfTracer(gazs_indx(iq)))//'_sat',mmd_gazs_sat(:,:,iq)) 1839 1811 ENDDO … … 1843 1815 CALL send_xios_field("aer_prec",mmd_aer_prec(:)) 1844 1816 CALL send_xios_field("ccn_prec",mmd_ccn_prec(:)) 1845 CALL send_xios_field("iCH4_prec",mmd_ice_prec(:,1)) 1846 CALL send_xios_field("iC2H2_prec",mmd_ice_prec(:,2)) 1847 CALL send_xios_field("iC2H6_prec",mmd_ice_prec(:,3)) 1848 CALL send_xios_field("iHCN_prec",mmd_ice_prec(:,3)) 1817 IF (callclouds) THEN 1818 DO iq = 1, size(ices_indx) 1819 CALL send_xios_field('i'//TRIM(nameOfTracer(gazs_indx(iq)))//'_prec',mmd_ice_prec(:,iq)) 1820 ENDDO 1821 ENDIF 1849 1822 ENDIF ! of 'if callmufi' 1850 1823 … … 1856 1829 ! Chemical species : 1857 1830 DO iq = 1, nkim 1831 ! If no cloud : gzs_indx uninitialized 1858 1832 CALL send_xios_field(trim(cnames(iq)),zq(:,:,iq+nmicro)/rat_mmol(iq+nmicro)) ! kg/kg -> mol/mol 1859 1833 ENDDO 1860 1834 1861 1835 ! Condensation tendencies from microphysics (mol/mol/s) : 1862 DO iq = 1, size(ices_indx) 1863 CALL send_xios_field('dmuficond_'//trim(nameOfTracer(gazs_indx(iq))),dmuficond(:,:,iq)/rat_mmol(gazs_indx(iq))) ! kg/kg/s -> mol/mol/s 1864 ENDDO 1836 IF (callclouds) THEN 1837 DO iq = 1, size(ices_indx) 1838 CALL send_xios_field('dmuficond_'//trim(nameOfTracer(gazs_indx(iq))),dmuficond(:,:,iq)/rat_mmol(gazs_indx(iq))) ! kg/kg/s -> mol/mol/s 1839 ENDDO 1840 ENDIF 1865 1841 1866 1842 ! Condensation tendencies (mol/mol/s) : -
trunk/LMDZ.TITAN/libf/phytitan/tpindex.F
r3083 r3090 48 48 ! ------- 49 49 ! Adapted from the NASA Ames code by R. Wordsworth (2009) 50 ! Last update : B. de Batz de Trenquell eon (2023)50 ! Last update : B. de Batz de Trenquelléon (2023) 51 51 ! 52 52 !================================================================== -
trunk/LMDZ.TITAN/libf/phytitan/tracer_h.F90
r3083 r3090 1 ! AUTHOR : J. Burgalat (27/03/2018) 2 ! NOTES : Add gazs_indx by B. de Batz de Trenquelléon (31/05/2022) 1 ! AUTHORS : J. Burgalat (2018), B. de Batz de Trenquelléon (2022) 3 2 ! 4 3 ! OpenMP directives in this module are inconsistent: -
trunk/LMDZ.TITAN/libf/phytitan/xios_output_mod.F90
r1943 r3090 11 11 12 12 INTERFACE send_xios_field 13 MODULE PROCEDURE histwrite0d_xios,histwrite2d_xios,histwrite3d_xios 13 MODULE PROCEDURE histwrite0d_xios,histwrite2d_xios,histwrite3d_xios,histwrite4d_xios 14 14 END INTERFACE 15 15 … … 18 18 19 19 SUBROUTINE initialize_xios_output(day,timeofday,dtphys,daysec,& 20 presnivs,pseudoalt )20 presnivs,pseudoalt,wnoi,wnov) 21 21 ! USE mod_phys_lmdz_para, only: gather, bcast, & 22 22 ! jj_nb, jj_begin, jj_end, ii_begin, ii_end, & … … 46 46 REAL,INTENT(IN) :: presnivs(:) ! vertical grid approximate pressure (Pa) 47 47 REAL,INTENT(IN) :: pseudoalt(:) ! vertical grid approximate altitude (km) 48 48 REAL,INTENT(IN) :: wnoi(:) ! Array of wavelength channels for the infrared. 49 REAL,INTENT(IN) :: wnov(:) ! Array of wavelength channels for the visible. 49 50 50 51 INTEGER :: i … … 72 73 CALL xios_set_axis_attr("preskim_tot", n_glo=size(preskim_tot), value=preskim_tot,& 73 74 unit="Pa",positive="down") 74 75 76 IF (prt_level>=10) WRITE(lunout,*) "initialize_xios_output: call xios_set_axis_attr for IR_Wavelength" 77 CALL xios_set_axis_attr("IR_Wavelength", n_glo=size(wnoi), value=wnoi,unit="m",positive="up") 78 79 IF (prt_level>=10) WRITE(lunout,*) "initialize_xios_output: call xios_set_axis_attr for VI_Wavelength" 80 CALL xios_set_axis_attr("VI_Wavelength", n_glo=size(wnov), value=wnov,unit="m",positive="up") 81 75 82 ! Calculation of pseudo-altitudes is still to be done 76 83 !IF (prt_level>=10) WRITE(lunout,*) "initialize_xios_output: call xios_set_axis_attr for zlaykim" … … 291 298 END SUBROUTINE histwrite3d_xios 292 299 300 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 301 302 SUBROUTINE histwrite4d_xios(field_name, field) 303 USE dimphy, only: klon, klev 304 USE mod_phys_lmdz_para, only: gather_omp, grid1Dto2D_mpi, & 305 jj_nb, klon_mpi 306 USE xios, only: xios_send_field 307 USE print_control_mod, ONLY: prt_level,lunout 308 USE mod_grid_phy_lmdz, ONLY: nbp_lon 309 310 IMPLICIT NONE 311 312 CHARACTER(LEN=*), INTENT(IN) :: field_name 313 REAL, DIMENSION(:,:,:), INTENT(IN) :: field ! --> field(klon,:,:) 314 315 REAL,DIMENSION(klon_mpi,SIZE(field,2),SIZE(field,3)) :: buffer_omp 316 REAL :: Field4d(nbp_lon,jj_nb,SIZE(field,2),SIZE(field,3)) 317 INTEGER :: ip, n, nlev, llev 318 319 IF (prt_level >= 10) write(lunout,*)'Begin histrwrite4d_xios ',trim(field_name) 320 321 !Et on.... écrit 322 IF (SIZE(field,1)/=klon) CALL abort_physic('iophy::histwrite4d','Field first DIMENSION not equal to klon',1) 323 324 nlev=SIZE(field,2) 325 llev=SIZE(field,3) 326 327 CALL Gather_omp(field,buffer_omp) 328 !$OMP MASTER 329 CALL grid1Dto2D_mpi(buffer_omp,field4d) 330 331 CALL xios_send_field(field_name, Field4d(:,:,1:nlev,1:llev)) 332 !$OMP END MASTER 333 334 IF (prt_level >= 10) write(lunout,*)'End histrwrite4d_xios ',trim(field_name) 335 END SUBROUTINE histwrite4d_xios 336 293 337 #endif 294 338
Note: See TracChangeset
for help on using the changeset viewer.