Ignore:
Timestamp:
Jul 7, 2025, 2:46:43 PM (5 months ago)
Author:
jbclement
Message:

COMMON:
Rework related to the command-line parsing:

  • Replace ad-hoc argument parsing with a unified 'parse_args' subroutine, allowing easier extension to other programs and options across models;;
  • Use of '--version' (with ab optional output file) to print compilation/version details;
  • Addition of 'job_timelimit_mod' module to handle SLURM/PBS job time-limit via '--jobid' (currently only used in the PEM), allowing easier extension to other programs;
  • Replace manual SSO handling with 'parse_args' for the Mars start2archive;
  • Clean-up related legacy code in the programs supporting the version option.

JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/dyn3d/gcm.F90

    r3615 r3836  
    3030  USE temps_mod, ONLY: calend,start_time,annee_ref,day_ref, &
    3131                itau_dyn,itau_phy,day_ini,jD_ref,jH_ref,day_end
    32   use version_info_mod, only: print_version_info
     32  use parse_args_mod, only: parse_args
    3333
    3434
     
    134134  character (len=20) :: modname
    135135  character (len=80) :: abort_message
    136   character(100)     :: arg ! To read command-line arguments
    137136  ! locales pour gestion du temps
    138137  INTEGER :: an, mois, jour
     
    144143!   Initialisations:
    145144!   ----------------
    146 
    147   if (command_argument_count() > 0) then ! Get the number of command-line arguments
    148       call get_command_argument(1,arg) ! Read the argument given to the program
    149       select case (trim(adjustl(arg)))
    150           case('version')
    151               call print_version_info()
    152               stop
    153           case default
    154               error stop "The argument given to the program is unknown!"
    155       end select
    156   endif
     145  ! Parse command-line options
     146  call parse_args()
    157147
    158148  abort_message = 'last timestep reached'
Note: See TracChangeset for help on using the changeset viewer.