
38 Cal.App.2d 50 (1940)
GEO A. CLOUGH, Petitioner,
v.
W. C. BABER et al., Respondents; PUEBLO TRADING CO. (a Corporation) et al., Interveners.
Civ. No. 6309. 
California Court of Appeals. Third Appellate District.  
March 18, 1940.
 Geo A. Clough, in pro. per., and Tobin & Tobin for Petitioner. *51
 Hudson Ford and Elmer Laine for Respondents.
 W. Coburn Cook, Newell J. Hooey and Jack M. Howard for Interveners.
 Harry W. Horton, George R. Kirk, Thomas C. Boone, C. F. Metteer, Arvin B. Shaw, Jr., Call, Murphy & Davis and Stephen W. Downey, as Amici Curiae, on Behalf of Interveners.
 Thompson, J.
 This is a petition for a writ of mandamus to compel an irrigation district to pay certain matured and registered bonds and interest-bearing coupons from the limited funds on hand. The chief opposition to the payment of the bonds and coupons is that the district is insolvent and therefore unable to meet its obligations. It is asserted the payment of those bonds and coupons will constitute an unjust preference since the lands in the district have all been sold for delinquent assessments; that the power of the district to meet its indebtedness by assessments or otherwise has been completely exhausted and all other bondholders and creditors will then be without recourse to any funds or means of satisfying their claims.
 The sole question to be determined on this proceeding is whether the matured bonds of the district, under the circumstances of this case, should be paid in the order in which they were registered or whether the money on hand should be apportioned pro rata among all of the bondholders upon an equitable basis.
 The respondent, Compton-Delevan Irrigation District, was organized pursuant to law, by landowners in Colusa County, in 1920. Bonds were issued by the district in the aggregate sum of $575,000, consisting of 575 bonds of the par value of $1,000 each, to each of which bonds there was attached interest-bearing coupons payable semi-annually at the rate of 6 per cent per year. In 1927, 523 of those bonds were still outstanding and unpaid. At that time the bonded indebtedness of the district was renewed by voting and issuing refunding bonds in the aggregate amount of $523,000. January 1, 1932, there were outstanding and unpaid 281 of those refunding bonds, together with the interest-bearing coupons *52 attached thereto. No bonds or coupons have been paid since that date. All of the lands of the district have been sold and conveyed to the state for delinquent assessments. On January 1, 1939, the district had in its treasury the sum of $32,000. By resolution duly adopted $15,000 of that sum was set apart for the purpose of paying matured bonds and coupons. An average of $5,000 was received annually by the district in the years of 1935 to 1938 inclusive from rent paid for the leasing of portions of the land, which is insufficient with which to pay the necessary expenses of operating the district and the accumulated interest on its indebtedness.
 The petitioner owns five bonds of the denomination of $1,000 each, together with interest-bearing coupons which were matured and unpaid on January 1, 1932. These bonds and coupons were duly registered for payment with the treasurer on the following day. No other bonds were previously registered by any of their owners. Other bonds were, however, subsequently registered. Demand for the payment of said five bonds and coupons from the funds on hand was refused. The petitioner is the owner of 34 other bonds of the denomination of $1,000 each, which were not matured at the time of registering said five bonds.
 The respondents' answer alleges that all of the land in the district has been foreclosed for delinquent assessments and sold to the state; that there is no property in the district upon which assessments to pay for operating expenses or the obligations of the district may be levied; that the bonded indebtedness of the district on July 1, 1939, was $588,541.65; that the district is without resources or means with which to pay the obligations and it is therefore insolvent. It is conceded the district is insolvent.
 The interveners own 24 original and refunding bonds of the par value of $1,000 each, together with the interest-bearing coupons thereof, all of which have been presented for payment since the registration of petitioner's bonds, and no part of which have been paid. The interveners support the petition for a writ of mandamus and contend that the bonds and coupons should be paid in the order in which they are presented for payment and registered.
 [1] Mandamus is the proper remedy to compel a board of directors of an irrigation district to pay, from available *53 funds, the owner of matured bonds and interest-bearing coupons the amount to which he is entitled. (Hutchison v. Reclamation Dist. No. 1619, 81 Cal.App. 427 [254 P. 606]; 16 Cal.Jur. 814, sec. 31.) In ascertaining the official duties of the board or its officer, the court many construe a statute necessarily involved or determine its constitutionality. (16 Cal.Jur. 871, secs. 69, 70.) [2] Mandamus, however, is an extraordinary remedy which is equitable in its nature. There is no absolute right to the writ. The necessity of issuing the writ must be clearly established. It will not issue in doubtful cases. It will not issue if the writ would result in grievous public or private wrong in conflict with the spirit of the statute, even though it be in compliance with the technical letter of the law. (Duncan Townsite Co. v. Lane, 245 U.S. 308 [38 S.Ct. 99, 62 L.Ed. 309]; Hutchison v. Reclamation Dist. No. 1619, supra; High's Extraordinary Legal Remedies, 3d ed., p. 12, sec. 9; 16 Cal.Jur. 776, secs. 13, 14.)
 [3] In support of petitioner's contention that he is entitled to full payment of his five registered bonds and the attached coupons from the fund of $15,000 on hand, on the doctrine of "first come, first served" or the absolute right to payment in the order in which the bonds are registered with the treasurer of the board, he relies upon the interpretation of sections 52 and 61a of the Irrigation District Act of California (Stats. 1897, p. 254, and amendments, 2 Deering's Gen. Laws of 1931, p. 1948, Act 3854), as construed in the following cases: Bates v. McHenry, 123 Cal.App. 81 [10 PaCal.2d 1038]; Provident Land Corp. v. Zumwalt, 12 Cal.2d 365 [85 PaCal.2d 116]; Moody v. Provident Irr. Dist., 12 Cal.2d 389 [85 PaCal.2d 128].
 In none of those cases was the application of sections 52 and 61a of the act involved under circumstances like those of the present proceeding where the district is insolvent and the fund on hand is inadequate to pay more than a small percentage of the matured bonds and obligations of the district, and where all of the lands of the district have been sold and conveyed to the state for delinquent assessments, thereby exhausting all available means of levying future taxes to pay the bondholders. In those cases there was no showing of the injustice of directing the payment of registered bonds so as to deprive all other bondholders of the possibility of ever *54 recovering any substantial portion of their investments therein.
 Section 52 of the act does not declare that matured bonds shall be paid in the order in which they are registered. All that it provides is that when there is no money available in the bond fund they may be presented to the treasurer and registered for payment after which they will bear 7 per cent interest per annum "until notice is given that funds are available" for that purpose. The section then declares that:
 "It [the bond] shall be stamped and provision made for its payment as in the case of a warrant for the payment of which funds are not available on its presentation."
 Section 61a of the act prescribes the procedure to be followed as evidence of the added burden of interest with respect to warrants which are presented when there is no money in the fund with which to pay them. That section does not specify that such warrants shall be paid in the order in which they are presented. That fact may be inferred under proper circumstances, as the preceding cases upon which the petitioner relies, hold. There is no mandatory language in that section requiring them to be paid in the order in which they are registered. In an equitable proceeding, like the present petition for a writ of mandamus, certainly no reasonable construction of that section would require payment of such warrants or bonds under the circumstances of this case. Section 61a is clearly intended to provide for allowance of interest after claims are presented, during the time payment is delayed on account of a lack of funds. It was not adopted to prescribe the order in which registered bonds or warrants are required to be paid. The only language from which that requirement may be inferred in proper cases consists of the following statement:
 "When funds of the district are not available to pay the same, the treasurer of the district shall endorse thereon the words 'funds not available for payment', with the date of presentation and shall specify the interest that such warrants shall thereafter bear and shall sign his name thereto. He shall keep a record showing the number and amount of each such warrant, the date of its issuance, the person in whose favor it was issued, and the date of its presentation for payment." *55
 That section then provides that when there are sufficient funds with which to pay the outstanding registered warrants, the treasurer shall give notice by publication or posting to that effect. After the time fixed by that notice has expired the interest ceases to become a charge against the district. Nowhere in that section, or elsewhere in the act, is it provided that bonds or warrants shall be paid in the order in which they are presented for payment. The section concludes by stating that:
 "All warrants for the payment of which funds are declared in said notice to be available shall cease to draw interest at the time of the first publication or posting of said notice."
 We conclude that such cases as Bates v. McHenry, supra, should be construed to determine only that bonds or coupons shall be paid in the order in which they are registered when there is money in the fund or a prospect of securing such necessary funds by taxation of the land sufficient to meet the obligations of the district. A construction of those cases should not obtain which will absolutely impair or destroy the obligations of the contracts to pay other bonds or coupons by distributing to those who have first registered their bonds all of the funds which the district will ever be able to raise. That sort of a preference would do violence to the fundamental principles of justice and equity.
 While the exact situation which is involved in this proceeding has not been previously determined in this state, the courts have clearly intimated that when an irrigation district or a reclamation district is insolvent and its ability to raise funds to pay existing obligations by taxation has been entirely exhausted, a fund which is inadequate to meet the obligations of the district will not be distributed to the bondholders in the order in which they have been registered. On the contrary, the money, under such circumstances, should be prorated equitably among all of those who have valid claims therefor regardless of the time of their registration. (Kerr Glass Mfg. Corp. v. City of San Buenaventura, 7 Cal.2d 701 [62 PaCal.2d 583]; Provident Land Corp. v. Zumwalt, supra; Mulcahy v. Baldwin, 216 Cal. 517 [15 PaCal.2d 738]; Rohwer v. Gibson, 126 Cal.App. 707 [14 PaCal.2d 1051]; Morris v. Gibson, 30 Cal.App.2d 684 [87 PaCal.2d 37]; Morris, Mather & Co. v. Port of Astoria, 141 Or. 251 [15 *56 PaCal.2d 385, 390]; State v. Knott, 129 Fla. 136 [176 So. 113]; 6 McQuillin's Mun. Corp., 2d ed., p. 245, sec. 2504; 1 Pomeroy's Eq. Jur., 4th ed., p. 764, sec. 407.) The preceding authorities recognize the principle that where the debtor is insolvent and there is not sufficient funds with which to pay all obligations in full and the power to raise funds by taxation or otherwise has been exhausted, in accordance with the settled doctrine of equity the accessible money should be prorated among the holders of all valid claims.
 In the present case the district is insolvent; the lands have all been conveyed to the state on account of default of assessments; matured bonds in the aggregate sum of $283,000 are unpaid, many of which have been registered subsequent to petitioner's bonds; the rented lands fail to produce sufficient income to pay operating expenses and accruing interest to meet the debts of the district; the taxing power of the district has been entirely exhausted; there is no prospect of raising further funds in any manner whatever, with which to meet present and future obligations of the district. Under such circumstances the petitioner is not entitled to payment in full of his five registered bonds as a preference, but the available funds should be apportioned pro rata among the holders of all valid claims.
 In support of the application of the preceding equitable principle of prorating funds among creditors of a city or district when it is insolvent and its taxing power for payment of such claims has been exhausted, and the money on hand is inadequate, the Supreme Court, at page 709 of the Kerr Glass Manufacturing case, supra, approved the conclusions reached in the case of Meyer v. Widber, 126 Cal. 252 [58 P. 532], in the following language:
 "It was thereupon concluded that where the sources of the bond redemption fund were so limited and were not fortified by the authority to resort to a general or 'inexhaustible' taxing power, the fund becomes a trust fund to be shared by all who hold claims against it without priority one over the other. Thus it was appropriately held that where such a fund was insufficient to pay in full all who had claims against it, the petitioner was entitled only to share ratably with the other bondholders. ... *57"
 "As in the act involved in the case of Rohwer v. Gibson, supra, there is no provision in the Improvement Bond Act which can be interpreted to inhibit the settlement of the claims of all bondholders ratably when the necessity requires. The language in section 3 above quoted and relied upon by the petitioner, unaccompanied by any provisions which would give it a mandatory character, must be deemed to be directory only. In Meyers v. City of Idaho Falls, supra (52 Idaho, 81 [11 PaCal.2d 626]), a provision for payment in numerical order was held to be directory only and not to prevent the distribution of the moneys as a trust fund. Pursuant to direction for payment upon presentation, if it were possible for all bonds remaining unpaid to be presented simultaneously, the treasurer would find himself compelled to divide an insufficient fund ratably among all so presenting. The same duty arises to divide the funds ratably when it appears that there will not be sufficient to pay all bonds in full, whether or not all are technically presented for payment. No contention is made by the petitioner that there does not in fact exist an insufficiency resulting by virtue of the large percentage of delinquencies and the consequent inability of the city to realize from all available sources sufficient to pay all bonds in full from the redemption fund. ... In such a case it may restrict payments from the bond redemption fund on a pro rata basis among the holders of all bonds remaining unpaid, whether or not the same have matured."
 The other authorities previously cited by us in support of the doctrine of prorating funds among all creditors when the district is insolvent and its taxing power has been exhausted, either directly or by necessary inference, adopt that rule. They merely announce the just and equitable principle which should prevail under such circumstances.
 The petition for a writ of mandamus is denied.
 Tuttle, J., and Pullen, P. J., concurred.
