Exhibit 3.40
AMENDED AND RESTATED PARTNERSHIP AGREEMENT FOR
TIDELANDS OIL PRODUCTION COMPANY
THIS PARTNERSHIP AGREEMENT (this “Agreement”) of Tidelands Oil Production Company, a Texas general partnership (the “Partnership”), is executed as of January 1, 2006, by OXY Tidelands, Inc., a Delaware corporation (“OXY Tidelands”), and OXY Wilmington, LLC, a Delaware limited liability company (“OXY Wilmington”).
WHEREAS, the Partnership was formed pursuant to that certain Partnership Agreement for the Partnership by and between Neste Oil Services, Inc., a Delaware corporation (“Neste”), and Chanse Long Beach Production Corporation, a New York corporation (“Chanse”), effective as of January 1, 1989 (the “Original Agreement”), which Original Agreement provided, among other things, that Neste held seventy-nine and nine-tenths percent (79.9%) of the partnership interest of the Partnership, and Paramount held twenty-one and one-tenth percent (21.1%) of the partnership interest of the Partnership; and
WHEREAS, as of January 1, 2003, Neste assigned seventy-five percent (75%) of the partnership interest of the Partnership to Paramount Petroleum Corporation, a Delaware corporation (“Paramount”), and four and nine-tenths percent (4.9%) of the partnership interest of the Partnership to Chanse, which assignments caused Paramount to own seventy-five percent (75%) of the partnership interest of the Partnership, and Chanse to own twenty-five percent (25%) of the partnership interest of the Partnership; and
WHEREAS, simultaneously, with such assignments, Paramount and Chanse entered into an amended and restated partnership agreement of the Partnership dated as of January 1, 2003 (the “Previous Agreement”), which replaced the Original Agreement in its entirety; and
WHEREAS, as of December 31, 2005, Paramount assigned all of its partnership interest in the Partnership to OXY Tidelands, and as of January 1, 2006, Chanse assigned all of its partnership interest in the Partnership to OXY Wilmington, which assignments caused OXY Tidelands to own seventy-five percent (75%) of the partnership interest of the Partnership, and OXY Wilmington to own twenty-five percent (25%) of the partnership interest of the Partnership; and
WHEREAS, OXY Tidelands and OXY Wilmington now desire to continue the Partnership, and amend, restate and replace in its entirety the Previous Agreement as set forth herein.
NOW, THEREFORE, in consideration of the foregoing and the covenants and agreements herein contained, the parties hereto agree as follows:

Article I
DEFINITIONS
As used herein:
“Act” means the Texas Revised Partnership Act, as amended from time to time, provided that on and after January 1, 2010, the “Act” shall mean the Texas Business Organizations Code, as amended from time to time.
“Applicable Rate” means interest compounded on a monthly basis, at the rate per annum equal to the lesser of: (a) the prime rate for U.S. Dollar deposits plus three percent (3%), as published in The Wall Street Journal (Eastern edition, U.S.), applicable on the first business day prior to the due date of payment and thereafter on the first business day of each succeeding calendar month; or (b) the maximum rate permitted by applicable law.
“Capital Percentage” with respect to a Partner shall mean the Capital Percentage set forth opposite such Partner’s name on Exhibit A.
“Managing Partner” means Oxy Tidelands.
“Non-Managing Partner” means Oxy Wilmington.
“Partners” means, together, Oxy Tidelands and Oxy Wilmington, and “Partner” means either of them.
“Partnership Interest” means, as to any Partner, all of the interests of that Partner in the Partnership, including its: (a) right to a distributive share of the profits and losses of the Partnership; (b) right to a distributive share of Partnership assets; and (c) right, if the Managing Partner, to manage the affairs of the Partnership.
ARTICLE II
ORGANIZATION OF PARTNERSHIP
2.1 Organization. The Partnership is a Texas general partnership.
2.2 Duration. The Partnership shall continue until dissolved pursuant to Article VIII.
2.3 Place of Business. The Partnership’s place of business shall be 10889 Wilshire Boulevard, Los Angeles, California 90024, or at such other place or places as the Managing Partner may designate from time to time by notice to the other Partners.
2.4 Name. The business of the Partnership shall be carried on under the name of “Tidelands Oil Production Company.”
- 2 -

