#!/usr/bin/ksh
#
## list_probe_state.ksh
##
## Make file lists of probe state files.
##

## 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
  . /home/thmsoc/gaia2_test/soc_it_to_me.config

## Process sites
#
	for probe in $(cat ${CONFIGDIR}/probe_list.txt)
	do
		for dtype in $(cat ${CONFIGDIR}/probe_state_list.txt)
		do
			find /disks/themisdata/${probe}/l1/state/20* -name ${probe}_l1_state_\*_${dtype}.cdf -exec /bin/basename {} \; |sort >> ${LOCAL}/${probe}_state_list_${dtype}.txt
			mv -f ${LOCAL}/${probe}_state_list_${dtype}.txt ${FILELISTS}/${probe}_state_list_${dtype}.txt
		done
	done

#
## Cleanup
#
	exit 0
