The physical cost of carry is two parameters and the unit of measure and value of the contract:
1.) The first parameter is storage cost and should be user editable. The storage cost parameter should be in terms of $ per unit/day, unit being the units that the commodity trades in. For example, corn trades in bushels. The storage cost per bushel is something like $.0025 (i.e. 1/4 cent) per bushel per day. So the storage cost for corn, from September to December, is $.0025 x 3 months x 30 days/month = 22.5 cents (leave it in cents for grains, not dollars. i.e. not .225)
2.) The second parameter is cost of money (interest rate) and should also be user editable. A good default would be .05 or 5%. So the cost of money to store a bushel of September corn for 3 months (until December) is:
.05/12 months x 3 months x ZCU17, or .05/12*3*340.00 = 4.25 cents.
So the total Cost of Carry is: 22.5 + 4.25 or 26.75 cents. If you want to get a bit more accurate, you can use the actual number of days between the two expiration dates, rather than assuming 30 days/month.