#-----------------------BEGIN NOTICE -- DO NOT EDIT-----------------------
# NASA Goddard Space Flight Center
# Land Information System Framework (LISF)
# Version 7.5
#
# Copyright (c) 2024 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#-------------------------END NOTICE -- DO NOT EDIT-----------------------

VERSION_FILE=version.F90

cat >$VERSION_FILE <<HERE
#-----------------------------------------------------------------------
This summary is generated by LIS' Makefile.
#-----------------------------------------------------------------------

#-----------------------------------------------------------------------
BEGIN SUMMARY
#-----------------------------------------------------------------------

HERE

cat >>$VERSION_FILE <<HERE

#-----------------------------------------------------------------------
Subversion information:
#-----------------------------------------------------------------------
HERE
if [ `which svn 2>/dev/null` ]; then
   svn info ../ >> $VERSION_FILE 
else
   echo "No Subversion info available" >>$VERSION_FILE
fi

cat >>$VERSION_FILE <<HERE

#-----------------------------------------------------------------------
#Configuration:
#-----------------------------------------------------------------------
#HERE
#cat configure.lis >>$VERSION_FILE


#cat >>$VERSION_FILE <<HERE

#-----------------------------------------------------------------------
#LIS_misc.h:
#-----------------------------------------------------------------------
#HERE
#cat LIS_misc.h >>$VERSION_FILE
#
#cat >>$VERSION_FILE <<HERE

#-----------------------------------------------------------------------
Filepath:
#-----------------------------------------------------------------------
HERE
cat Filepath >>$VERSION_FILE

cat >>$VERSION_FILE <<HERE
#-----------------------------------------------------------------------
END SUMMARY
#-----------------------------------------------------------------------
HERE


if [ `which vim 2>/dev/null` ]; then
EX_CMD="vim -e -s -X"
else
EX_CMD="ex -s"
fi

$EX_CMD $VERSION_FILE <<HERE
%s/\\\\/\\\\\\\\/
%s/\(.*\)/write(*,*) "\1"/
1i
subroutine lis_version()
implicit none
.
\$a
end subroutine lis_version
.
wq
HERE
