Index: /trunk/LMDZ.COMMON/libf/evolution/pem.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/pem.F90	(revision 3577)
+++ /trunk/LMDZ.COMMON/libf/evolution/pem.F90	(revision 3578)
@@ -71,4 +71,5 @@
 use layering_mod,               only: d_dust, ptrarray, stratum, layering, ini_layering, del_layering, make_layering, get_nb_str_max, nb_str_max, layering_algo
 use dyn_ss_ice_m_mod,           only: dyn_ss_ice_m
+use version_info_mod,           only: print_version_info
 
 #ifndef CPP_STD
Index: /trunk/LMDZ.COMMON/makelmdz_fcm
===================================================================
--- /trunk/LMDZ.COMMON/makelmdz_fcm	(revision 3577)
+++ /trunk/LMDZ.COMMON/makelmdz_fcm	(revision 3578)
@@ -603,5 +603,5 @@
 
 # Path and name of the file containing the difference result
-diff_file="version_diff.txt"
+res_file="version_stat-diff.txt"
 
 # Get the current date
@@ -611,4 +611,5 @@
 vcs_info=""
 vcs_diff=""
+vcs_status=""
 for dir in "$LMDGCM/.."/*; do
     # Skip if it is not a directory or the name contains "git" or "svn"
@@ -618,11 +619,13 @@
     # Determine the version control system for each subdirectory
     if command -v svn > /dev/null && svn info "$dir" > /dev/null 2>&1; then # SVN
-        vcs_info+="\n=== SVN Information for $dir ===\n$(svn info "$dir")\n"
-        vcs_diff+="\n=== SVN Diff for $dir ===\n$(svn diff "$dir")\n"
+        vcs_info+="\n=== SVN Information for $(basename "$dir") ===\n$(svn info "$dir")\n"
+        vcs_diff+="\n=== SVN Diff for $(basename "$dir") ===\n$(svn diff "$dir")\n"
+        vcs_status+="\n=== SVN Status for $(basename "$dir") ===\n$(svn status "$dir")\n"
     elif command -v git > /dev/null && git -C "$dir" rev-parse --is-inside-work-tree > /dev/null 2>&1; then # Git
-        vcs_info+="\n=== Git Information for $dir ===\n$(git -C "$dir" log -1 --pretty=format:"%H%n%an%n%ad%n%s")\n"
-        vcs_diff+="\n=== Git Diff for $dir ===\n$(git -C "$dir" diff)\n"
+        vcs_info+="=== Git Information for $(basename "$dir") ===\n$(git -C "$dir" log -1 --pretty=format:"%H%n%an%n%ad%n%s")\n"
+        vcs_diff+="\n=== Git Diff for $(basename "$dir") ===\n$(git -C "$dir" diff)\n"
+        vcs_status+="\n=== Git Status for $(basename "$dir") ===\n$(git -C "$dir" status --short)\n"
     else # None
-        vcs_info+="\n=== No version control system for $dir ===\n"
+        vcs_info+="\n=== No version control system for $(basename "$dir") ===\n"
     fi
 done
@@ -635,6 +638,6 @@
 ! DESCRIPTION:
 !    The subroutine 'print_version_info' prints compilation details, the
-!    version control information (SVN or Git) and the diff result if
-!    applicable.
+!    version control information (SVN or Git), the status and the diff
+!    result if applicable.
 !
 ! PARAMETERS:
@@ -655,30 +658,43 @@
 SUBROUTINE print_version_info()
 
-    write(*,'(A)') '======= Compilation details ======='
-    write(*,'(A)') 'Date: ${current_date}'
-    write(*,'(A)') 'Command: ${compilation_command}'
-    write(*,*)
+write(*,'(a)') '======= Compilation details ======='
+write(*,'(a)') '> Date: ${current_date}'
+write(*,'(a)') '> Command: ${compilation_command}'
+write(*,*)
 EOF
 
 if [ -n "$vcs_info" ]; then
-    echo "    write(*,'(A)') '=== Version Control Information ==='" >> "$info_file"
+    echo "write(*,'(a)') '=== Version Control Information ==='" >> "$info_file"
     while IFS= read -r line; do
-        echo "    write(*,'(A)') '${line//\'/\'\'}'" >> "$info_file"
+        echo "write(*,'(a)') '${line//\'/\'\'}'" >> "$info_file"
     done <<< "$(echo -e "$vcs_info")"
+else
+    echo "write(*,'(a)') '=== No version control system ==='" >> "$info_file"
+fi
+
+if [ -n "$vcs_status" ]; then
+    echo "write(*,*)" >> "$info_file"
+    echo "write(*,'(a)') '=== Version Control Status ==='" >> "$info_file"
+    echo "write(*,'(a)') '> Writing status result to the file \"${res_file}\".'" >> "$info_file"
+    echo "open(unit = 1, file = \"${res_file}\",status = 'replace',action = 'write')" >> "$info_file"
+    while IFS= read -r line; do
+        echo "write(1,'(a)') '${line//\'/\'\'}'" >> "$info_file"
+    done <<< "$(echo -e "$vcs_status")"
+    echo "close(1)" >> "$info_file"
 fi
 
 if [ -n "$vcs_diff" ]; then
-    echo "    write(*,*)" >> "$info_file"
-    echo "    write(*,'(A)') '====== Version Control Diff ======='" >> "$info_file"
-    echo "    write(*,'(A)') 'Writing diff to file: ${diff_file}'" >> "$info_file"
-    echo "    open(unit = 1, file = \"${diff_file}\", status = 'replace', action = 'write')" >> "$info_file"
+    echo "write(*,*)" >> "$info_file"
+    echo "write(*,'(a)') '====== Version Control Diff ======='" >> "$info_file"
+    echo "write(*,'(a)') '> Writing diff result to the file \"${res_file}\".'" >> "$info_file"
+    echo "open(unit = 1, file = \"${res_file}\",status = 'unknown',position = 'append',action = 'write')" >> "$info_file"
     while IFS= read -r line; do
-        echo "    write(1,'(A)') '${line//\'/\'\'}'" >> "$info_file"
+        echo "write(1,'(a)') '${line//\'/\'\'}'" >> "$info_file"
     done <<< "$(echo -e "$vcs_diff")"
-    echo "    close(1)" >> "$info_file"
+    echo "close(1)" >> "$info_file"
 fi
 
 cat << EOF >> "$info_file"
-    write(*,'(A)') '==================================='
+write(*,'(a)') '==================================='
 
 END SUBROUTINE print_version_info
@@ -688,5 +704,5 @@
 
 # Termination message
-echo "'$info_file' has been successfully generated."
+echo "'$info_file' has been generated successfully."
 
 
