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

    r3989 r3991  
    11MODULE surf_temp
    2 
     2!-----------------------------------------------------------------------
     3! NAME
     4!     surf_temp
     5!
     6! DESCRIPTION
     7!     Surface temperature management.
     8!
     9! AUTHORS & DATE
     10!     JB Clement, 2025
     11!
     12! NOTES
     13!
     14!-----------------------------------------------------------------------
     15
     16! DECLARATION
     17! -----------
    318implicit none
    419
    5 !=======================================================================
    620contains
    7 !=======================================================================
     21!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    822
    923!=======================================================================
    1024SUBROUTINE update_tsurf_nearest_baresoil(ngrid,nslope,nlon,nlat,latitude,tsurf_avg,co2_ice,is_co2ice_ini,co2ice_disappeared)
    11 
     25!-----------------------------------------------------------------------
     26! NAME
     27!     update_tsurf_nearest_baresoil
     28!
     29! DESCRIPTION
     30!     Update surface temperature where CO2 ice disappeared using nearby
     31!     bare soil temperature.
     32!
     33! AUTHORS & DATE
     34!     JB Clement, 2025
     35!
     36! NOTES
     37!
     38!-----------------------------------------------------------------------
     39
     40! DEPENDENCIES
     41! ------------
    1242use grid_conversion, only: vect2lonlat, lonlat2vect
    1343
     44! DECLARATION
     45! -----------
    1446implicit none
    1547
    16 ! Inputs:
    17 integer,                          intent(in) :: nlon, nlat, nslope, ngrid
    18 real,    dimension(ngrid,nslope), intent(in) :: co2_ice
    19 real,    dimension(ngrid),        intent(in) :: latitude
    20 logical, dimension(ngrid,nslope), intent(in) :: is_co2ice_ini
    21 ! Outputs:
    22 real,    dimension(ngrid,nslope), intent(inout) :: tsurf_avg
    23 logical, dimension(ngrid,nslope), intent(inout) :: co2ice_disappeared
    24 ! Local variables:
    25 real, parameter                   :: eps = 1.e-10
    26 integer                           :: islope, i, j, k, radius, rmax, di, dj, ii, jj
    27 logical                           :: found
    28 real, dimension(nlon,nlat,nslope) :: tsurf_ll, co2ice_ll, mask_co2ice_ini, co2ice_disappeared_ll
    29 real, dimension(nlon,nlat)        :: latitude_ll
    30 real, dimension(ngrid)            :: tmp
    31 integer, dimension(nslope - 1)    :: priority
    32 
     48! ARGUMENTS
     49! ---------
     50integer,                          intent(in)    :: nlon, nlat, nslope, ngrid ! Grid dimensions
     51real,    dimension(ngrid,nslope), intent(in)    :: co2_ice                   ! CO2 ice density
     52real,    dimension(ngrid),        intent(in)    :: latitude                  ! Latitude
     53logical, dimension(ngrid,nslope), intent(in)    :: is_co2ice_ini             ! Initial CO2 ice flag
     54real,    dimension(ngrid,nslope), intent(inout) :: tsurf_avg                 ! Average surface temperature
     55logical, dimension(ngrid,nslope), intent(inout) :: co2ice_disappeared        ! Ice disappeared flag
     56
     57! LOCAL VARIABLES
     58! ---------------
     59real, parameter                      :: eps = 1.e-10
     60integer                              :: islope, i, j, k, radius, rmax, di, dj, ii, jj
     61logical                              :: found
     62real,    dimension(nlon,nlat,nslope) :: tsurf_ll, co2ice_ll, mask_co2ice_ini, co2ice_disappeared_ll
     63real,    dimension(nlon,nlat)        :: latitude_ll
     64real,    dimension(ngrid)            :: tmp
     65integer, dimension(nslope - 1)       :: priority
     66
     67! CODE
     68! ----
    3369! Check to escape the subroutine (not relevant in 1D)
    3470if (ngrid == 1) return
     
    110146!=======================================================================
    111147SUBROUTINE get_slope_priority(lat,nslope,islope,priority)
    112 ! Priority given to equator-ward slope which are most likely to hold no ice
    113 
     148!-----------------------------------------------------------------------
     149! NAME
     150!     get_slope_priority
     151!
     152! DESCRIPTION
     153!     Determine slope priority based on latitude (equator-ward favored).
     154!
     155! AUTHORS & DATE
     156!     JB Clement, 2025
     157!
     158! NOTES
     159!     Equator-ward slopes are most likely to hold no ice.
     160!-----------------------------------------------------------------------
     161
     162! DECLARATION
     163! -----------
    114164implicit none
    115165
    116 ! Inputs:
    117 real,    intent(in) :: lat
    118 integer, intent(in) :: nslope, islope
    119 ! Outputs:
    120 integer, dimension(nslope - 1), intent(out) :: priority
    121 ! Locals:
     166! ARGUMENTS
     167! ---------
     168real,                           intent(in)  :: lat      ! Latitude [degrees]
     169integer,                        intent(in)  :: nslope, islope
     170integer, dimension(nslope - 1), intent(out) :: priority ! Priority ordering of slopes
     171
     172! LOCAL VARIABLES
     173! ---------------
    122174integer :: i, k
    123175
    124 ! Code
    125 !-----
     176! CODE
     177! ----
    126178k = 1
    127179
Note: See TracChangeset for help on using the changeset viewer.