#!/usr/bin/ksh

## Set the environment variables
#
  if [[ -z $THMSOC ]]
  then
    THMSOC=/disks/socware/thmsoc_dp_current
    export THMSOC
  fi
  . ${THMSOC}/src/config/soc_it_to_me.config
  . ${THMSOC}/src/config/ground_mag.config

## Process sites
#
	for line in $(cat ${CONFIGDIR}/lc_site_list.txt)
	do
		site=$(echo $line | awk '{print $1}')
		find ${L2MAGDIR}/${site}/ -name \*cdf |awk -F/ '{print $9}' |sort |awk -F_ '{print $5}' >> ${LOCAL}/gmag_cdf_list_${site}.txt
		mv -f ${LOCAL}/gmag_cdf_list_${site}.txt ${FILELISTS}/gmag_cdf_list_${site}.txt
	done

#
## Cleanup
#
	exit 0