
155 Cal.App.3d 570 (1984)
202 Cal. Rptr. 262
THE PEOPLE, Plaintiff and Respondent,
v.
MOSES LARA, Defendant and Appellant.
Docket No. 12840.
Court of Appeals of California, Third District.
May 8, 1984.
*572 COUNSEL
Sharon E. Duggan, under appointment by the Court of Appeal, and Leonardini & Fathy for Defendant and Appellant.
John K. Van de Kamp, Attorney General, Anthony L. Dicce, Gregory W. Baugher and Linda A. Cabatic, Deputy Attorneys General, for Plaintiff and Respondent.
[Opinion certified for partial publication.[*]]
OPINION
SIMS, J.
In this case[1] we define procedures to be followed by trial courts in imposing sentence under Penal Code section 1170.9,[2] which gives trial courts discretion to commit certain Vietnam veterans to the custody of federal correctional officials in prescribed circumstances.

FACTUAL AND PROCEDURAL BACKGROUND
On January 18, 1983, defendant, a Vietnam combat veteran, pled guilty to one count of robbery (§ 211). Defendant also admitted having used a *573 firearm during that robbery (§ 12022.5) and having suffered a prior serious felony conviction (§ 667, subd. (a)).
(1) (See fn. 3.) At the sentencing hearing on March 17, 1983, the court indicated its intention of sentencing defendant pursuant to section 1170.9.[3] The court made findings that defendant was a member of the armed services of the United States and served in combat in Vietnam and that defendant suffered from substance abuse caused by that service. The court also found, based on representations of defense counsel, that an appropriate federal program existed and that federal law authorized the receipt of defendant.[4]
The court sentenced defendant to the upper term of five years for robbery (§ 213) enhanced two years for firearm use (§ 12022.5). The court also imposed a term of five years for the prior conviction (§ 667, subd. (a)) for an aggregate term of twelve years. The court ordered and adjudged that defendant be committed to the custody of the Department of Corrections for transfer to the custody of federal authorities pursuant to sections 1170.9 and 2911.[5] The court requested that defendant's counsel write the superintendent *574 of the Vacaville Medical Facility informing him of the nature of the federal program defendant's counsel represented was authorized to receive defendant. The court further "direct[ed] the director of the Vacaville Reception and Guidance Center to initiate the steps necessary to transfer the defendant to a federal program as authorized by Section [1170.9] ... and section 2911 of the Penal Code."
Defendant was sent to state prison, remains there, and has never been sent to a federal correctional program.
(2a) Defendant contends, among other things, that commitment to California corrections officials pursuant to section 1170.9 is unauthorized by that section. We agree that commitment to California corrections officials with direction to transfer defendant to federal corrections officials is a sentence unauthorized by section 1170.9 or by section 2911. Accordingly, we affirm the judgment of conviction but remand for the limited purpose of resentencing.

DISCUSSION
Penal Code section 12 imposes a duty upon the sentencing court to impose the punishment prescribed by law. (In re Sandel (1966) 64 Cal.2d 412, 415 [50 Cal. Rptr. 462, 412 P.2d 806].) (3) A sentencing court has no discretion to deviate from the punishment prescribed by statute. (See, e.g., Sandel, supra, at p. 414; People v. Thomas (1976) 65 Cal. App.3d 854, 858 [135 Cal. Rptr. 644]; People v. Browning (1975) 45 Cal. App.3d 125, 145 [119 Cal. Rptr. 420]; People v. Cheffen (1969) 2 Cal. App.3d 638, 641 [82 Cal. Rptr. 658].)
(2b) Section 1170.9 grants sentencing courts the discretion to order a defendant "committed to the custody of federal correctional officials...." Among the requirements of eligibility for a sentence pursuant to section 1170.9 is that one be a "person ... who would otherwise be sentenced to *575 state prison ...." (Italics added.) These provisions reveal that section 1170.9 contemplates a direct commitment to federal correctional officials as an alternative to a commitment to state prison. Section 1170.9 therefore does not authorize a sentencing court to commit a defendant to the custody of the California Department of Corrections with a direction to that Department to transfer custody of the defendant to federal officials.
Moreover, the statute on its face contemplates that the trial court shall insure, before imposing sentence, that a direct commitment to federal correctional authorities is feasible. Thus, the statute empowers the trial court to make such a direct commitment "only if the defendant agrees to such a commitment, the court has determined that appropriate federal programs exist, and federal law authorizes the receipt of the defendant under such conditions." (See fn. 3, ante.)
(4a) In short, section 1170.9 envisions that the trial court shall make sure, before imposing sentence, that federal correctional authorities are ready, willing, and able to receive defendant for service of his term of incarceration.[6] If so, a defendant sentenced pursuant to section 1170.9 should be delivered by the sheriff to the appropriate federal correctional authorities, not to the Department of Corrections, for commencement of service of sentence.
(2c) Consequently, we conclude that, while the trial court's sentence under section 1170.9 was obviously motivated by an admirable concern for defendant's rehabilitation, the sentence imposed was unauthorized by the statute and therefore unlawful.
Nor can we uphold the sentence under section 2911. Subdivision (a) of that section vests discretion in the Director of Corrections to enter into a contract with federal corrections officials for the confinement of persons convicted of crimes. (See fn. 5, ante.) Subdivision (d) of section 2911 provides in pertinent part that if such a contract has been entered into, the director "may direct the transfer of an inmate to the facility designated...." The statute thus vests discretion to transfer in the Director of Corrections, not the trial court.
The court's directive to the superintendent of the Vacaville Reception and Guidance Center, to transfer defendant to a federal program, interferes with the statutory mandate that "The supervision, management and control of *576 the State prisons, and the responsibility for the care, custody, treatment, training, discipline and employment of persons confined therein are vested in the director." (§ 5054)[7] (5) Ordinarily, the judicial sentencing function is confined to a determination whether incarceration in state prison is appropriate; authority as to the manner of execution of the sentence, including a determination of the place of incarceration, is vested in correctional officials. (See § 5080; People v. Thomas, supra, 65 Cal. App.3d at p. 858; People v. Flower (1976) 62 Cal. App.3d 904, 912-913 [133 Cal. Rptr. 455].)
For example, in Flower, the court considered defendant's contention that the trial court should have ordered defendant to be incarcerated out of state pursuant to the Western Interstate Corrections Compact. (See §§ 11190 et seq., esp. § 11194.) Flower rejected the contention by noting that "the responsibility of assigning prisoners to specific institutions falls upon the Director of Corrections, who is to exercise his discretion so as to maximize achievement of the goals of his department.... [I]t is certainly safe to say that the court had no duty to exercise more discretion than it did by advising the director that perhaps section 11190 et seq. should be considered in [the] case." (People v. Flower, supra, 62 Cal. App.3d at p. 914.)
(2d) Here, as in Flower, the trial court could suggest but not order. While laudibly attempting to give effect to the remedial provisions of section 1170.9, the sentencing court fashioned a procedure not authorized by statute. The court therefore erred in committing defendant to state prison with directions to correctional officials to transfer defendant to federal authorities.
Clearly, however, the court intended to render a judgment providing for defendant's incarceration in the custody of federal correctional officials. (4b) In order to do so, the court must hold an evidentiary hearing and insure that an appropriate federal program is available to receive defendant. If so, the court should commit defendant directly to the custody of federal officials. If appropriate accommodations for such a commitment do not exist, the court will have no choice except to commit defendant to state prison with a recommendation that the Director of Corrections exercise his discretion to transfer defendant to a federal facility pursuant to section 2911. We shall remand the cause in order for the trial court to resentence defendant in accordance with the views expressed herein.


