EXCEPT IN CASES cases involving the death penalty, the Supreme Court has never expounded much of the meaning of the Constitution's bar against "cruel and unusual punishments." But it may have a chance to do so in the not-too-distant future. A federal judge in Virginia ruled last week that a sentence of 40 years in prison and a $20,000 fine for possessing and selling nine ounces of marijuana's is "cruel and unusual." His decision seems to use to be right, if the phrase in the Constitution is to have much meaning.

Judge James C. Turk said in his opinion that this particular sentence was "so grossly disproportionate that it ceases to be rational." Standing alone, it certainly gives that impression. Far more serious crimes in Virginia are routinely punished by far less severe sentences. And even the possesion and sale of hard drugs rarely results in so harsh a prison sentence.

That, of course, leads one to wonder why this particular sentence was imposed. A jury in Wytheville set it three years ago as the term to be served by Roger Trenton Davis at a time when drug users in that part of southwestern Virginia were going to prison at a rapid rate. But even the dislike of drug users and pushers does not fully explain the length of the sentence, or so it seems to us. There have been insinuations that the harshness of the sentence was related as much to Davis's general situation in the community as to the offenses involved. Davis is black and married to a white woman.

The fundamental problem, of course, is with the Virginia procedure that puts the power to fix sentences in the hands of juries, not judges. This has consistently produced inconsistent sentences for the same crime depending on what part of the state it is committed in or on what the composition of a particular jury happens to be. When other states, and even the federal government, are moving toward sentencing procedures that subject the discretion of judges to review, Virginia clings to its archaic and - in this case - irrational reliance on juries.

The state has said it will appeal Judge Turk's decision, and no doubt it ought to. He is breaking new legal ground, since there is no precedent for holding a sentence unconstitutional solely because of its length. And higher courts may, or may not, agree with him. Even if they do not, however, we hope that Virginia will decide that it has gotten its pound of flesh from Mr. Davis and will not attempt to make him serve the entirety of sentence that is so far out of line with reason and justice.