Skip Links

USGS - science for a changing world

Scientific Investigations Report 2013–5016


Macrophyte and pH Buffering Updates to the Klamath River Water-Quality Model Upstream of Keno Dam, Oregon


Appendix A. CE-QUAL-W2 Macrophyte Code Changes

The most important macrophyte code changes related to initial conditions are included here. Other minor code changes also were made, including an expansion of macrophyte model flux outputs. For the definitive list of changes, users should compare new and old source code files. Normal macrophyte initialization is invoked by setting MACWBCI to a value ≥ 0. With the new code changes, however, if MACWBCI is set to a value ≤  -1.0, a longitudinal set of initial concentrations is read from the longitudinal profile input file for every cell in the grid. The cell concentrations are read in units of grams per cubic meter, the same units used for MACWBCI. The model reads initial concentrations for each macrophyte group separately and in order, with one line per segment, and the initial concentrations for each layer read from KT to KB (left to right) as 8-character floating point inputs. This is the same input format as other longitudinal inputs; the macrophyte initial concentrations are placed at the end of that input file. New variables include LONG_MACROPHYTE() and MACCI(). LONG_MACROPHYTE() is a logical, “true” when the user asks to read initial macrophyte concentrations from a longitudinal profile file. MACCI() is a real array holding the longitudinal initial concentrations. The longitudinal concentrations are read and initial macrophyte concentrations and masses are set in the init‑cond.f90 source-code file:


    DO I=cus(jb),ds(jb)
      IF (LONG_MACROPHYTE(JW,M)) READ (LPR(JW),’(//(8X,9F8.0))’) (MACCI(K,I,M),K=KT,KB(I))   ! SR 12/21/11

      depkti=ELWS(i)-el(kti(i)+1,i)
      if(depkti.ge.thrkti)then
        kticol(i)=.true.
        jt=kti(i)
      else
        kticol(i)=.false.
        jt=kti(i)+1
      end if

      je=kb(i)
      DO j=jt,je
        if(j.le.kt)then
          k=kt
        else
          k=j
        end if
        IF (LONG_MACROPHYTE(JW,M)) THEN                                      ! SR 12/21/11
          MACRC(J,K,I,M) = MACCI(K,I,M)                                      ! SR 12/21/11
        ELSE                                                                 ! SR 12/21/11
          macrc(j,K,I,m) = macwbci(jw,m)
        END IF                                                               ! SR 12/21/11
        SMACRC(J,K,I,M) = MACRC(J,K,I,M)                                     ! SR 12/21/11
      END DO
    END DO

Macrophyte initializations are also dealt with in the layeraddsub.f90 and w2_36_gen.f90 source files.

First posted March 1, 2013

For additional information contact:
Director, Oregon Water Science Center
U.S. Geological Survey
2130 SW 5th Avenue
Portland, Oregon 97201
http://or.water.usgs.gov

Part or all of this report is presented in Portable Document Format (PDF); the latest version of Adobe Reader or similar software is required to view it. Download the latest version of Adobe Reader, free of charge.

Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USA.gov logo U.S. Department of the Interior | U.S. Geological Survey
URL: http://pubsdata.usgs.gov/pubs/sir/2013/5016/section10.html
Page Contact Information: GS Pubs Web Contact
Page Last Modified: Wednesday, 27-Feb-2013 13:16:26 EST