C+
C NAME:
C	Time2Template
C PURPOS:
C CALLING SEQUENCE:
	subroutine Time2Template(ctemplate,ct)
C PURPOSE:
C MODIFICATION HISTORY:
C	JUL-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
C-
	    character	ctemplate*(*)
	    character	ct*(*)

	if (ctemplate .eq. ' ') then
	    ct = 'YYYY/MN/DD hh:mm:ss'		! 19-char
	else if (index(ctemplate,'YMD') .eq. 1) then
	    ct = 'YYYY/MN/DD hh:mm:ss'		! 19-char
	    if (itrim(ctemplate) .gt. len('YMD')) ct(itrim(ct)+1:) = ctemplate(len('YMD')+1:)
	else if (index(ctemplate,'YDOY') .eq. 1) then
	    ct = 'YYYY/DOY hh:mm:ss'		! 17-char
	    if (itrim(ctemplate) .gt. len('YDOY')) ct(itrim(ct)+1:) = ctemplate(len('YDOY')+1:)
	else if (index(ctemplate,'SMEI') .eq. 1) then
	    ct = 'YYYY_DOY_hhmmss'		! 15-char
	    if (itrim(ctemplate) .gt. len('SMEI')) ct(itrim(ct)+1:) = ctemplate(len('SMEI')+1:)
	else
	    ct = ctemplate
	end if

	return
	end
