Ignore:
Timestamp:
Dec 16, 2025, 4:39:24 PM (6 days ago)
Author:
jbclement
Message:

PEM:
Apply documentation template everywhere: standardized headers format with short description, separators between functions/subroutines, normalized code sections, aligned dependencies/arguments/variables declaration.
JBC

File:
1 edited

Legend:

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

    r3989 r3991  
    11MODULE tendencies
    2 
    3 implicit none
    4 
    5 !=======================================================================
     2!-----------------------------------------------------------------------
     3! NAME
     4!     tendencies
     5!
     6! DESCRIPTION
     7!     Computation and update of PEM ice evolution tendencies.
     8!
     9! AUTHORS & DATE
     10!     R. Vandemeulebrouck
     11!     L. Lange
     12!     JB Clement, 2023-2025
     13!
     14! NOTES
     15!
     16!-----------------------------------------------------------------------
     17
     18! DECLARATION
     19! -----------
     20implicit none
     21
    622contains
    7 !=======================================================================
     23!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    824
    925!=======================================================================
    1026SUBROUTINE compute_tend(ngrid,nslope,min_ice,d_ice)
    11 ! Compute the initial tendencies of the ice evolution based on the PCM data
    12 
    13 implicit none
    14 
    15 ! Arguments
     27!-----------------------------------------------------------------------
     28! NAME
     29!     compute_tend
     30!
     31! DESCRIPTION
     32!     Compute initial ice evolution tendencies from PCM data.
     33!
     34! AUTHORS & DATE
     35!     R. Vandemeulebrouck
     36!     L. Lange
     37!     JB Clement, 2023-2025
     38!
     39! NOTES
     40!     Based on minima of ice at each point for the PCM years.
     41!-----------------------------------------------------------------------
     42
     43! DECLARATION
     44! -----------
     45implicit none
     46
     47! ARGUMENTS
    1648! ---------
    17 integer,                         intent(in) :: ngrid   ! # of grid points
    18 integer,                         intent(in) :: nslope  ! # of subslopes
    19 real, dimension(ngrid,nslope,2), intent(in) :: min_ice ! Minima of ice at each point for the PCM years
    20 real, dimension(ngrid,nslope), intent(out) :: d_ice ! Difference between the minima = evolution of perennial ice
    21 
    22 ! Code
     49integer,                         intent(in)  :: ngrid
     50integer,                         intent(in)  :: nslope
     51real, dimension(ngrid,nslope,2), intent(in)  :: min_ice ! Minima of ice at each point for the PCM years
     52real, dimension(ngrid,nslope),   intent(out) :: d_ice   ! Evolution of perennial ice
     53
     54! CODE
    2355! ----
    2456! We compute the difference
     
    3769SUBROUTINE recomp_tend_co2(ngrid,nslope,timelen,d_co2ice_phys,d_co2ice_ini,co2ice,emissivity, &
    3870                           vmr_co2_PCM,vmr_co2_PEM,ps_PCM,ps_avg_global_ini,ps_avg_global)
    39 ! To compute the evolution of the tendency for co2 ice
    40 
     71!-----------------------------------------------------------------------
     72! NAME
     73!     recomp_tend_co2
     74!
     75! DESCRIPTION
     76!     Recompute CO2 ice tendency based on pressure and atmospheric changes.
     77!
     78! AUTHORS & DATE
     79!     L. Lange
     80!     JB Clement, 2023-2025
     81!
     82! NOTES
     83!     Adjusts CO2 ice evolution based on Clausius-Clapeyron changes.
     84!-----------------------------------------------------------------------
     85
     86! DEPENDENCIES
     87! ------------
    4188use constants_marspem_mod, only : alpha_clap_co2, beta_clap_co2, sigmaB, Lco2, sols_per_my, sec_per_sol
    4289
    43 implicit none
    44 
    45 ! Arguments
     90! DECLARATION
     91! -----------
     92implicit none
     93
     94! ARGUMENTS
    4695! ---------
    47 integer,                        intent(in) :: timelen, ngrid, nslope
    48 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PCM       ! physical point field: Volume mixing ratio of co2 in the first layer
    49 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PEM       ! physical point field: Volume mixing ratio of co2 in the first layer
    50 real, dimension(ngrid,timelen), intent(in) :: ps_PCM            ! physical point field: Surface pressure in the PCM
    51 real,                           intent(in) :: ps_avg_global_ini ! global averaged pressure at previous timestep
    52 real,                           intent(in) :: ps_avg_global     ! global averaged pressure at current timestep
    53 real, dimension(ngrid,nslope),  intent(in) :: d_co2ice_ini      ! physical point field: Evolution of perennial ice over one year
    54 real, dimension(ngrid,nslope),  intent(in) :: co2ice            ! CO2 ice per mesh and sub-grid slope (kg/m^2)
    55 real, dimension(ngrid,nslope),  intent(in) :: emissivity        ! Emissivity per mesh and sub-grid slope(1)
    56 real, dimension(ngrid,nslope), intent(inout) :: d_co2ice_phys ! physical point field: Evolution of perennial ice over one year
    57 
    58 ! Local variables
     96integer,                        intent(in)    :: timelen, ngrid, nslope ! Time length, # of grid points and slopes
     97real, dimension(ngrid,timelen), intent(in)    :: vmr_co2_PCM            ! CO2 VMR in PCM first layer
     98real, dimension(ngrid,timelen), intent(in)    :: vmr_co2_PEM            ! CO2 VMR in PEM first layer
     99real, dimension(ngrid,timelen), intent(in)    :: ps_PCM                 ! Surface pressure in PCM
     100real,                           intent(in)    :: ps_avg_global_ini      ! Global average pressure (initial)
     101real,                           intent(in)    :: ps_avg_global          ! Global average pressure (current)
     102real, dimension(ngrid,nslope),  intent(in)    :: d_co2ice_ini           ! Initial CO2 ice evolution
     103real, dimension(ngrid,nslope),  intent(in)    :: co2ice                 ! CO2 ice surface [kg/m^2]
     104real, dimension(ngrid,nslope),  intent(in)    :: emissivity             ! Emissivity
     105real, dimension(ngrid,nslope),  intent(inout) :: d_co2ice_phys          ! Updated CO2 ice evolution
     106
     107! LOCAL VARIABLES
    59108! ---------------
    60109integer :: i, t, islope
    61110real    :: coef, avg
    62111
    63 ! Code
     112! CODE
    64113! ----
    65114write(*,*) "> Updating the CO2 ice tendency for the new pressure"
     
    86135!=======================================================================
    87136SUBROUTINE recomp_tend_h2o(h2oice_depth_old,h2oice_depth_new,tsurf,tsoil_PEM_timeseries_old,tsoil_PEM_timeseries_new,d_h2oice)
    88 ! To compute the evolution of the tendency for h2o ice
    89 
     137!-----------------------------------------------------------------------
     138! NAME
     139!     recomp_tend_h2o
     140!
     141! DESCRIPTION
     142!     Recompute H2O ice tendency based on soil depth and temperature changes.
     143!
     144! AUTHORS & DATE
     145!     JB Clement, 2025 (following E. Vos's work)
     146!
     147! NOTES
     148!
     149!-----------------------------------------------------------------------
     150
     151! DEPENDENCIES
     152! ------------
    90153use soil_temp,      only: itp_tsoil
    91154use subsurface_ice, only: psv
    92155
    93 implicit none
    94 
    95 ! Arguments
     156! DECLARATION
     157! -----------
     158implicit none
     159
     160! ARGUMENTS
    96161! ---------
    97 real,                 intent(in) :: h2oice_depth_old, h2oice_depth_new, tsurf
    98 real, dimension(:,:), intent(in) :: tsoil_PEM_timeseries_old, tsoil_PEM_timeseries_new
    99 real, intent(inout) :: d_h2oice ! Evolution of perennial ice over one year
    100 
    101 ! Local variables
     162real,                 intent(in)    :: h2oice_depth_old ! Old H2O ice depth
     163real,                 intent(in)    :: h2oice_depth_new ! New H2O ice depth
     164real,                 intent(in)    :: tsurf            ! Surface temperature
     165real, dimension(:,:), intent(in)    :: tsoil_PEM_timeseries_old ! Old soil temperature time series
     166real, dimension(:,:), intent(in)    :: tsoil_PEM_timeseries_new ! New soil temperature time series
     167real,                 intent(inout) :: d_h2oice         ! Evolution of perennial ice
     168
     169! LOCAL VARIABLES
    102170! ---------------
    103171real            :: Rz_old, Rz_new, R_dec, hum_dec, psv_max_old, psv_max_new
     
    106174real, parameter :: zcdv = 0.0325     ! Drag coefficient
    107175
    108 ! Code
     176! CODE
    109177! ----
    110178! Higher resistance due to growing lag layer (higher depth)
Note: See TracChangeset for help on using the changeset viewer.