Ignore:
Timestamp:
Jul 4, 2025, 12:06:05 PM (8 weeks ago)
Author:
jbclement
Message:

COMMON:
Gathering all the outputs provided by the argument 'version' when executing the code into the file "pgrm_version_details.txt" (previously named "version_stat-diff.txt").
JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/makelmdz_fcm

    r3796 r3830  
    606606
    607607# Path and name of the file containing the difference result
    608 res_file="version_stat-diff.txt"
     608res_file="pgrm_version_details.txt"
    609609
    610610# Get the current date
     
    679679SUBROUTINE print_version_info()
    680680
    681 write(*,'(a)') '======= Compilation details ======='
    682 write(*,'(a)') '-> Date: ${current_date}'
    683 write(*,'(a)') '-> Command: ${compilation_command}'
    684 write(*,*)
     681integer, parameter :: io_unit = 10
     682
     683open(io_unit, file = '${res_file}',status = 'replace',action = 'write')
     684
     685write(*,'(a)') '-> Writing compilation details to the file "${res_file}".'
     686write(io_unit,'(a)') '========================= COMPILATION DETAILS =========================='
     687write(io_unit,'(a)') '-> Date: ${current_date}'
     688write(io_unit,'(a)') '-> Command: ${compilation_command}'
     689write(io_unit,*)
    685690EOF
    686691
    687692if [ -n "$vcs_info" ]; then
    688     echo "write(*,'(a)') '=== Version Control Information ==='" >> "$info_file"
     693    echo "write(*,'(a)') '-> Writing information result to the file \"${res_file}\".'" >> "$info_file"
     694    echo "write(io_unit,'(a)') '===================== VERSION CONTROL INFORMATION ======================'" >> "$info_file"
    689695    while IFS= read -r line; do
    690         echo "write(*,'(a)') '${line}'" >> "$info_file"
     696        echo "write(io_unit,'(a)') '${line}'" >> "$info_file"
    691697    done <<< "$(echo -e "$vcs_info")"
    692698else
    693     echo "write(*,'(a)') '==== No version control system ===='" >> "$info_file"
     699    echo "write(io_unit,'(a)') '====================== NO VERSION CONTROL SYSTEM ======================='" >> "$info_file"
    694700fi
    695701
    696702if [ -n "$vcs_stat" ]; then
    697     echo "write(*,*)" >> "$info_file"
    698     echo "write(*,'(a)') '====== Version Control Status ====='" >> "$info_file"
    699703    echo "write(*,'(a)') '-> Writing status result to the file \"${res_file}\".'" >> "$info_file"
    700     echo "open(unit = 1, file = \"${res_file}\",status = 'replace',action = 'write')" >> "$info_file"
     704    echo "write(io_unit,*)" >> "$info_file"
     705    echo "write(io_unit,'(a)') '======================== VERSION CONTROL STATUS ========================'" >> "$info_file"
    701706    while IFS= read -r line; do
    702         echo "write(1,'(a)') '${line}'" >> "$info_file"
     707        echo "write(io_unit,'(a)') '${line}'" >> "$info_file"
    703708    done <<< "$(echo -e "$vcs_stat")"
    704     echo "close(1)" >> "$info_file"
    705709fi
    706710
    707711if [ -n "$vcs_diff" ]; then
    708     echo "write(*,*)" >> "$info_file"
    709     echo "write(*,'(a)') '====== Version Control Diff ======='" >> "$info_file"
    710712    echo "write(*,'(a)') '-> Writing diff result to the file \"${res_file}\".'" >> "$info_file"
    711     echo "open(unit = 1, file = \"${res_file}\",status = 'unknown',position = 'append',action = 'write')" >> "$info_file"
     713    echo "write(io_unit,*)" >> "$info_file"
     714    echo "write(io_unit,'(a)') '========================= VERSION CONTROL DIFF ========================='" >> "$info_file"
    712715    while IFS= read -r line; do
    713         echo "write(1,'(a)') '${line}'" >> "$info_file"
     716        echo "write(io_unit,'(a)') '${line}'" >> "$info_file"
    714717    done <<< "$(echo -e "$vcs_diff")"
    715     echo "close(1)" >> "$info_file"
    716718fi
    717719
    718720cat << EOF >> "$info_file"
    719 write(*,'(a)') '==================================='
     721write(io_unit,'(a)') '========================================================================'
     722
     723close(io_unit)
    720724
    721725END SUBROUTINE print_version_info
Note: See TracChangeset for help on using the changeset viewer.