*577 II[*]
.... .... .... .... .... .... .

DISPOSITION
The judgment of conviction is affirmed. The cause is remanded for resentencing in accordance with the views expressed herein.
Evans, Acting P.J., and Blease, J., concurred.
NOTES
[*]   See footnote 1, post, page 572.
[1]  Pursuant to rule 976.1 of the California Rules of Court, all portions of this opinion shall be published except part II which does not meet criteria for publication.
[2]  All further statutory references are to the Penal Code.
[3]  Section 1170.9 provides: "In the case of any person convicted of a felony who would otherwise be sentenced to state prison the court shall consider whether the defendant was a member of the military forces of the United States who served in combat in Vietnam and who suffers from substance abuse or psychological problems resulting from that service. If the court concludes that the defendant is such a person, the court may order the defendant committed to the custody of federal correctional officials for incarceration for a term equivalent to that which the defendant would have served in state prison. The court may make such a commitment only if the defendant agrees to such a commitment, the court has determined that appropriate federal programs exist, and federal law authorizes the receipt of the defendant under such conditions."

The court actually sentenced defendant pursuant to then section 1170.8. Effective January 1, 1984, this section was renumbered as section 1170.9. (Stats. 1983, ch. 142, § 121.) The 1983 enactment that renumbered the statute also amended its last sentence by deleting the words "is authorized to" and substituting the word "may" therefor. (Ibid.) Since the amendment to the statute is immaterial to our present concerns, we refer to the statute throughout as section 1170.9 in the interest of simplifying future research. Although defendant committed the crime before the effective date of this statute, he may avail himself of its provisions. (People v. Amerson (1984) 151 Cal. App.3d 165, 168-169 [198 Cal. Rptr. 678].)
[4]  Defendant's counsel represented that he had communicated with three different federal corrections officials who informed him that an appropriate federal rehabilitation program existed and that federal law authorized defendant's participation in that program.
[5]  Section 2911 provides in pertinent part: "(a) The Director of Corrections may enter into contracts, with the approval of the Director of General Services, with appropriate officials or agencies of the United States for the confinement, care, education, treatment and employment of such persons convicted of criminal offenses in the courts of this state and committed to state prisons as the director believes can benefit by such confinement, care, education, treatment, and employment.

".... .... .... .... .... .... .
"(c) No inmate may be transferred from an institution within this state to a federal facility pursuant to such a contract unless he has executed, in the presence of the warden or other head of the institution in this state in which he is confined, a written consent to the transfer. The inmate shall have the right to a private consultation with an attorney of his choice, concerning his rights and obligations under this section, prior to his appearance before the warden or other head of the institution for the purpose of executing the written consent.
"(d) Whenever a contract has been made pursuant to this section the director may direct the transfer of an inmate to the facility designated and shall thereafter deliver the inmate to the custody of the appropriate federal officials for transportation to such facility. An inmate so transferred shall at all times be subject to the jurisdiction of this state and may at any time be removed from the facility in which he is confined for return to this state, for transfer to another facility in which this state may have a contractual or other right to confine inmates, for release on probation or parole, for discharge, or for any other purpose permitted by the laws of this state; in all other respects, an inmate transferred to a federal facility shall be subject to all provisions of the law or regulations applicable to persons committed for violations of laws of the United States not inconsistent with the sentence imposed on such inmate."
[6]  Presumably, the Legislature intended to avoid precisely the sort of problem that occurred here, where, despite the representations of defendants' trial counsel, no federal programs were, in fact, ready to receive defendant.
[7]  An order for transfer by the trial court is also inconsistent with requirements in subdivision (c) of section 2911 requiring execution of a contract prior to transfer. (See fn. 5, ante.)
[*]   See footnote 1, ante, page 572.
