#
# Run interactively on hao machine to put source and mods on lemieux:
#
set LXHOME = /usr/users/0/bfoster # home on lemieux
#
# Put compressed tar file of original source on lemieux:
#
echo "Copying vishnu.hao:/home/tgcm/tiegcm1/tiegcm1_src.tar.Z..."
scp /home/tgcm/tiegcm1/tiegcm1_src.tar.Z bfoster@lemieux.psc.edu:tiegcm1
#
# Uncompress and set permissions on tar file:
#
echo "Uncompress and extract tar file..."
ssh bfoster@lemieux.psc.edu \
  "uncompress tiegcm1/tiegcm1_src.tar.Z ; cd tiegcm1 ; tar xf tiegcm1_src.tar"
#
# Set permissions: 
#
echo "Setting permissions on source code..."
ssh bfoster@lemieux.psc.edu \
  chmod 644 tiegcm1/\*.h tiegcm1/\*.F tiegcm1/M\* \*.inp \*.job \*.jobs
#
# Copy mods and Makefile (will override Makefile from tar file above:
#
echo "Copying mods and Makefile..."
scp ~/tiegcm/tiegcm1/modsrc.henry/*.F ~/tiegcm/tiegcm1/Makefile bfoster@lemieux.psc.edu:tiegcm1
#
# Make new tar file (remove any pre-existing):
#
echo "Removing original tar file..."
ssh bfoster@lemieux.psc.edu rm tiegcm1/tiegcm1_src.tar tiegcm1/omp.F
#
echo "Making new tar file..."
ssh bfoster@lemieux.psc.edu "cd tiegcm1 ; tar cf tiegcm1_src.tar *.h *.F M* mkdep"
echo "Done."