2.5 Purpose. The purpose of the Partnership is to engage in any and all lawful business activities in which a Texas general partnership may engage or participate, and to do all acts and things that may be necessary, incidental or convenient to carry on the Partnership’s business.
ARTICLE III
CAPITAL CONTRIBUTIONS
3.1 Required Capital Contributions.
(a) Any funds which are required from time to time to meet obligations of the Partnership shall be contributed by the Partners in the proportions of their Capital Percentages. Such contributions shall be made within thirty (30) days after the date that the Managing Partner notifies all of the Partners of such requirement (the “Notice Date”).
(b) If, at any time, any Partner should fail to contribute any sum required in accordance with the provisions of this Section 3.1 (a “Defaulting Partner”), and such failure shall continue for thirty (30) days following the Notice Date, then such of the other Partners (including the Managing Partner) as elect to do so may advance the sum which such Defaulting Partner shall have failed to contribute (each, an “Advancing Partner”), and in such proportions as may be agreed upon among them, and if the Advancing Partners are unable to agree, the sum to be advanced shall be advanced in accordance with the ratios that the Capital Percentages of the Advancing Partners bear to one another. Upon any such advance or advances, the Defaulting Partner shall be obligated to repay said sum to the Advancing Partners, and such sum shall bear interest at the Applicable Rate until such sum is paid. Amounts that would otherwise be distributed to a Defaulting Partner shall be distributed to the Advancing Partners to the extent of the amount owing to the Advancing Partner. If there is more than one Advancing Partner, the amounts that would otherwise be distributed to the Defaulting Partner shall be distributed among the Advancing Partners in proportion to the amounts owed to each such Advancing Partners.
(c) The Defaulting Partner shall not be personally liable for the amount of any additional contribution called for by the Managing Partner pursuant to this Section 3.1, and, except as provided in Section 3.1(b), neither the Partnership nor any Advancing Partner shall have the right or ability to collect the amount required to be contributed by the Defaulting Partner from any assets belonging to such Defaulting Partner. Any call for additional capital contributions pursuant to Section 3.1(b) shall be made solely at the discretion of the Managing Partner, and the existence of liabilities of the Partnership in excess of the amount of assets available to discharge such liabilities shall not, in the absence of a call by the Managing Partner for further contributions pursuant to this Section 3.1, create a liability on the part of the Partners for additional capital contributions to meet such deficit. The obligations of Partners to make additional capital contributions as set forth in Section 3.1(b) and their liabilities to the Partnership and other Partners with respect thereto shall not confer any rights on any third parties.
3.2 Interest on Capital Contributions. No interest shall accrue on any capital contributions.
- 3 -

ARTICLE IV
INCOME, LOSS AND DISTRIBUTIONS
4.1 Participation in Income and Losses. The income, gain, deductions, losses and credits of the Partnership shall be allocated among the Partners in the proportions of their Capital Percentages.
4.2 Distribution of Cash Flow.
(a) In General. From time to time, the Managing Partner may cause the Partnership to make distributions of Partnership funds to the Partners. Except as otherwise provided in Section 3.1(b), such distributions shall be made to the Partners in the proportions of their Capital Percentages. Notwithstanding the foregoing, the Partnership shall distribute to the Partners a sufficient amount to pay their respective income tax obligations resulting from the Partnership.
(b) Distributions in Liquidation. Notwithstanding the foregoing provisions of Section 4.2(a), distributions made upon termination of the Partnership shall be made to the Partners in accordance with Section 8.4.
4.3 Transferor-Transferee Allocations. The amounts allocated to a Partnership Interest for a fiscal year pursuant to Section 4.1 shall be allocated between the transferor and transferee of such Partnership Interest based on the actual results of operation of the Partnership during the periods before and after the effective date of the assignment of such Partnership Interest.
ARTICLE V
POWERS AND OBLIGATIONS OF THE MANAGING PARTNER
5.1 Powers of Managing Partner. The Managing Partner shall have the sole and exclusive right and obligation to manage, supervise and administer the affairs of the Partnership, and shall have full power to do all things necessary or incidental thereto. Without limiting the generality of the foregoing, the Managing Partner shall have the following powers and duties:
(c) To acquire, hold and retain title to the assets of the Partnership in the name of the Partnership and to sell, exchange, lease or otherwise dispose of Partnership assets;
(d) To borrow money and issue evidences of indebtedness and to call for additional capital contributions in accordance with Section 3.1;
(e) To negotiate for, enter into and execute loan documents, including pledges and mortgages of Partnership assets, relating to any borrowings required in connection with Partnership business;
(f) To perform or cause to be performed all obligations of the Partnership and to enforce or cause to be enforced all rights and remedies of the Partnership in connection with any loans, pledges, mortgages, and other contractual arrangements entered into by the Partnership,
- 4 -

