Ignore:
Timestamp:
Jul 7, 2025, 2:46:43 PM (4 weeks 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/dyn3dpar/gcm.F

    r3615 r3836  
    2727     &                       ecritstart
    2828      use cpdet_mod, only: ini_cpdet
    29       use version_info_mod, only: print_version_info
     29      use parse_args_mod, only: parse_args
    3030
    3131
     
    135135      character (len=20) :: modname
    136136      character (len=80) :: abort_message
    137       character(100)     :: arg ! To read command-line arguments
    138137! locales pour gestion du temps
    139138      INTEGER :: an, mois, jour
     
    158157c   Initialisations:
    159158c   ----------------
    160 
    161       if (command_argument_count() > 0) then ! Get the number of command-line arguments
    162           call get_command_argument(1,arg) ! Read the argument given to the program
    163           select case (trim(adjustl(arg)))
    164               case('version')
    165                   call print_version_info()
    166                   stop
    167               case default
    168                   error stop 'The argument given to the program is '
    169      &//'unknown!'
    170           end select
    171       endif
     159      ! Parse command-line options
     160      call parse_args()
    172161
    173162      abort_message = 'last timestep reached'
Note: See TracChangeset for help on using the changeset viewer.