Ignore:
Timestamp:
Mar 17, 2026, 4:22:44 PM (34 hours ago)
Author:
jbclement
Message:

PEM:

  • Move ice table variables from "ice_table" to the main program.
  • Merge "job_id_mod" and "job_timelimit_mod" into "job" which is relocated to the PEM folder.
  • Rename local variables in procedures to avoid masking variables in parent scope.
  • Few cleanings to delete remaining PEM-external "include" and "use".

JBC

File:
1 edited

Legend:

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

    r4135 r4138  
    2828logical(k4), protected :: icetable_dynamic     ! Flag to compute the icetable depth according to the dynamic method
    2929
    30 ! VARIABLES
    31 ! ---------
    32 real(dp), allocatable, dimension(:,:)   :: icetable_depth     ! Depth of the ice table [m]
    33 real(dp), allocatable, dimension(:,:)   :: icetable_thickness ! Thickness of the ice table [m]
    34 real(dp), allocatable, dimension(:,:,:) :: ice_porefilling    ! Amount of porefilling in each layer in each grid [m^3/m^3]
    35 
    3630contains
    3731!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    38 
    39 !=======================================================================
    40 SUBROUTINE ini_ice_table()
    41 !-----------------------------------------------------------------------
    42 ! NAME
    43 !     ini_ice_table
    44 !
    45 ! DESCRIPTION
    46 !     Allocate module arrays for ice table fields.
    47 !
    48 ! AUTHORS & DATE
    49 !     L. Lange
    50 !     JB Clement, 2023-2025
    51 !
    52 ! NOTES
    53 !
    54 !-----------------------------------------------------------------------
    55 
    56 ! DEPENDENCIES
    57 ! ------------
    58 use geometry, only: ngrid, nslope, nsoil
    59 
    60 ! DECLARATION
    61 ! -----------
    62 implicit none
    63 
    64 ! CODE
    65 ! ----
    66 allocate(icetable_depth(ngrid,nslope))
    67 allocate(icetable_thickness(ngrid,nslope))
    68 allocate(ice_porefilling(ngrid,nsoil,nslope))
    69 icetable_depth(:,:) = 0._dp
    70 icetable_thickness(:,:) = 0._dp
    71 ice_porefilling(:,:,:) = 0._dp
    72 
    73 END SUBROUTINE ini_ice_table
    74 !=======================================================================
    75 
    76 !=======================================================================
    77 SUBROUTINE end_ice_table
    78 !-----------------------------------------------------------------------
    79 ! NAME
    80 !     end_ice_table
    81 !
    82 ! DESCRIPTION
    83 !     Deallocate ice table arrays.
    84 !
    85 ! AUTHORS & DATE
    86 !     L. Lange
    87 !     JB Clement, 2023-2025
    88 !
    89 ! NOTES
    90 !
    91 !-----------------------------------------------------------------------
    92 
    93 ! DECLARATION
    94 ! -----------
    95 implicit none
    96 
    97 ! CODE
    98 ! ----
    99 if (allocated(icetable_depth)) deallocate(icetable_depth)
    100 if (allocated(icetable_thickness)) deallocate(icetable_thickness)
    101 if (allocated(ice_porefilling)) deallocate(ice_porefilling)
    102 
    103 END SUBROUTINE end_ice_table
    104 !=======================================================================
    10532
    10633!=======================================================================
     
    256183
    257184!=======================================================================
    258 SUBROUTINE compute_deltam_icetable(icetable_thickness_old,ice_porefilling_old,tsurf,tsoil,delta_icetable)
     185SUBROUTINE compute_deltam_icetable(icetable_depth,icetable_thickness,ice_porefilling,icetable_thickness_old,ice_porefilling_old,tsurf,tsoil,delta_icetable)
    259186!-----------------------------------------------------------------------
    260187! NAME
     
    286213! ARGUMENTS
    287214! ---------
    288 real(dp),    dimension(:,:),   intent(in)  :: icetable_thickness_old   ! Ice table thickness at the previous iteration [m]
    289 real(dp),    dimension(:,:,:), intent(in)  :: ice_porefilling_old      ! Ice pore filling at the previous iteration [m]
    290 real(dp),    dimension(:,:),   intent(in)  :: tsurf                    ! Surface temperature [K]
    291 real(dp),    dimension(:,:,:), intent(in)  :: tsoil                    ! Soil temperature [K]
    292 real(dp),    dimension(:),     intent(out) :: delta_icetable ! Mass of H2O ice that has been condensed on the ice table / sublimates from the ice table [kg/m^2]
     215real(dp),    dimension(:,:),   intent(in)  :: icetable_depth         ! Ice table depth [m]
     216real(dp),    dimension(:,:),   intent(in)  :: icetable_thickness     ! Ice table thickness [m]
     217real(dp),    dimension(:,:,:), intent(in)  :: ice_porefilling        ! Ice pore filling [m]
     218real(dp),    dimension(:,:),   intent(in)  :: icetable_thickness_old ! Ice table thickness at the previous iteration [m]
     219real(dp),    dimension(:,:,:), intent(in)  :: ice_porefilling_old    ! Ice pore filling at the previous iteration [m]
     220real(dp),    dimension(:,:),   intent(in)  :: tsurf                  ! Surface temperature [K]
     221real(dp),    dimension(:,:,:), intent(in)  :: tsoil                  ! Soil temperature [K]
     222real(dp),    dimension(:),     intent(out) :: delta_icetable         ! Mass of H2O ice that has been condensed on the ice table / sublimates from the ice table [kg/m^2]
    293223
    294224! LOCAL VARIABLES
     
    674604
    675605! Mass of H2O exchange between the ssi and the atmosphere
    676 call compute_deltam_icetable(icetable_thickness_old,ice_porefilling_old,tsurf_avg,tsoil_avg,delta_icetable)
     606call compute_deltam_icetable(icetable_depth,icetable_thickness,ice_porefilling,icetable_thickness_old,ice_porefilling_old,tsurf_avg,tsoil_avg,delta_icetable)
    677607
    678608END SUBROUTINE evolve_ice_table
Note: See TracChangeset for help on using the changeset viewer.