including without limitation that certain Long Beach Harbor Tidelands Parcel and Parcel “A” Oil Contract by and among the City of Long Beach, Neste Holding (U.S.A.), Inc., Chanse and the Partnership dated January 10, 1989, as amended and assigned from time to time, and that certain Amended and Restated Field Contractor Agreement by and between the City of Long Beach and the Partnership dated September 1, 1994, as amended from time to time;
(g) To cause to be paid on or before the due date thereof all amounts due and payable by the Partnership to any person or entity;
(h) To employ such agents, employees, managers, accountants, attorneys, engineers, consultants, brokers and other persons as it may deem necessary or desirable for the conduct of the Partnership’s business and pay such fees, expenses, salaries, wages and other compensation to such persons as it may deem necessary or convenient;
(i) To pay, extend, renew, modify, adjust, submit to arbitration, prosecute, defend or compromise upon such terms as it may determine, and upon such evidence as it may deem sufficient, any obligation, suit, liability, cause of action or claim, including taxes, either in favor of or against the Partnership;
(j) To make any and all expenditures that it may deem necessary or desirable for the conduct of the Partnership’s business and the carrying out of their obligations and responsibilities under this Agreement, including, without limitation, all legal, accounting and other similar expenses;
(k) To purchase insurance to protect Partnership assets and the business of the Partnership against loss;
(l) To deposit Partnership funds in and withdraw Partnership funds from an account or accounts to be established in such financial institutions (including any state or federal chartered bank or savings and loan association), by such persons, at such times and in such amounts as it may deem necessary or convenient;
(m) To hold partnership assets (including, without limitation, any contribution made by a Partner in accordance with this Agreement), to acquire real and personal property, arrange financing, enter contracts and complete any other arrangements on behalf of the Partnership, either in the name of the Partnership, in the name of the Managing Partner, or in the name of a nominee, without having to disclose the existence of the Partnership;
(n) To make distributions to Partners;
(o) To admit persons as Partners, pursuant to the terms and conditions of Article VII; and
(p) To take any and all other actions not prohibited under the Act or applicable law.
- 5 -

