Ignore:
Timestamp:
Mar 9, 2026, 10:29:53 AM (2 weeks ago)
Author:
jbclement
Message:

PEM:

  • Introduction of a configurable display/logging system with options 'out2term', 'out2log', 'verbosity_lvl'. All messages now use verbosity levels ('LVL_NFO', 'LVL_WRN', 'LVL_ERR' and 'LVL_DBG').
  • Code encapsulation improvements with systematic privacy/protection of module variables.
  • Addition of workflow safety checks for required executables, dependencies (e.g. 'ncdump'), input files and callphys keys.
  • Renaming of PEM starting and diagnostic files ("startevol.nc" into "startevo.nc", "diagevol.nc" into "diagevo.nc").

JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/layered_deposits.F90

    r4068 r4110  
    2828! ---------
    2929! Numerical parameter
    30 logical(k4),  protected :: do_layering
     30logical(k4), protected :: do_layering
    3131
    3232! Physical parameters
    33 logical(k4), protected :: impose_dust_ratio            ! Impose dust-to-ice ratio instead of dust tendency (see 'dust2ice_ratio')
    34 real(dp),    protected :: dust2ice_ratio               ! Dust-to-ice ratio when ice condenses (10% by default)
    35 real(dp),    protected :: d_dust                       ! Tendency of dust [kg.m-2.y-1]
    36 real(dp),    parameter :: dry_lag_porosity  = 0.2_dp   ! Porosity of dust lag
    37 real(dp),    parameter :: wet_lag_porosity  = 0.15_dp  ! Porosity of water ice lag
    38 real(dp),    parameter :: regolith_porosity = 0.4_dp   ! Porosity of regolith
    39 real(dp),    parameter :: breccia_porosity  = 0.1_dp   ! Porosity of breccia
    40 real(dp),    parameter :: co2ice_porosity   = 0.05_dp  ! Porosity of CO2 ice
    41 real(dp),    parameter :: h2oice_porosity   = 0.1_dp   ! Porosity of H2O ice
    42 real(dp),    parameter :: rho_dust          = 2500._dp ! Density of dust [kg.m-3]
    43 real(dp),    parameter :: rho_rock          = 3200._dp ! Density of rock [kg.m-3]
    44 real(dp),    parameter :: h_patchy_dust     = 5.e-4_dp ! Height under which a dust lag is considered patchy [m]
    45 real(dp),    parameter :: h_patchy_ice      = 5.e-4_dp ! Height under which a H2O ice lag is considered patchy [m]
     33logical(k4), protected, private :: impose_dust_ratio            ! Impose dust-to-ice ratio instead of dust tendency (see 'dust2ice_ratio')
     34real(dp),    protected, private :: dust2ice_ratio               ! Dust-to-ice ratio when ice condenses (10% by default)
     35real(dp),    protected, private :: d_dust                       ! Tendency of dust [kg.m-2.y-1]
     36real(dp),    parameter, private :: dry_lag_porosity  = 0.2_dp   ! Porosity of dust lag
     37real(dp),    parameter, private :: wet_lag_porosity  = 0.15_dp  ! Porosity of water ice lag
     38real(dp),    parameter, private :: regolith_porosity = 0.4_dp   ! Porosity of regolith
     39real(dp),    parameter, private :: breccia_porosity  = 0.1_dp   ! Porosity of breccia
     40real(dp),    parameter, private :: co2ice_porosity   = 0.05_dp  ! Porosity of CO2 ice
     41real(dp),    parameter, private :: h2oice_porosity   = 0.1_dp   ! Porosity of H2O ice
     42real(dp),    parameter, private :: rho_dust          = 2500._dp ! Density of dust [kg.m-3]
     43real(dp),    parameter, private :: rho_rock          = 3200._dp ! Density of rock [kg.m-3]
     44real(dp),    parameter, private :: h_patchy_dust     = 5.e-4_dp ! Height under which a dust lag is considered patchy [m]
     45real(dp),    parameter, private :: h_patchy_ice      = 5.e-4_dp ! Height under which a H2O ice lag is considered patchy [m]
    4646
    4747! Parameters for CO2 flux correction (inspired by Levrard et al. 2007)
    48 real(dp), parameter :: hmin_lag_co2 = 0.5_dp ! Minimal height of the lag deposit to reduce the sublimation rate [m]
    49 real(dp), parameter :: fred_sublco2 = 0.1_dp ! Reduction factor of sublimation rate
     48real(dp), parameter, private :: hmin_lag_co2 = 0.5_dp ! Minimal height of the lag deposit to reduce the sublimation rate [m]
     49real(dp), parameter, private :: fred_sublco2 = 0.1_dp ! Reduction factor of sublimation rate
    5050
    5151! DATA STRUCTURES
     
    9999! DEPENDENCIES
    100100! ------------
    101 use utility, only: real2str, bool2str
    102 use display, only: print_msg
     101use utility,  only: real2str, bool2str
     102use display,  only: print_msg, LVL_NFO
     103use stoppage, only: stop_clean
    103104
    104105! DECLARATION
     
    117118d_dust = d_dust_in
    118119dust2ice_ratio = dust2ice_ratio_in
    119 call print_msg('do_layering       = '//bool2str(do_layering))
    120 call print_msg('impose_dust_ratio = '//bool2str(impose_dust_ratio))
    121 call print_msg('d_dust            = '//real2str(d_dust))
    122 call print_msg('dust2ice_ratio    = '//real2str(dust2ice_ratio))
     120call print_msg('do_layering       = '//bool2str(do_layering),LVL_NFO)
     121call print_msg('impose_dust_ratio = '//bool2str(impose_dust_ratio),LVL_NFO)
     122call print_msg('d_dust            = '//real2str(d_dust),LVL_NFO)
     123call print_msg('dust2ice_ratio    = '//real2str(dust2ice_ratio),LVL_NFO)
     124if (dust2ice_ratio < 0._dp .or. dust2ice_ratio > 1._dp) call stop_clean(__FILE__,__LINE__,'''dust2ice_ratio'' outside admissible range [0.,1.]!',1)
    123125
    124126END SUBROUTINE set_layered_deposits_config
     
    144146! ------------
    145147use utility, only: real2str
    146 use display, only: print_msg
     148use display, only: print_msg, LVL_DBG
    147149
    148150! DECLARATION
     
    156158! CODE
    157159! ----
    158 call print_msg('Top elevation       [m]: '//real2str(this%top_elevation))
    159 call print_msg('Height of CO2 ice   [m]: '//real2str(this%h_co2ice))
    160 call print_msg('Height of H2O ice   [m]: '//real2str(this%h_h2oice))
    161 call print_msg('Height of dust      [m]: '//real2str(this%h_dust))
    162 call print_msg('Height of pores     [m]: '//real2str(this%h_pore))
    163 call print_msg('Pore-filled ice [m3/m3]: '//real2str(this%poreice_volfrac))
     160call print_msg('Top elevation       [m]: '//real2str(this%top_elevation),LVL_DBG)
     161call print_msg('Height of CO2 ice   [m]: '//real2str(this%h_co2ice),LVL_DBG)
     162call print_msg('Height of H2O ice   [m]: '//real2str(this%h_h2oice),LVL_DBG)
     163call print_msg('Height of dust      [m]: '//real2str(this%h_dust),LVL_DBG)
     164call print_msg('Height of pores     [m]: '//real2str(this%h_pore),LVL_DBG)
     165call print_msg('Pore-filled ice [m3/m3]: '//real2str(this%poreice_volfrac),LVL_DBG)
    164166
    165167END SUBROUTINE print_stratum
     
    529531! ------------
    530532use utility, only: int2str
    531 use display, only: print_msg
     533use display, only: print_msg, LVL_DBG
    532534
    533535! DECLARATION
     
    550552i = this%nb_str
    551553do while (associated(current))
    552     call print_msg('Stratum '//int2str(i))
     554    call print_msg('Stratum '//int2str(i),LVL_DBG)
    553555    call print_stratum(current)
    554     call print_msg('')
     556    call print_msg('',LVL_DBG)
    555557    current => current%down
    556558    i = i - 1
     
    822824! ------------
    823825use utility, only: int2str
    824 use display, only: print_msg
     826use display, only: print_msg, LVL_DBG
    825827
    826828! DEPENDENCIES
     
    843845! ----
    844846do ig = 1,ngrid
    845     call print_msg('Grid cell '//int2str(ig))
     847    call print_msg('Grid cell '//int2str(ig),LVL_DBG)
    846848    do islope = 1,nslope
    847         call print_msg('Slope number '//int2str(islope))
     849        call print_msg('Slope number '//int2str(islope),LVL_DBG)
    848850        call print_layering(this(ig,islope))
    849         call print_msg('~~~~~~~~~~')
     851        call print_msg('~~~~~~~~~~',LVL_DBG)
    850852    end do
    851     call print_msg('--------------------')
     853    call print_msg('--------------------',LVL_DBG)
    852854end do
    853855
     
    12471249use stoppage, only: stop_clean
    12481250use utility,  only: real2str
    1249 use display,  only: print_err
     1251use display,  only: print_msg, LVL_ERR
    12501252
    12511253! DECLARATION
     
    15611563
    15621564if (unexpected) then
    1563     call print_err('    dh_co2ice [m/y] = '//real2str(dh_co2ice))
    1564     call print_err('    dh_h2oice [m/y] = '//real2str(dh_h2oice))
    1565     call print_err('    dh_dust   [m/y] = '//real2str(dh_dust))
     1565    call print_msg('    dh_co2ice [m/y] = '//real2str(dh_co2ice),LVL_ERR)
     1566    call print_msg('    dh_h2oice [m/y] = '//real2str(dh_h2oice),LVL_ERR)
     1567    call print_msg('    dh_dust   [m/y] = '//real2str(dh_dust),LVL_ERR)
    15661568    call stop_clean(__FILE__,__LINE__,'situation for the layering construction not managed!',1)
    15671569end if
Note: See TracChangeset for help on using the changeset viewer.