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.MARS/libf/dynphy_lonlat/phymars/start2archive.F

    r3576 r3836  
    4141      USE surfdat_h, ONLY: phisfi, albedodat, z0, z0_default,
    4242     &    zmea, zstd, zsig, zgam, zthe, hmons, summit, base
    43       use version_info_mod, only: print_version_info
     43      use parse_args_mod, only: parse_args, add_sso_fields
    4444
    4545      implicit none
     
    117117      REAL baseS(ip1jmp1)
    118118
    119       logical :: add_sso_fields=.false. ! default, don't include SSO fields
    120 
    121119
    122120c Variables intermediaires : vent naturel, mais pas coord scalaire
     
    149147      INTEGER nid,nid1
    150148
    151 C get command line arguments
    152 C here we assume and check that if there is an argument #1 then
    153 C it should be --add-sso to signal adding SSO fileds to start_archive.nc
    154       CALL get_command_argument(1,txt,j,ierr)
    155       ! will return ierr==0 if there is an argument #1 to command line
    156       IF (ierr==0) THEN
    157         ! Check that argument is indeed "--add-sso" or signal the error
    158         IF (trim(txt)=="--add-sso") THEN
    159           add_sso_fields=.true.
    160           write(*,*) "SSO fields will be included in start_archive"
    161         ELSE IF (trim(txt) == 'version') then
    162             call print_version_info()
    163             stop
    164         ELSE
    165           write(*,*) "start2archive error: unexpected command line "//
    166      &    "argument: ",trim(txt)
    167           write(*,*) " (only --add-sso currently accepted)"
    168           write(*,*) "Might as well stop here."
    169           stop
    170         ENDIF
    171       ENDIF ! of IF (ierr==0)
     149      ! Parse command-line options
     150      ! Option "--add-sso" adds SSO fields to "start_archive.nc"
     151      call parse_args()
    172152
    173153c-----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.