5.2 Duties; Delegation. The Managing Partner shall manage and control the Partnership, its business and affairs to the best of its abilities and shall use its best efforts to carry out the business of the Partnership. The Managing Partner shall not be required to devote any particular amount of time to the business of the Partnership, and may engage others to perform the actions required of it under the terms of this Agreement.
5.3 Reliance by Third Parties. No person, firm or governmental body dealing with the Partnership shall be required to inquire into, or to obtain any other documentation as to, the authority of the Managing Partner to take any action permitted under this Article V.
5.4 Indemnification of Managing Partner. The Partnership shall indemnify, defend and save harmless the Managing Partner from, and reimburse the Managing Partner to the full extent of, any loss, costs, including attorneys’ fees and costs of suit, or damage incurred by the Managing Partner by reason of any act performed by it on behalf of the Partnership or in furtherance of the Partnership’s interest, other than any loss or damage incurred by the Managing Partner by reason of his gross negligence, willful misconduct or bad faith. Such indemnity shall not be affected or diminished by any withdrawal or resignation of the Managing Partner, but shall continue to apply to all acts of the Managing Partner performed prior to the effective date of such withdrawal or resignation, and shall survive the termination of the Partnership.
ARTICLE VI
BOOKS AND RECORDS
6.1 Accounting. The Managing Partner shall maintain adequate books and records of account and shall reflect all Partnership transactions. The fiscal year of the Partnership shall be the calendar year, and the Partnership shall use the accrual method of accounting. The net profits or net losses of the Partnership for each fiscal year shall be determined in accordance with accounting practices generally recognized as acceptable for the business of the Partnership and consistently applied. Except as provided in Section 4.3, net profits and net losses for book and tax purposes that are recognized during a fiscal year shall be allocated as of the end of such fiscal year, based on the facts and circumstances existing as of the end of such year.
6.2 Inspection and Audit. All books of account and all other records of the Partnership shall be kept by the Managing Partner at the Partnership’s place of business and may be inspected at any reasonable time by any of the Partners. Any Partner may request that the books and records of the Partnership be audited at the end of any fiscal year, and any such audit shall be conducted by an independent certified public accountant, selected by the Partner requesting the audit and at the expense of the Partner requesting the audit.
ARTICLE VII
TRANSFERS OF PARTNERSHIP INTERESTS
7.1 Assignments of Partnership Interests. A Partner’s Partnership Interest (or any portion thereof) shall be assignable; provided, however, that: (a) the Partnership shall not be required to register any assignment until the Managing Partner has received from the assignor documents regarding such transfer in form and substance satisfactory to the Managing Partner; and (b) unless
- 6 -

and until an assignee becomes a substituted Partner in accordance with Section 7.2, the assignee’s status and rights shall be limited to those accorded a transferee of partnership interests under the Act. Any transfer in violation of clause (a) shall be void and ineffectual and shall not bind the Partnership or the Managing Partner.
7.2 Substituted Partner. No assignee of a Partner (other than a Partner at the time of such transferee) may be admitted as a substituted Partner except with the consent of the non-transferring Partners, which consent may be withheld for any reason.
ARTICLE VIII
WINDING UP; LIQUIDATION
8.1 Liquidating Trustee to Perform Winding-Up. If the Partnership is to be wound-up, the Managing Partner shall wind-up the affairs of the Partnership and distribute its assets (the Managing Partner in such capacity, the “Liquidating Partner”).
8.2 Winding-Up of Partnership Affairs. The Liquidating Partner shall proceed diligently to wind-up the affairs of the Partnership. The Liquidating Partner may take any and all action it determines to be in the best interests of the Partners including the sale of Partnership assets to realize sufficient cash to repay Partnership loans. The Liquidating Partner shall not, however, take any action to continue the business of the Partnership except as incidental to winding-up the Partnership.
8.3 Accounting on Wind-Up. Upon the occurrence of the event requiring the winding-up of the Partnership, a proper accounting shall be made of the Partnership assets, liabilities and operations from the date of the last previous accounting to the date of such event. The value of each unsold Partnership asset shall be determined by the Liquidating Partner and gain or loss allocated as if each such Partnership asset had been sold at such value. The income, gain, losses and deductions realized subsequent to the date of such event shall be allocated in accordance with Article IV. Any cost incurred in connection with the organization of the Partnership that has not been deducted prior to the event requiring the winding-up of the Partnership shall be deducted upon such event.
8.4 Liquidation. In winding up the affairs of the Partnership, the Liquidating Partner shall first pay or decrease the liabilities of the Partnership (other than those to Partners) in the order of priority as provided by law. The Liquidating Partner shall next pay the liabilities of the Partnership that are owed to Partners in the order of priority as provided by the Act. The remaining assets of the Partnership shall be distributed to the Partners in proportion to their Capital Percentages; provided, however, that any amounts otherwise distributable to a Defaulting Partner shall instead be distributed to the Advancing Partners in repayment of the amounts owed (including accrued interest) by such Defaulting Partner to such persons; and provided further, however, that if the amount distributable to the Defaulting Partner is less than the amount owed, such distributable amount shall be distributed among the Advancing Partners in proportion to the amount owed to each Partner. It is understood that the amount of cash plus the fair market value of distributions may be less than the amount of the contributions and in no event will any adjustments have to be made in respect thereof
- 7 -

