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

Location:
trunk/LMDZ.GENERIC/libf/phystd/dyn1d
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/kcm1d.F90

    r3716 r3836  
    2222  use dimphy, only : init_dimphy
    2323  use gases_h, only: ngasmx
    24   use version_info_mod, only: print_version_info
     24  use parse_args_mod, only: parse_args
    2525
    2626  implicit none
     
    111111  integer :: k
    112112
    113   character(100) :: arg ! To read command-line arguments
    114113 
    115114  ! --------------
    116115  ! Initialisation
    117116  ! --------------
    118   if (command_argument_count() > 0) then ! Get the number of command-line arguments
    119       call get_command_argument(1,arg) ! Read the argument given to the program
    120       select case (trim(adjustl(arg)))
    121           case('version')
    122               call print_version_info()
    123               stop
    124           case default
    125               error stop 'The argument given to the program is unknown!'
    126       end select
    127   endif
     117  ! Parse command-line options
     118  call parse_args()
    128119
    129120  pi=2.E+0*asin(1.E+0)
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F

    r3788 r3836  
    4343     &                  nf90_strerror,NF90_INQ_VARID, NF90_GET_VAR,
    4444     &                  NF90_CLOSE
    45       use version_info_mod, only: print_version_info
     45      use parse_args_mod, only: parse_args
    4646      !use inichim_1D_mod, only: inichim_1D
    4747      !use initracer_1D_mod, only: initracer_1D
     
    169169c INITIALISATION
    170170c=======================================================================
    171       if (command_argument_count() > 0) then ! Get the number of command-line arguments
    172           call get_command_argument(1,txt) ! Read the argument given to the program
    173           select case (trim(adjustl(txt)))
    174               case('version')
    175                   call print_version_info()
    176                   stop
    177               case default
    178                   error stop 'The argument given to the program is '
    179      &//'unknown!'
    180           end select
    181       endif
     171      ! Parse command-line options
     172      call parse_args()
    182173
    183174! check if 'rcm1d.def' file is around
Note: See TracChangeset for help on using the changeset viewer.