Ignore:
Timestamp:
Dec 11, 2025, 12:56:05 PM (5 weeks ago)
Author:
jbclement
Message:

PEM:
Massive structural refactor of the PEM codebase for improved readability, consistency and maintainability. The goal is to modernize, standardize and consolidate the code while removing legacy complexity. In detail, this change:

  • Performs large-scale cleanup removing unused code, obsolete routines, duplicated functionality and deprecated initialization logic;
  • Removes "*_mod" wrappers;
  • Replaces mixed naming conventions with clearer variable names, domain-based file/module names and purpose-based routine names;
  • Adds native reading/writing capabilities to the PEM removing the cumbersome dependency on Mars PCM subroutines;
  • Centralizes soil/ice/orbital/PEM configuration logic into dedicated modules;
  • Simplifies routines and updates calls/interfaces to match the new structure.

This refactor significantly clarifies the codebase and provides a cleaner foundation for forthcoming developments.
JBC

File:
1 moved

Legend:

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

    r3988 r3989  
    1 MODULE abort_pem_mod
     1MODULE stop_pem
    22
    33implicit none
     
    77!=======================================================================
    88
    9 SUBROUTINE abort_pem(modname,message,ierr)
     9!=======================================================================
     10SUBROUTINE stop_clean(modname,message,ierr)
     11! Stop the simulation cleanly, closing files and printing various comments
     12! Inputs: modname = name of calling program
     13!         message = stuff to print
     14!         ierr    = severity of situation (= 0 normal)
    1015
    1116#ifdef CPP_IOIPSL
    1217    use IOIPSL
    1318#else
    14     ! if not using IOIPSL, we still need to use (a local version of) getin_dump
     19    ! If not using IOIPSL, we still need to use (a local version of) getin_dump
    1520    use ioipsl_getincom
    1621#endif
    1722
    1823#ifdef CPP_XIOS
    19     use wxios ! ug Pour les sorties XIOS
     24    use wxios ! For XIOS outputs
    2025#endif
    2126
     
    2429#include "iniprint.h"
    2530
    26 ! Stop the simulation cleanly, closing files and printing various comments
    27 ! Input: modname = name of calling program
    28 !        message = stuff to print
    29 !        ierr    = severity of situation (= 0 normal)
    30 character(len = *), intent(in) :: modname
    31 integer,            intent(in) :: ierr
    32 character(len = *), intent(in) :: message
     31! Arguments
     32!----------
     33character(*), intent(in) :: modname
     34integer,      intent(in) :: ierr
     35character(*), intent(in) :: message
    3336
    34 !----- Code
    35 write(lunout,*) 'in abort_pem'
    36 
     37! Code
     38!-----
    3739#ifdef CPP_XIOS
    38     CALL wxios_close() ! Fermeture propre de XIOS
     40    CALL wxios_close() ! Closing XIOS properly
    3941#endif
    4042
    4143#ifdef CPP_IOIPSL
    42     call histclo
    43     call restclo
     44    call histclo()
     45    call restclo()
    4446#endif
    4547
    46 call getin_dump
    47 write(lunout,*) 'Stopping in ', modname
     48call getin_dump()
     49write(lunout,*) 'stop_pem: stopping in ', modname
    4850write(lunout,*) 'Reason = ', message
    4951if (ierr == 0) then
    5052    write(lunout,*) 'Everything is cool!'
    51     stop
     53    error stop
    5254else
    53     write(lunout,*) 'Houston, we have a problem, ierr =', ierr
    54     stop 1
     55    write(lunout,*) 'Houston, we have a problem! ierr =', ierr
     56    error stop 1
    5557endif
    5658
    57 END SUBROUTINE abort_pem
     59END SUBROUTINE stop_clean
     60!=======================================================================
    5861
    59 END MODULE abort_pem_mod
     62END MODULE stop_pem
Note: See TracChangeset for help on using the changeset viewer.