ARTICLE IX
MISCELLANEOUS PROVISIONS
9.1 Notices. Any notice, demand or communication required or permitted to be given by any provision of this Agreement shall be deemed to have been sufficiently given or served for all purposes if delivered personally to the Partner or to an executive officer of the Partner to whom the same is directed or if sent by registered or certified mail, postage and charges prepaid.
9.2 Application of Texas Law. This Agreement, and the application of interpretation hereof, shall be governed exclusively by its terms and by the laws of the State of Texas, and specifically the Act, without regard to the provisions thereof addressing conflicts of law.
9.3 Competition. Each Partner and affiliate of a Partner may engage in or possess an interest in other business ventures of every nature and description and in any vicinity whatsoever. None of the Partnership or the Partners shall have any rights in and to such independent ventures or to any profits therefrom unless otherwise agreed in a written document other than this Agreement. Any such activity may be undertaken without notice to or participation therein by the Partnership or any Partner. Each of the Partnership and the Partners hereby waives any right or claim it may have against a Partner or an affiliate of a Partner with respect to any such activity or the income or profits therefrom unless otherwise agreed in a written document other than this Agreement.
9.4 Waivers. No waiver of any right under this Agreement shall be effective unless evidenced in writing and executed by the Partner against which it is sought to be enforced. The failure of any Partner to seek redress for violation of or to insist upon the strict performance of any covenant or condition of this Agreement shall not prevent another act or omission, which would have originally constituted a violation, from having the effect of an original violation.
9.5 Rights and Remedies Cumulative. The rights and remedies provided by this Agreement are cumulative and the use of any one right or remedy by any Partner shall not preclude or waive the right to use any or all other rights or remedies. Said rights and remedies are given in addition to any other rights the Partners may have by law, statute, ordinance or otherwise.
9.6 Severability. If any provision of this Agreement or the application thereof to any person or circumstance shall be invalid, illegal or unenforceable to any extent, the remainder of this Agreement and the application thereof shall not be affected and shall be enforceable to the fullest extent permitted by law.
9.7 Heirs, Successors and Assigns. Each and all of the covenants, terms, provisions and agreements herein contained shall be binding upon and inure to the benefit of the Partners and, to the extent permitted by this Agreement, their respective heirs, legal representatives, successors and assigns.
9.8 Entire Agreement. This Agreement constitutes the entire agreement of the Partners with respect to the Partnership, and supersedes all prior contracts and agreements regarding the Partnership, whether oral or written, including without limitation the Previous Agreement.
- 8 -

9.9 Creditors. None of the provisions of this Agreement shall be for the benefit of or enforceable by any creditors of the Partnership.
9.10 Counterparts. This Agreement may be executed in counterparts, each of which shall be deemed an original but all of which shall constitute one and the same instrument.
EXECUTED to be effective as of the date first set forth above.
OXY TIDELANDS, INC.
By: /s/ Michael L. Preston
Name: Michael L. Preston
Title: Vice President and General Counsel
OXY WILMINGTON, LLC
By: /s/ Michael L. Preston
Name: Michael L. Preston
Title: Vice President and General Counsel
ATTACHED TO AND MADE PART OF THAT CERTAIN AMENDED AND RESTATED PARTNERSHIP AGREEMENT OF TIDELANDS PRODUCTION COMPANY BY AND BETWEEN OXY TIDELANDS, INC. AND OXY WILMINGTON, LLC
EXHIBIT “A”
CAPITAL PERCENTAGES

OXY Tidelands, Inc. | 75%
OXY Wilmington, LLC | 25%

- 9 -