subroutine fill_grads_template_esmf(str, tmpl, unusable, xid, collection_id, time, preserve, rc)
character(len=*), intent(out) :: str
character(len=*), intent(in ) :: tmpl
class(KeywordEnforcer), optional, intent(in) :: unusable
character(len=*), optional, intent(in ) :: xid
character(len=*), optional, intent(in ) :: collection_id
type(ESMF_Time), optional, intent(in ) :: time
logical, optional, intent(in ) :: preserve
integer, optional, intent(out) :: rc
integer :: nhms, nymd, year, month, day, hour, minute, sec, status
_UNUSED_DUMMY(unusable)
call ESMF_TimeGet(time, yy=year, mm=month, dd=day, m=minute, h=hour, s=sec, _RC)
nymd = year*10000 + month*100 + day
nhms = hour*10000 + minute*100 + sec
_UNUSED_DUMMY(unusable)
call fill_grads_template(str, tmpl, &
experiment_id=xid, collection_id = collection_id, nymd=nymd, nhms=nhms,preserve=preserve, _RC)
_RETURN(_SUCCESS)
end subroutine fill_grads_template_esmf