Changeset 3574 for trunk/LMDZ.MARS/libf


Ignore:
Timestamp:
Jan 13, 2025, 4:52:20 PM (5 months ago)
Author:
jbclement
Message:

COMMON:
The compilation generates a Fortran subroutine to track compilation and version (SVN or Git) details through the executable file. Put the argument 'version' as an option when executing the code to display these information and create a file "version_diff.txt" containing the diff result.
It can work with every program but it has been implemented only for: 'gcm', 'parallel gcm', 'pem', '1D Mars PCM', 'Mars newstart', 'Mars start2archive' and '1D Generic PCM'.
JBC

Location:
trunk/LMDZ.MARS/libf
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F

    r3336 r3574  
    6161     &             ini_paleoclimate_h, end_paleoclimate_h
    6262      use subslope_mola_mod, ONLY: subslope_mola
     63      use version_info_mod, only: print_version_info
    6364     
    6465      implicit none
     
    8182c et autres:
    8283c----------
     84      character(100) :: arg ! To read command-line arguments
    8385
    8486c Variables pour les lectures NetCDF des fichiers "start_archive"
     
    211213
    212214
     215
     216if (command_argument_count() > 0) then ! Get the number of command-line arguments
     217    call get_command_argument(1,arg) ! Read the argument given to the program
     218    select case (trim(adjustl(arg)))
     219        case('version')
     220            call print_version_info()
     221            stop
     222        case default
     223            error stop 'The argument given to the program is unknown!'
     224    end select
     225endif
    213226
    214227c sortie visu pour les champs dynamiques
  • TabularUnified trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive.F

    r3491 r3574  
    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
     44
    4345      implicit none
    4446
     
    141143      integer :: nq,numvanle
    142144      character(len=30) :: txt ! to store some text
     145      character(100) :: arg ! To read command-line arguments
    143146
    144147c Netcdf
     
    150153C here we assume and check that if there is an argument #1 then
    151154C it should be --add-sso to signal adding SSO fileds to start_archive.nc
    152 
    153155      CALL get_command_argument(1,txt,j,ierr)
    154156      ! will return ierr==0 if there is an argument #1 to command line
     
    158160          add_sso_fields=.true.
    159161          write(*,*) "SSO fields will be included in start_archive"
     162        ELSE IF (trim(txt) == 'version') then
     163            call print_version_info()
     164            stop
    160165        ELSE
    161166          write(*,*) "start2archive error: unexpected command line "//
  • TabularUnified trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90

    r3400 r3574  
    2121use mod_const_mpi,       only: init_const_mpi
    2222use parallel_lmdz,       only: init_parallel
     23use version_info_mod,    only: print_version_info
    2324
    2425implicit none
     
    7778real, dimension(:,:,:), allocatable :: q             ! tracer mixing ratio (e.g. kg/kg)
    7879real, dimension(1)                  :: wstar = 0.    ! Thermals vertical velocity
     80character(100)                      :: arg           ! To read command-line arguments
    7981
    8082! Physical and dynamical tendencies (e.g. m.s-2, K/s, Pa/s)
     
    100102! INITIALISATION
    101103!=======================================================================
     104if (command_argument_count() > 0) then ! Get the number of command-line arguments
     105    call get_command_argument(1,arg) ! Read the argument given to the program
     106    select case (trim(adjustl(arg)))
     107        case('version')
     108            call print_version_info()
     109            stop
     110        case default
     111            error stop 'The argument given to the program is unknown!'
     112    end select
     113endif
     114
    102115#ifdef CPP_XIOS
    103116    call init_const_mpi
Note: See TracChangeset for help on using the changeset viewer.