Index: trunk/LMDZ.COMMON/makelmdz_fcm
===================================================================
--- trunk/LMDZ.COMMON/makelmdz_fcm	(revision 3792)
+++ trunk/LMDZ.COMMON/makelmdz_fcm	(revision 3796)
@@ -599,4 +599,7 @@
 ########################################################################
 
+# Path to the root directory where we want to check version control system
+root_dir="$LMDGCM/.."
+
 # Path and name of the generated file
 info_file="$LIBFGCM/misc/version_info.F90"
@@ -609,7 +612,7 @@
 
 # Function to process problematic characters
-#     Convert input to UTF-8 and ignore invalid characters
-#     Remove carriage return characters to prevent formatting issues
-#     Escape backslashes and single quotes
+#   - Convert input to UTF-8 and ignore invalid characters
+#   - Remove carriage return characters to prevent formatting issues
+#   - Escape backslashes and single quotes
 clean_output() {
     iconv -f "$(locale charmap)" -t UTF-8//IGNORE \
@@ -618,26 +621,34 @@
 }
 
-# Iterate through subdirectories in $LMDGCM/../ to determine version control system
 vcs_info=""
 vcs_diff=""
 vcs_stat=""
-for dir in "$LMDGCM/.."/*; do
-    # Skip if it is not a directory or the name contains "git" or "svn"
-    [ -d "$dir" ] || continue
-    [[ "$dir" == *git* || "$dir" == *svn* ]] && continue
-
-    # 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 \"$(basename "$dir")\"\n$(svn info "$dir" | clean_output)\n"
-        vcs_diff+="\n-> SVN Diff for \"$(basename "$dir")\"\n$(svn diff "$dir" | clean_output)\n"
-        vcs_stat+="\n-> SVN Status for \"$(basename "$dir")\"\n$(svn status "$dir" | clean_output)\n"
-    elif command -v git > /dev/null && git -C "$dir" rev-parse --is-inside-work-tree > /dev/null 2>&1; then # Git
-        vcs_info+="-> Git Information for \"$(basename "$dir")\"\n$(git -C "$dir" log -1 --pretty=format:"%H%n%an%n%ad%n%s" | clean_output)\n"
-        vcs_diff+="\n-> Git Diff for \"$(basename "$dir")\"\n$(git -C "$dir" diff | clean_output)\n"
-        vcs_stat+="\n-> Git Status for \"$(basename "$dir")\"\n$(git -C "$dir" status --short | clean_output)\n"
-    else # None
-        vcs_info+="\n-> No version control system for \"$(basename "$dir")\"\n"
-    fi
-done
+# Check if there is a Git repository at the root
+if command -v git > /dev/null 2>&1 && git -C "$root_dir" rev-parse --is-inside-work-tree > /dev/null 2>&1; then
+    dir_name="$(basename "$root_dir")"
+    vcs_info+="-> Git Information for \"$dir_name\"\n$(git -C "$root_dir" log -1 --pretty=format:"%H%n%an%n%ad%n%s" | clean_output)\n"
+    vcs_stat+="-> Git Status for \"$dir_name\"\n$(git -C "$root_dir" status --short | clean_output)\n"
+    vcs_diff+="-> Git Diff for \"$dir_name\"\n$(git -C "$root_dir" diff | clean_output)\n"
+else # No so we iterate through each subdirectory to determine version control system
+    for dir in "$root_dir"/*; do
+        # Skip if it is not a directory or the name contains "git" or "svn"
+        [ -d "$dir" ] || continue
+        [[ "$dir" == *git* || "$dir" == *svn* ]] && continue
+
+        # Determine the version control system for each subdirectory
+        dir_name="$(basename "$dir")"
+        if command -v svn > /dev/null 2>&1 && svn info "$dir" > /dev/null 2>&1; then # SVN
+            vcs_info+="\n-> SVN Information for \"$dir_name\"\n$(svn info "$dir" | clean_output)\n"
+            vcs_diff+="\n-> SVN Diff for \"$dir_name\"\n$(svn diff "$dir" | clean_output)\n"
+            vcs_stat+="\n-> SVN Status for \"$dir_name\"\n$(svn status "$dir" | clean_output)\n"
+        elif command -v git > /dev/null 2>&1 && git -C "$dir" rev-parse --is-inside-work-tree > /dev/null 2>&1; then # Git
+            vcs_info+="-> Git Information for \"$dir_name\"\n$(git -C "$dir" log -1 --pretty=format:"%H%n%an%n%ad%n%s" | clean_output)\n"
+            vcs_diff+="\n-> Git Diff for \"$dir_name\"\n$(git -C "$dir" diff | clean_output)\n"
+            vcs_stat+="\n-> Git Status for \"$dir_name\"\n$(git -C "$dir" status --short | clean_output)\n"
+        else # None
+            vcs_info+="\n-> No version control system for \"$dir_name\"\n"
+        fi
+    done
+fi
 
 # Generate the Fortran subroutine
