Index: trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F
===================================================================
--- trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F	(revision 3604)
+++ trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F	(revision 3836)
@@ -61,5 +61,5 @@
      &             ini_paleoclimate_h, end_paleoclimate_h
       use subslope_mola_mod, ONLY: subslope_mola
-      use version_info_mod, only: print_version_info
+      use parse_args_mod, only: parse_args
       
       implicit none
@@ -213,15 +213,6 @@
 
 
-      if (command_argument_count() > 0) then ! Get the number of command-line arguments
-          call get_command_argument(1,txt) ! Read the argument given to the program
-          select case (trim(adjustl(txt)))
-              case('version')
-                  call print_version_info()
-                  stop
-              case default
-                  error stop 'The argument given to the program is '
-     &//'unknown!'
-          end select
-      endif
+      ! Parse command-line options
+      call parse_args()
 
 c sortie visu pour les champs dynamiques
Index: trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive.F
===================================================================
--- trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive.F	(revision 3604)
+++ trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive.F	(revision 3836)
@@ -41,5 +41,5 @@
       USE surfdat_h, ONLY: phisfi, albedodat, z0, z0_default,
      &    zmea, zstd, zsig, zgam, zthe, hmons, summit, base
-      use version_info_mod, only: print_version_info
+      use parse_args_mod, only: parse_args, add_sso_fields
 
       implicit none
@@ -117,6 +117,4 @@
       REAL baseS(ip1jmp1)
 
-      logical :: add_sso_fields=.false. ! default, don't include SSO fields
-
 
 c Variables intermediaires : vent naturel, mais pas coord scalaire
@@ -149,25 +147,7 @@
       INTEGER nid,nid1
 
-C get command line arguments
-C here we assume and check that if there is an argument #1 then
-C it should be --add-sso to signal adding SSO fileds to start_archive.nc
-      CALL get_command_argument(1,txt,j,ierr)
-      ! will return ierr==0 if there is an argument #1 to command line
-      IF (ierr==0) THEN
-        ! Check that argument is indeed "--add-sso" or signal the error
-        IF (trim(txt)=="--add-sso") THEN
-          add_sso_fields=.true.
-          write(*,*) "SSO fields will be included in start_archive"
-        ELSE IF (trim(txt) == 'version') then
-            call print_version_info()
-            stop
-        ELSE
-          write(*,*) "start2archive error: unexpected command line "//
-     &    "argument: ",trim(txt)
-          write(*,*) " (only --add-sso currently accepted)"
-          write(*,*) "Might as well stop here."
-          stop
-        ENDIF
-      ENDIF ! of IF (ierr==0)
+      ! Parse command-line options
+      ! Option "--add-sso" adds SSO fields to "start_archive.nc"
+      call parse_args()
 
 c-----------------------------------------------------------------------
