Ignore:
Timestamp:
Dec 16, 2025, 4:39:24 PM (5 weeks 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/metamorphism.F90

    r3989 r3991  
    11MODULE metamorphism
    2 
    3 implicit none
    4 
     2!-----------------------------------------------------------------------
     3! NAME
     4!     metamorphism
     5!
     6! DESCRIPTION
     7!     Module for managing frost variables.
     8!
     9! AUTHORS & DATE
     10!     JB Clement, 12/2025
     11!
     12! NOTES
     13!
     14!-----------------------------------------------------------------------
     15
     16! DECLARATION
     17! -----------
     18implicit none
     19
     20! MODULE VARIABLES
     21! ----------------
    522! Different types of frost retained by the PEM to give back to the PCM at the end
    623real, dimension(:,:), allocatable :: h2o_frost4PCM
     
    1027integer :: iPCM_h2ofrost, iPCM_co2frost
    1128
    12 !=======================================================================
    1329contains
    14 !=======================================================================
    15 
     30!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     31
     32!=======================================================================
    1633SUBROUTINE ini_frost_id(nqtot,noms)
    17 
    18 implicit none
    19 
    20 ! Arguments
    21 !----------
     34!-----------------------------------------------------------------------
     35! NAME
     36!     ini_frost_id
     37!
     38! DESCRIPTION
     39!     Initialize frost indices from PCM variable names.
     40!
     41! AUTHORS & DATE
     42!     JB Clement, 12/2025
     43!
     44! NOTES
     45!
     46!-----------------------------------------------------------------------
     47
     48! DECLARATION
     49! -----------
     50implicit none
     51
     52! ARGUMENTS
     53! ---------
    2254integer,                        intent(in) :: nqtot
    2355character(*), dimension(nqtot), intent(in) :: noms
    2456
    25 ! Local variables
    26 !----------------
     57! LOCAL VARIABLES
     58! ---------------
    2759integer :: i
    2860
    29 ! Code
    30 !-----
     61! CODE
     62! ----
    3163! Initialization
    3264iPCM_h2ofrost = -1
     
    4678!=======================================================================
    4779
     80!=======================================================================
    4881SUBROUTINE compute_frost(ngrid,nslope,h2ofrost_PCM,min_h2ofrost,co2frost_PCM,min_co2frost)
    49 
    50 implicit none
    51 
    52 ! Arguments
    53 !----------
     82!-----------------------------------------------------------------------
     83! NAME
     84!     compute_frost
     85!
     86! DESCRIPTION
     87!     Compute the frost to give back to the PCM.
     88!
     89! AUTHORS & DATE
     90!     JB Clement, 12/2025
     91!
     92! NOTES
     93!     Frost for the PEM is the extra part of the PCM frost above the
     94!     yearly minimum.
     95!-----------------------------------------------------------------------
     96
     97! DECLARATION
     98! -----------
     99implicit none
     100
     101! ARGUMENTS
     102! ---------
    54103integer,                       intent(in) :: ngrid, nslope
    55104real, dimension(ngrid,nslope), intent(in) :: h2ofrost_PCM, min_h2ofrost, co2frost_PCM, min_co2frost
    56105
    57 ! Local variables
    58 !----------------
    59 
    60 ! Code
    61 !-----
     106! CODE
     107! ----
    62108write(*,*) '> Computing frost to give back to the PCM'
    63109
     
    76122!=======================================================================
    77123
     124!=======================================================================
    78125SUBROUTINE set_frost4PCM(PCMfrost)
    79 
    80 implicit none
    81 
    82 ! Arguments
    83 !----------
     126!-----------------------------------------------------------------------
     127! NAME
     128!     set_frost4PCM
     129!
     130! DESCRIPTION
     131!     Reconstruct frost for the PCM from PEM computations.
     132!
     133! AUTHORS & DATE
     134!     JB Clement, 12/2025
     135!
     136! NOTES
     137!
     138!-----------------------------------------------------------------------
     139
     140! DECLARATION
     141! -----------
     142implicit none
     143
     144! ARGUMENTS
     145! ---------
    84146real, dimension(:,:,:), intent(inout) :: PCMfrost
    85147
    86 ! Local variables
    87 !----------------
    88 
    89 ! Code
    90 !-----
     148! CODE
     149! ----
    91150write(*,*) '> Reconstructing frost for the PCM'
    92151PCMfrost(:,iPCM_h2ofrost,:) = h2o_frost4PCM(:,:)
     
    99158!=======================================================================
    100159
     160!=======================================================================
    101161SUBROUTINE ini_frost(ngrid,nslope)
    102 
    103 implicit none
    104 
    105 ! Arguments
    106 !----------
     162!-----------------------------------------------------------------------
     163! NAME
     164!     ini_frost
     165!
     166! DESCRIPTION
     167!     Initialize frost arrays.
     168!
     169! AUTHORS & DATE
     170!     JB Clement, 12/2025
     171!
     172! NOTES
     173!
     174!-----------------------------------------------------------------------
     175
     176! DECLARATION
     177! -----------
     178implicit none
     179
     180! ARGUMENTS
     181! ---------
    107182integer, intent(in) :: ngrid, nslope
    108183
    109 ! Local variables
    110 !----------------
    111 
    112 ! Code
    113 !-----
     184! CODE
     185! ----
    114186if (.not. allocated(h2o_frost4PCM)) allocate(h2o_frost4PCM(ngrid,nslope))
    115187if (.not. allocated(co2_frost4PCM)) allocate(co2_frost4PCM(ngrid,nslope))
     
    118190!=======================================================================
    119191
     192!=======================================================================
    120193SUBROUTINE end_frost()
    121 
    122 implicit none
    123 
    124 ! Arguments
    125 !----------
    126 
    127 ! Local variables
    128 !----------------
    129 
    130 ! Code
    131 !-----
     194!-----------------------------------------------------------------------
     195! NAME
     196!     end_frost
     197!
     198! DESCRIPTION
     199!     Deallocate frost arrays.
     200!
     201! AUTHORS & DATE
     202!     JB Clement, 12/2025
     203!
     204! NOTES
     205!
     206!-----------------------------------------------------------------------
     207
     208! DECLARATION
     209! -----------
     210implicit none
     211
     212! CODE
     213! ----
    132214if (allocated(h2o_frost4PCM)) deallocate(h2o_frost4PCM)
    133215if (allocated(co2_frost4PCM)) deallocate(co2_frost4PCM)
    134216
    135217END SUBROUTINE end_frost
     218!=======================================================================
    136219
    137220END MODULE metamorphism
Note: See TracChangeset for help on using the changeset viewer.