Beispiel #1
0
    def __init__(self, *args, **kwds):
        kwds["identifier"] = kwds.get("identifier", "hypr")
        super().__init__(*args, **kwds)

        self.config.update(
            hrus=(HYPR.HRU(),),
            subbasins=(
                Sub(
                    subbasin_id=1,
                    name="sub_001",
                    downstream_id=-1,
                    profile="None",
                    gauged=True,
                ),
            ),
        )

        #########
        # R V P #
        #########

        rvp_tmpl = """
        :SoilClasses
         :Attributes,
         :Units,
           TOPSOIL,
           SLOW_RES,
           FAST_RES,
        :EndSoilClasses

        :VegetationClasses
         :Attributes,   MAX_HT, MAX_LAI, MAX_LEAF_COND
         :Units,        m,      none,    mm_per_s
           FOREST,      0.0,     0.0,    1e99
        :EndVegetationClasses


        :LandUseClasses
         :Attributes, IMPERM, FOREST_COV
         :Units     ,   frac,       frac
              OPEN_1,    0.0,        0.0
        :EndLandUseClasses

        # TRANSLATION OF HYPR PARAMETERS
        # -------------------------------------------------------
        # HYPR --> RAVEN
        # ................
        # TT              --> DD_MELT_TEMP                                         x01
        # TT              --> RAINSNOW_TEMP                                        x02
        # CWH             --> SNOW_SWI                                             x03
        # LP              --> FIELD_CAPACITY                                       x04
        # K0              --> BASEFLOW_COEFF[2]                                    x05
        # K1              --> BASEFLOW_COEFF[1]                                    x06
        # B               --> PDMROF_B                                             x07
        # MAXPA           --> MAX_DEP_AREA_FRAC                                    x08
        # PWR             --> PONDED_EXP = 2/PWR                                   x09
        # UZL             --> Threshhold storage = STORAGE_THRESHOLD               x10
        # FC              --> max storage capacity  = THICKNESS[0]*POROSITY[0]     x11
        # CRFR            --> REFREEZE_FACTOR                                      x12
        # MRF             --> HBV_MELT_FOR_CORR                                    x13
        # CMAX            --> DEP_MAX = CMAX/(B+1)                                 x14
        # MAXBAS          --> TIME_CONC                                            x15
        # BETA            --> HBV_BETA                                             x16
        # C0=KMIN         --> MELT_FACTOR                                          x17
        # C0=KMIN         --> MIN_MELT_FACTOR                                      x18
        # TCALT           --> AdiabaticLapseRate (from HBV)                        x19
        # PCALT           --> PRECIP_LAPSE       (from HBV)                        x20
        # SCF             --> :SnowCorrection                                      x21
        #

        #
        # ETF hard coded as 0.5 in Raven (here =0.0687) line 318 evaporation.cpp

        #---------------------------------------------------------

        #:SoilProfiles
        # name, layers, [soilClass, thickness] x layers
        #
        :SoilProfiles
           DEFAULT_P, 3, TOPSOIL, {params.par_x11}, FAST_RES,1e99, SLOW_RES, 1e99
        :EndSoilProfiles

        # --- Parameter Specification ----------------------------

        :GlobalParameter RAINSNOW_TEMP   {params.par_x02}
        #                                para_x02 = TT
        :GlobalParameter RAINSNOW_DELTA  0.0
        :GlobalParameter SNOW_SWI        {params.par_x03} # para_x03 = CWH
        :AdiabaticLapseRate              {params.par_x19} # para_x19 = TCALT
        :GlobalParameter PRECIP_LAPSE    {params.par_x20} # para_x20 = PCALT

        :SoilParameterList
          :Parameters, POROSITY,   FIELD_CAPACITY, SAT_WILT,         HBV_BETA, MAX_CAP_RISE_RATE, MAX_PERC_RATE,   BASEFLOW_COEFF, BASEFLOW_N,  BASEFLOW_COEFF2, STORAGE_THRESHOLD
          :Units     ,     none,             none,     none,             none,              mm/d,          mm/d,              1/d,       none,              1/d,                mm,
        #   [DEFAULT],      1.0,         para_x04,      0.0,         para_x16,              0.0,            0.0,              0.0,        0.0,              0.0,               0.0,
            [DEFAULT],      1.0, {params.par_x04},      0.0, {params.par_x16},              0.0,            0.0,              0.0,        0.0,              0.0,               0.0,
        #    FAST_RES, _DEFAULT,         _DEFAULT,      0.0,         _DEFAULT,         _DEFAULT,            0.0,         para_x06,        1.0,         para_x05,          para_x10,
             FAST_RES, _DEFAULT,         _DEFAULT,      0.0,         _DEFAULT,         _DEFAULT,            0.0, {params.par_x06},        1.0, {params.par_x05},   {params.par_x10},
             SLOW_RES, _DEFAULT,         _DEFAULT,      0.0,         _DEFAULT,         _DEFAULT,       _DEFAULT,           0.01,        1.0,            0.05,                 0,
        :EndSoilParameterList

        :VegetationParameterList
          :Parameters, SAI_HT_RATIO, MAX_CAPACITY, MAX_SNOW_CAPACITY, TFRAIN, TFSNOW
          :Units     ,         none,           mm,                mm,   frac,   frac
               FOREST,          0.0,        10000,             10000,    1.0,    1.0
        :EndVegetationParameterList

        :LandUseParameterList
          :Parameters ,      MELT_FACTOR,  MIN_MELT_FACTOR,   HBV_MELT_FOR_CORR,  REFREEZE_FACTOR, HBV_MELT_ASP_CORR,     DD_MELT_TEMP, FOREST_COVERAGE
          :Units      ,           mm/d/K,           mm/d/K,                none,           mm/d/K,              none,             degC,             0.1
          #           ,            KminA,            KminB,                 MRF,             CRFR,                AM,               TT,               0
          #  [DEFAULT],         para_x17,         para_x18,            para_x13,         para_x12,              0.00,         para_x01,             0.0
             [DEFAULT], {params.par_x17}, {params.par_x18},    {params.par_x13}, {params.par_x12},              0.00, {params.par_x01},             0.0
        :EndLandUseParameterList

        :LandUseParameterList
          :Parameters,       PONDED_EXP,         PDMROF_B,             DEP_MAX, MAX_DEP_AREA_FRAC,
          :Units     ,             none,             none,                  mm,              none,
          #          ,            2/PWR,                B, SMAX=CMAX*(1/(B+1)),             MAXPA,
          # [DEFAULT],         para_x09,         para_x07,            para_x14,          para_x08,
          [DEFAULT],   {params.par_x09}, {params.par_x07},    {params.par_x14},  {params.par_x08},
        :EndLandUseParameterList
        """
        self.config.rvp.set_tmpl(rvp_tmpl)

        #########
        # R V I #
        #########

        rvi_tmpl = """
        :Routing                     {routing}
        :CatchmentRoute              TRIANGULAR_UH

        :Evaporation                 {evaporation}
        :OW_Evaporation              {ow_evaporation}
        :RainSnowFraction            {rain_snow_fraction}
        :SWRadiationMethod           SW_RAD_DEFAULT
        :SWCloudCorrect              SW_CLOUD_CORR_NONE
        :SWCanopyCorrect             SW_CANOPY_CORR_NONE
        :LWRadiationMethod           LW_RAD_DEFAULT
        :PotentialMeltMethod         POTMELT_HBV
        :CloudCoverMethod            CLOUDCOV_NONE
        :PrecipIceptFract            PRECIP_ICEPT_USER
        :MonthlyInterpolationMethod  MONTHINT_LINEAR_21

        :SoilModel               SOIL_MULTILAYER 3

        #------------------------------------------------------------------------
        # Soil Layer Alias Definitions
        #
        :Alias       FAST_RESERVOIR SOIL[1]
        :Alias       SLOW_RESERVOIR SOIL[2]
        :LakeStorage SLOW_RESERVOIR

        #------------------------------------------------------------------------
        # Hydrologic process order for HYPR Emulation
        #
        :HydrologicProcesses
          :SnowRefreeze      FREEZE_DEGREE_DAY  SNOW_LIQ        SNOW
          :Precipitation     PRECIP_RAVEN       ATMOS_PRECIP    MULTIPLE
          :CanopyEvaporation CANEVP_ALL         CANOPY          ATMOSPHERE
          :CanopySnowEvap    CANEVP_ALL         CANOPY_SNOW     ATMOSPHERE
          :SnowBalance       SNOBAL_SIMPLE_MELT SNOW            PONDED_WATER
          :Infiltration      INF_HBV            PONDED_WATER    MULTIPLE
          :Flush             RAVEN_DEFAULT      SURFACE_WATER   PONDED_WATER
          :Abstraction       ABST_PDMROF        PONDED_WATER    DEPRESSION
          :Flush             RAVEN_DEFAULT      SURFACE_WATER   FAST_RESERVOIR
          :SoilEvaporation   SOILEVAP_HYPR      MULTIPLE        ATMOSPHERE    #ET from both soils and depressions
          :Baseflow          BASE_LINEAR        FAST_RESERVOIR  SURFACE_WATER
          :Baseflow          BASE_THRESH_STOR   FAST_RESERVOIR  SURFACE_WATER
        :EndHydrologicProcesses
        """
        self.config.rvi.set_tmpl(rvi_tmpl)

        self.config.rvi.routing = RVI.RoutingOptions.NONE
        self.config.rvi.rain_snow_fraction = RVI.RainSnowFractionOptions.HBV
        self.config.rvi.evaporation = RVI.EvaporationOptions.PET_FROMMONTHLY
        self.config.rvi.ow_evaporation = RVI.EvaporationOptions.PET_FROMMONTHLY

        #########
        # R V H #
        #########

        rvh_tmpl = RVH.tmpl
        rvh_tmpl += """
        :SubBasinProperties
        #                                 x_15,
        #                               MAXBAS,
          :Parameters,               TIME_CONC,
          :Units     ,  none,                d,
                     1, {par_x15},
        :EndSubBasinProperties
        """
        self.config.rvh.set_tmpl(rvh_tmpl)

        #########
        # R V C #
        #########

        self.config.rvc.hru_states[1] = HRUState(soil0=10, soil1=10, depression=20)
Beispiel #2
0
    def __init__(self, *args, **kwds):
        kwds["identifier"] = kwds.get("identifier", "blended")
        super().__init__(*args, **kwds)

        self.config.update(
            hrus=(BLENDED.ForestHRU(), ),
            subbasins=(Sub(
                subbasin_id=1,
                name="sub_001",
                downstream_id=-1,
                profile="None",
                gauged=True,
            ), ),
            land_use_classes=(LU("FOREST",
                                 impermeable_frac=0.0,
                                 forest_coverage=0.02345), ),
            evaporation="PET_OUDIN",
            rain_snow_fraction=RVI.RainSnowFractionOptions.HBV,
        )

        #########
        # R V P #
        #########

        rvp_tmpl = """
        # tied parameters:
        # (it is important for OSTRICH to find every parameter place holder somewhere in this file)
        # (without this "5.421821E-02" and "1.596675E-01" and "2.169724E-01" wouldn't be detectable)
        #    para_1.705806E+00 = 1.705806E+00 =  para_x24 + para_x25 = 1.651588E+00 + 5.421821E-02
        #    para_2.070342E-01 = 2.070342E-01 =  para_x13 + para_x14 = 4.736668E-02 + 1.596675E-01
        #    para_2.518350E-01 = 2.518350E-01 =  para_x09 + para_x10 = 3.486263E-02 + 2.169724E-01
        #    para_2.254976E-04     = 2.254976E-04     =  10^(para_x04)       = 10^-3.646858E+00
        #    para_2.279250E-04     = 2.279250E-04     =  10^(para_x11)       = 10^-3.642208E+00

        #-----------------------------------------------------------------
        # Soil Classes
        #-----------------------------------------------------------------
        :SoilClasses
          :Attributes,
          :Units,
          TOPSOIL,
          PHREATIC,
          DEEP_GW
        :EndSoilClasses

        #-----------------------------------------------------------------
        # Land Use Classes
        #-----------------------------------------------------------------
        {land_use_classes}

        #-----------------------------------------------------------------
        # Vegetation Classes
        #-----------------------------------------------------------------
        :VegetationClasses,
          :Attributes,        MAX_HT,       MAX_LAI, MAX_LEAF_COND,
               :Units,             m,          none,      mm_per_s,
               FOREST,             4,             5,             5,
        :EndVegetationClasses

        #-----------------------------------------------------------------
        # Soil Profiles
        #-----------------------------------------------------------------
        :SoilProfiles
                 LAKE, 0
                 ROCK, 0
                 DEFAULT_P, 3, TOPSOIL,  {params.par_x29}, PHREATIC, {params.par_x30}, DEEP_GW, 1e6
        #        DEFAULT_P, 3, TOPSOIL,         x(29), PHREATIC,        x(30), DEEP_GW, 1e6
        :EndSoilProfiles

        #-----------------------------------------------------------------
        # Terrain Classes
        #-----------------------------------------------------------------
        :TerrainClasses
          :Attributes,        hillslope_len, drainage_dens,                 lambda,
               :Units,                   ??,            ??,                     ??
            DEFAULT_T,                  1.0,           1.0,           {params.par_x07}
        #                                                     TOPMODEL_LAMBDA x(7)
        :EndTerrainClasses

        #-----------------------------------------------------------------
        # Global Parameters
        #-----------------------------------------------------------------
        :GlobalParameter         SNOW_SWI_MIN {params.par_x13}  #  x(13)
        :GlobalParameter         SNOW_SWI_MAX {params.par_x14}  #  x(13)+x(14)
        :GlobalParameter     SWI_REDUCT_COEFF {params.par_x15}  #  x(15)
        :GlobalParameter             SNOW_SWI {params.par_x19}  #  x(19)
        :GlobalParameter        RAINSNOW_TEMP {params.par_x31}  #  x(31)
        :GlobalParameter       RAINSNOW_DELTA {params.par_x32}  #  x(32)
        #:GlobalParameter      TOC_MULTIPLIER 1.0               #


        #-----------------------------------------------------------------
        # Soil Parameters
        #-----------------------------------------------------------------
        :SoilParameterList
          :Parameters,        POROSITY,        PERC_COEFF,    PET_CORRECTION,     BASEFLOW_COEFF,             B_EXP,          HBV_BETA,   MAX_BASEFLOW_RATE,       BASEFLOW_N,    FIELD_CAPACITY,         SAT_WILT,
               :Units,               -,               1/d,                 -,                1/d,
              TOPSOIL,             1.0,  {params.par_x28},  {params.par_x08},    {params.par_x04}, {params.par_x02},  {params.par_x03},    {params.par_x05}, {params.par_x06},  {params.par_x10}, {params.par_x09},
             PHREATIC,             1.0,  {params.par_x35},               0.0,    {params.par_x11},              0.0,               0.0,                 0.0, {params.par_x12},               0.0,              0.0,
              DEEP_GW,             1.0,               0.0,               0.0,                 0.0,              0.0,               0.0,                 0.0,              0.0,               0.0,              0.0,
         #    TOPSOIL,             1.0,             x(28),             x(08),               x(04),            x(02),             x(03),               x(05),            x(06),       x(09)+x(10),            x(09),
         #   PHREATIC,             1.0,             x(35),               0.0,               x(11),              0.0,               0.0,                 0.0,            x(12),               0.0,              0.0,
         #    DEEP_GW,             1.0,               0.0,               0.0,                 0.0,              0.0,               0.0,                 0.0,              0.0,               0.0,              0.0,
        :EndSoilParameterList

        #-----------------------------------------------------------------
        # Land Use Parameters
        #-----------------------------------------------------------------
        :LandUseParameterList
          :Parameters,  MIN_MELT_FACTOR,     MAX_MELT_FACTOR,     DD_MELT_TEMP,   DD_AGGRADATION,  REFREEZE_FACTOR,     REFREEZE_EXP,     DD_REFREEZE_TEMP,     HMETS_RUNOFF_COEFF,
               :Units,           mm/d/C,              mm/d/C,                C,             1/mm,           mm/d/C,                -,                    C,                      -,
            [DEFAULT], {params.par_x24},    {params.par_x25}, {params.par_x26}, {params.par_x27}, {params.par_x18}, {params.par_x17},     {params.par_x16},       {params.par_x01},
        #                        x(24),         x(24)+x(25),           x(26),           x(27),               x(18),            x(17),                x(16),                  x(01),
        :EndLandUseParameterList
        :LandUseParameterList
          :Parameters,       GAMMA_SHAPE,         GAMMA_SCALE,        GAMMA_SHAPE2,        GAMMA_SCALE2,    FOREST_SPARSENESS,
               :Units,                 -,                   -,                   -,                   -,                    -,
            [DEFAULT],  {params.par_x20},    {params.par_x21},    {params.par_x22},    {params.par_x23},                  0.0,
            #                      x(20),               x(21),               x(22),               x(23),                  0.0,
        :EndLandUseParameterList

        #-----------------------------------------------------------------
        # Vegetation Parameters
        #-----------------------------------------------------------------
        :VegetationParameterList
          :Parameters,  RAIN_ICEPT_PCT,  SNOW_ICEPT_PCT,    SAI_HT_RATIO
               :Units,               -,               -,               -
            [DEFAULT],             0.0,             0.0,             0.0
        :EndVegetationParameterList

        :SeasonalRelativeLAI
          FOREST, 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
        :EndSeasonalRelativeLAI
        :SeasonalRelativeHeight
          FOREST, 1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
        :EndSeasonalRelativeHeight
        """
        self.config.rvp.set_tmpl(rvp_tmpl)

        #########
        # R V I #
        #########

        rvi_tmpl = """
        :PotentialMeltMethod     POTMELT_HMETS
        :RainSnowFraction        {rain_snow_fraction}
        :Evaporation             {evaporation}         # PET_OUDIN
        :CatchmentRoute          ROUTE_DUMP
        :Routing                 ROUTE_NONE
        :SoilModel               SOIL_MULTILAYER 3

        :Alias DELAYED_RUNOFF CONVOLUTION[1]

        :HydrologicProcesses
          :Precipitation   RAVEN_DEFAULT                         ATMOS_PRECIP   MULTIPLE
          :ProcessGroup #infiltration group
                        :Infiltration    INF_HMETS               PONDED_WATER   MULTIPLE
                        :Infiltration    INF_VIC_ARNO            PONDED_WATER   MULTIPLE
                        :Infiltration    INF_HBV                 PONDED_WATER   MULTIPLE
          :EndProcessGroup CALCULATE_WTS {params.par_r01} {params.par_r02}
          #                              para_r01 para_r02
                          :Overflow      OVERFLOW_RAVEN          SOIL[0]        DELAYED_RUNOFF
          :ProcessGroup #quickflow group
                        :Baseflow        BASE_LINEAR_ANALYTIC    SOIL[0]        SURFACE_WATER   # interflow, really
                        :Baseflow        BASE_VIC                SOIL[0]        SURFACE_WATER
                        :Baseflow        BASE_TOPMODEL           SOIL[0]        SURFACE_WATER
          :EndProcessGroup CALCULATE_WTS {params.par_r03} {params.par_r04}
          #                              para_r03 para_r04
          :Percolation                   PERC_LINEAR             SOIL[0]        SOIL[1]         # recharge
            :Overflow                    OVERFLOW_RAVEN          SOIL[1]        DELAYED_RUNOFF
          :Percolation                   PERC_LINEAR             SOIL[1]        SOIL[2]         # loss to deep groundwater (simplifies to HMETS when PERC_COEFF DEEP_GW=0)
          :ProcessGroup #evaporation group
                        :SoilEvaporation SOILEVAP_ALL            SOIL[0]        ATMOSPHERE      # AET
                        :SoilEvaporation SOILEVAP_TOPMODEL       SOIL[0]        ATMOSPHERE      # AET
          :EndProcessGroup CALCULATE_WTS {params.par_r05}
          #                              para_r05
          :Convolve                      CONVOL_GAMMA            CONVOLUTION[0] SURFACE_WATER   # 'surface runoff'
          :Convolve                      CONVOL_GAMMA_2          DELAYED_RUNOFF SURFACE_WATER   # 'delayed runoff'
          :ProcessGroup #quickflow group
                        :Baseflow        BASE_LINEAR_ANALYTIC    SOIL[1]        SURFACE_WATER
                        :Baseflow        BASE_POWER_LAW          SOIL[1]        SURFACE_WATER
          :EndProcessGroup CALCULATE_WTS {params.par_r06}
          #                              para_r06
          :ProcessGroup #snow balance group
                        :SnowBalance     SNOBAL_HMETS            MULTIPLE       MULTIPLE
                        :SnowBalance     SNOBAL_SIMPLE_MELT      SNOW           PONDED_WATER
                        :SnowBalance     SNOBAL_HBV              MULTIPLE       MULTIPLE
                        #:SnowBalance    SNOBAL_GAWSER           MULTIPLE       MULTIPLE
          :EndProcessGroup CALCULATE_WTS {params.par_r07} {params.par_r08}
          #                              para_r07 para_r08
        :EndHydrologicProcesses
        """
        self.config.rvi.set_tmpl(rvi_tmpl)
Beispiel #3
0
    def __init__(self, *args, **kwds):
        kwds["identifier"] = kwds.get("identifier", "gr4jcn")
        super().__init__(*args, **kwds)

        self.config.update(
            hrus=(GR4JCN.LandHRU(), ),
            subbasins=(Sub(
                subbasin_id=1,
                name="sub_001",
                downstream_id=-1,
                profile="None",
                gauged=True,
            ), ),
        )

        #########
        # R V P #
        #########

        rvp_tmpl = """
        # -Global snow parameters-------------------------------------
        :RainSnowTransition 0 1.0
        :AirSnowCoeff       {one_minus_CEMANEIGE_X2}  # [1/d] = 1.0 - CEMANEIGE_X2 = 1.0 - x6
        :AvgAnnualSnow      {params.CEMANEIGE_X1}            # [mm]  =       CEMANEIGE_X1 =       x5

        # -Orographic Corrections-------------------------------------
        :PrecipitationLapseRate 0.0004
        :AdiabaticLapseRate 0.0065

        # - Soil classes ---------------------------------------------
        :SoilClasses
          :Attributes
          :Units
           SOIL_PROD
           SOIL_ROUT
           SOIL_TEMP
           SOIL_GW
           AQUIFER
        :EndSoilClasses
        :SoilParameterList
         :Parameters, POROSITY ,  GR4J_X3, GR4J_X2
         :Units     ,     none ,       mm,    mm/d
           [DEFAULT],      1.0 ,     {params.GR4J_X3},     {params.GR4J_X2}
        :EndSoilParameterList

        # ----Soil Profiles--------------------------------------------
        #     name,#horizons,(soiltype,thickness)x(#horizons)
        #     GR4J_X1 is thickness of first layer (SOIL_PROD), here {params.GR4J_X1}
        :SoilProfiles
          DEFAULT_P,      4, SOIL_PROD   ,   {params.GR4J_X1}, SOIL_ROUT  ,   0.300, SOIL_TEMP  ,   1.000, SOIL_GW  ,   1.000,
          LAKE,           0
        :EndSoilProfiles

        # ----Vegetation Classes---------------------------------------
        :VegetationClasses
           :Attributes,       MAX_HT,       MAX_LAI,      MAX_LEAF_COND
                :Units,            m,          none,           mm_per_s
               VEG_ALL,           0.0,          0.0,                0.0
               VEG_WATER,         0.0,          0.0,                0.0
        :EndVegetationClasses

        # --Land Use Classes------------------------------------------
        :LandUseClasses
          :Attributes, IMPERM, FOREST_COV
          :Units     ,   frac,       frac
               LU_ALL,    0.0,        0.0
               LU_WATER,  0.0,        0.0
        :EndLandUseClasses
        :LandUseParameterList
         :Parameters, GR4J_X4, MELT_FACTOR
         :Units     ,       d,      mm/d/C
           [DEFAULT],    {params.GR4J_X4},        7.73
        :EndLandUseParameterList

        {avg_annual_runoff}

        # List of channel profiles
        {channel_profiles}
        """
        self.config.rvp.set_tmpl(rvp_tmpl)

        #########
        # R V I #
        #########

        rvi_tmpl = """
        :SoilModel             SOIL_MULTILAYER  4
        :Routing               {routing}
        :CatchmentRoute        ROUTE_DUMP
        :Evaporation           {evaporation}
        :RainSnowFraction      {rain_snow_fraction}

        :PotentialMeltMethod   POTMELT_DEGREE_DAY
        :OroTempCorrect        OROCORR_SIMPLELAPSE
        :OroPrecipCorrect      OROCORR_SIMPLELAPSE

        #------------------------------------------------------------------------
        # Soil Layer Alias Definitions
        #
        :Alias PRODUCT_STORE      SOIL[0]
        :Alias ROUTING_STORE      SOIL[1]
        :Alias TEMP_STORE         SOIL[2]
        :Alias GW_STORE           SOIL[3]

        #------------------------------------------------------------------------
        # Hydrologic process order for GR4J Emulation
        #
        :HydrologicProcesses
         :Precipitation            PRECIP_RAVEN       ATMOS_PRECIP    MULTIPLE
         :SnowTempEvolve           SNOTEMP_NEWTONS    SNOW_TEMP
         :SnowBalance              SNOBAL_CEMA_NIEGE  SNOW            PONDED_WATER
         :OpenWaterEvaporation     OPEN_WATER_EVAP    PONDED_WATER    ATMOSPHERE     			 # Pn
         :Infiltration             INF_GR4J           PONDED_WATER    MULTIPLE       			 # Ps-
         :SoilEvaporation          SOILEVAP_GR4J      PRODUCT_STORE   ATMOSPHERE     			 # Es
         :Percolation              PERC_GR4J          PRODUCT_STORE   TEMP_STORE     			 # Perc
         :Flush                    RAVEN_DEFAULT      SURFACE_WATER   TEMP_STORE     			 # Pn-Ps
         :Split                    RAVEN_DEFAULT      TEMP_STORE      CONVOLUTION[0] CONVOLUTION[1] 0.9  # Split Pr
         :Convolve                 CONVOL_GR4J_1      CONVOLUTION[0]  ROUTING_STORE  			 # Q9
         :Convolve                 CONVOL_GR4J_2      CONVOLUTION[1]  TEMP_STORE     			 # Q1
         :Percolation              PERC_GR4JEXCH      ROUTING_STORE   GW_STORE       			 # F(x1)
         :Percolation              PERC_GR4JEXCH2     TEMP_STORE      GW_STORE       			 # F(x1)
         :Flush                    RAVEN_DEFAULT      TEMP_STORE      SURFACE_WATER  			 # Qd
         :Baseflow                 BASE_GR4J          ROUTING_STORE   SURFACE_WATER  			 # Qr
        :EndHydrologicProcesses
        """
        self.config.rvi.set_tmpl(rvi_tmpl)

        self.config.rvi.rain_snow_fraction = RVI.RainSnowFractionOptions.DINGMAN
        self.config.rvi.evaporation = "PET_OUDIN"
Beispiel #4
0
    def test_routing(self):
        """We need at least 2 subbasins to activate routing."""
        model = GR4JCN()

        ts_2d = get_local_testdata(
            "raven-gr4j-cemaneige/Salmon-River-Near-Prince-George_meteo_daily_2d.nc"
        )

        #########
        # R V I #
        #########

        model.config.rvi.start_date = dt.datetime(2000, 1, 1)
        model.config.rvi.end_date = dt.datetime(2002, 1, 1)
        model.config.rvi.run_name = "test_gr4jcn_routing"
        model.config.rvi.routing = "ROUTE_DIFFUSIVE_WAVE"

        #########
        # R V H #
        #########

        # Here we assume that we have two subbasins. The first one (subbasin_id=10)
        # has a lake (hru_id=2; area-100km2) and the rest is covered by land (hru_id=1;
        # area=4250.6km2). The second subbasin (subbasin_id=20) does not contain a
        # lake and is hence only land (hru_id=3; area=2000km2).
        #
        # Later the routing product will tell us which basin flows into which. Here
        # we assume that the first subbasin (subbasin_id=10) drains into the second
        # (subbasin_id=20). At the outlet of this second one we have an observation
        # station (see :ObservationData in RVT). We will compare these observations
        # with the simulated streamflow. That is the reason why "gauged=True" for
        # the second basin.

        # HRU IDs are 1 to 3
        model.config.rvh.hrus = (
            GR4JCN.LandHRU(hru_id=1, subbasin_id=10, **salmon_land_hru_1),
            GR4JCN.LakeHRU(hru_id=2, subbasin_id=10, **salmon_lake_hru_1),
            GR4JCN.LandHRU(hru_id=3, subbasin_id=20, **salmon_land_hru_2),
        )

        # Sub-basin IDs are 10 and 20 (not 1 and 2), to help disambiguate
        model.config.rvh.subbasins = (
            # gauged = False:
            # Usually this output would only be written for user's convenience.
            # There is usually no observation of streamflow available within
            # catchments; only at the outlet. That's most commonly the reason
            # why a catchment is defined as it is defined.
            Sub(
                name="upstream",
                subbasin_id=10,
                downstream_id=20,
                profile="chn_10",
                gauged=False,
            ),
            # gauged = True:
            # Since this is the outlet, this would usually be what we calibrate
            # against (i.e. we try to match this to Qobs).
            Sub(
                name="downstream",
                subbasin_id=20,
                downstream_id=-1,
                profile="chn_20",
                gauged=True,
            ),
        )

        model.config.rvh.land_subbasin_property_multiplier = (
            SBGroupPropertyMultiplierCommand("Land", "MANNINGS_N", 1.0))
        model.config.rvh.lake_subbasin_property_multiplier = (
            SBGroupPropertyMultiplierCommand("Lakes", "RESERVOIR_CREST_WIDTH",
                                             1.0))

        #########
        # R V T #
        #########

        gws = GridWeightsCommand(
            number_hrus=3,
            number_grid_cells=1,
            # Here we have a special case: station is 0 for every row because the example NC
            # has only one region/station (which is column 0)
            data=((1, 0, 1.0), (2, 0, 1.0), (3, 0, 1.0)),
        )
        # These will be shared (inline) to all the StationForcing commands in the RVT
        model.config.rvt.grid_weights = gws

        #########
        # R V P #
        #########

        model.config.rvp.params = model.Params(0.529, -3.396, 407.29, 1.072,
                                               16.9, 0.947)

        total_area_in_km2 = sum(hru.area for hru in model.config.rvh.hrus)
        total_area_in_m2 = total_area_in_km2 * 1000 * 1000
        model.config.rvp.avg_annual_runoff = get_average_annual_runoff(
            ts_2d, total_area_in_m2)

        np.testing.assert_almost_equal(model.config.rvp.avg_annual_runoff,
                                       139.5407534171111)

        # These channel profiles describe the geometry of the actual river crossection.
        # The eight points (x) to describe the following geometry are given in each
        # profile:
        #
        # ----x                                     x---
        #      \           FLOODPLAIN             /
        #       x----x                     x----x
        #             \                  /
        #               \   RIVERBED   /
        #                 x----------x
        #
        model.config.rvp.channel_profiles = [
            ChannelProfileCommand(
                name="chn_10",
                bed_slope=7.62066e-05,
                survey_points=[
                    (0, 463.647),
                    (16.0, 459.647),
                    (90.9828, 459.647),
                    (92.9828, 458.647),
                    (126.4742, 458.647),
                    (128.4742, 459.647),
                    (203.457, 459.647),
                    (219.457, 463.647),
                ],
                roughness_zones=[
                    (0, 0.0909167),
                    (90.9828, 0.035),
                    (128.4742, 0.0909167),
                ],
            ),
            ChannelProfileCommand(
                name="chn_20",
                bed_slope=9.95895e-05,
                survey_points=[
                    (0, 450.657),
                    (16.0, 446.657),
                    (85.0166, 446.657),
                    (87.0166, 445.657),
                    (117.5249, 445.657),
                    (119.5249, 446.657),
                    (188.54149999999998, 446.657),
                    (204.54149999999998, 450.657),
                ],
                roughness_zones=[
                    (0, 0.0915769),
                    (85.0166, 0.035),
                    (119.5249, 0.0915769),
                ],
            ),
        ]

        #############
        # Run model #
        #############

        model(ts_2d)

        ###########
        # Verify  #
        ###########

        hds = model.q_sim

        assert len(hds.nbasins) == 1  # number of "gauged" basins is 1

        # We only have one SB with gauged=True, so the output has a single column.
        # The number of time steps simulated between (2000, 1, 1) and
        # (2002, 1, 1) is 732.
        assert hds.shape == (732, 1)

        # Check simulated streamflow at first three timesteps and three simulated
        # timesteps in the middle of the simulation period.
        dates = (
            "2000-01-01",
            "2000-01-02",
            "2000-01-03",
            "2001-01-30",
            "2001-01-31",
            "2001-02-01",
        )

        target_q_sim = [
            0.0, 0.304073, 0.980807, 17.54049, 17.409493, 17.437954
        ]

        for t in range(6):
            np.testing.assert_almost_equal(hds.sel(nbasins=0, time=dates[t]),
                                           target_q_sim[t], 4)

        # For lumped GR4J model we have 1 subbasin and 1 HRU as well as no routing, no
        # channel profiles, and the area of the entire basin is 4250.6 [km2]. Comparison
        # of simulated and observed streamflow at outlet yielded:
        # np.testing.assert_almost_equal(d["DIAG_NASH_SUTCLIFFE"], -0.116971, 4)
        #
        # This is now a different value due to:
        # - basin we have here is larger (4250.6 [km2] + 100 [km2] + 2000.0 [km2])
        # - we do routing: so water from subbasin 1 needs some time to arrive at the
        #   outlet of subbasin 2
        d = model.diagnostics
        np.testing.assert_almost_equal(d["DIAG_NASH_SUTCLIFFE"], -0.0141168, 4)
Beispiel #5
0
    def __init__(self, *args, **kwds):
        kwds["identifier"] = kwds.get("identifier", "mohyse")
        super().__init__(*args, **kwds)

        self.config.update(
            hrus=(GR4JCN.LandHRU(), ),
            subbasins=(Sub(
                subbasin_id=1,
                name="sub_001",
                downstream_id=-1,
                profile="None",
                gauged=True,
            ), ),
        )

        #########
        # R V P #
        #########

        rvp_tmpl = """
        #-----------------------------------------------------------------
        # Soil Classes
        #-----------------------------------------------------------------
        :SoilClasses
          :Attributes,
          :Units,
          TOPSOIL
          GWSOIL
        :EndSoilClasses

        #-----------------------------------------------------------------
        # Land Use Classes
        #-----------------------------------------------------------------
        :LandUseClasses,
          :Attributes,        IMPERM,    FOREST_COV,
          :Units,             frac,      frac,
          LU_ALL,             0.0,       1.0
        :EndLandUseClasses

        #-----------------------------------------------------------------
        # Vegetation Classes
        #-----------------------------------------------------------------
        :VegetationClasses,
          :Attributes,        MAX_HT,       MAX_LAI,    MAX_LEAF_COND,
          :Units,             m,            none,       mm_per_s,
         VEG_ALL,             0.0,          0.0,        0.0
        :EndVegetationClasses

        #-----------------------------------------------------------------
        # Soil Profiles
        #-----------------------------------------------------------------
        :SoilProfiles
                 LAKE, 0
                 ROCK, 0
               # DEFAULT_P,      2, TOPSOIL, MOHYSE_PARA_5, GWSOIL, 10.0
                 DEFAULT_P,      2, TOPSOIL,     {params.par_x05}, GWSOIL, 10.0
        :EndSoilProfiles

        #-----------------------------------------------------------------
        # Global Parameters
        #-----------------------------------------------------------------
        #:GlobalParameter      RAINSNOW_TEMP              -2.0
        :GlobalParameter       TOC_MULTIPLIER              1.0
        # :GlobalParameter     MOHYSE_PET_COEFF  MOHYSE_PARA_1
        :GlobalParameter       MOHYSE_PET_COEFF      {params.par_x01}

        #-----------------------------------------------------------------
        # Soil Parameters
        #-----------------------------------------------------------------
        :SoilParameterList
          :Parameters,        POROSITY,  PET_CORRECTION,        HBV_BETA,  BASEFLOW_COEFF,      PERC_COEFF,
               :Units,               -,               -,               -,             1/d,             1/d, # (units not generated by .rvp template)
            # TOPSOIL,            1.0 ,             1.0,             1.0,   MOHYSE_PARA_7,   MOHYSE_PARA_6,
            #  GWSOIL,            1.0 ,             1.0,             1.0,   MOHYSE_PARA_8,             0.0,
              TOPSOIL,            1.0 ,             1.0,             1.0,       {params.par_x07},       {params.par_x06},
               GWSOIL,            1.0 ,             1.0,             1.0,       {params.par_x08},             0.0,
        :EndSoilParameterList

        #-----------------------------------------------------------------
        # Land Use Parameters
        #-----------------------------------------------------------------
        :LandUseParameterList
          :Parameters,     MELT_FACTOR,       AET_COEFF, FOREST_SPARSENESS, DD_MELT_TEMP,
               :Units,          mm/d/K,            mm/d,                 -,         degC,
          # [DEFAULT],   MOHYSE_PARA_3,   MOHYSE_PARA_2,               0.0,MOHYSE_PARA_4,
            [DEFAULT],       {params.par_x03},       {params.par_x02},               0.0,    {params.par_x04},
        :EndLandUseParameterList

        #-----------------------------------------------------------------
        # Vegetation Parameters
        #-----------------------------------------------------------------
        :VegetationParameterList
          :Parameters,    SAI_HT_RATIO,  RAIN_ICEPT_PCT,  SNOW_ICEPT_PCT,
               :Units,               -,               -,               -,
            [DEFAULT],             0.0,             0.0,             0.0,
        :EndVegetationParameterList
        """
        self.config.rvp.set_tmpl(rvp_tmpl)

        #########
        # R V I #
        #########

        rvi_tmpl = """
        :SoilModel             SOIL_TWO_LAYER
        :PotentialMeltMethod   POTMELT_DEGREE_DAY
        :Routing               ROUTE_NONE
        :CatchmentRoute        ROUTE_GAMMA_CONVOLUTION
        :Evaporation           {evaporation}  # PET_MOHYSE
        :DirectEvaporation
        :RainSnowFraction      {rain_snow_fraction}

        :HydrologicProcesses
             :SoilEvaporation  SOILEVAP_LINEAR    SOIL[0]            ATMOSPHERE
             :SnowBalance      SNOBAL_SIMPLE_MELT SNOW PONDED_WATER
             :Precipitation    RAVEN_DEFAULT      ATMOS_PRECIP       MULTIPLE
             :Infiltration     INF_HBV            PONDED_WATER       SOIL[0]
             :Baseflow         BASE_LINEAR        SOIL[0]            SURFACE_WATER
             :Percolation      PERC_LINEAR        SOIL[0]            SOIL[1]
             :Baseflow         BASE_LINEAR        SOIL[1]            SURFACE_WATER
        :EndHydrologicProcesses

        #:CreateRVPTemplate

        # :Alias MOHYSE_PARA_1      1.5589    # :GlobalParameter         MOHYSE_PET_COEFF
        # :Alias MOHYSE_PARA_2	    0.9991    # LandUseParameterList --> AET_COEFF
        # :Alias MOHYSE_PARA_3	    2.1511    # LandUseParameterList --> MELT_FACTOR
        # :Alias MOHYSE_PARA_4	   -1.6101    # LandUseParameterList --> DD_MELT_TEMP
        # :Alias MOHYSE_PARA_5	    0.5000    # SoilProfiles         --> thickness of TOPSOIL (in mm????? must be m!!!)
        # :Alias MOHYSE_PARA_6	    0.1050    # SoilParameterList    --> PERC_COEFF (TOPSOIL)
        # :Alias MOHYSE_PARA_7	    0.0533    # SoilParameterList    --> BASEFLOW_COEFF (TOPSOIL)
        # :Alias MOHYSE_PARA_8	    0.0132    # SoilParameterList    --> BASEFLOW_COEFF (GWSOIL)
        # :Alias MOHYSE_PARA_9	    1.0474    # :SubBasinProperties  --> GAMMA_SHAPE
        # :Alias MOHYSE_PARA_10	    7.9628    # :SubBasinProperties  --> TIME_CONC = MOHYSE_PARA_10 / 0.3 = 26.542666666
        """
        self.config.rvi.set_tmpl(rvi_tmpl)

        #########
        # R V H #
        #########

        rvh_tmpl = """
        {subbasins}

        {hrus}

        :SubBasinProperties
        #                  1.0 / MOHYSE_PARA_10,   MOHYSE_PARA_9
           :Parameters,             GAMMA_SCALE,     GAMMA_SHAPE,
           :Units,                          1/d,               -
                      1,         {par_rezi_x10},       {par_x09}
        :EndSubBasinProperties
        """
        self.config.rvh.set_tmpl(rvh_tmpl)

        #########
        # R V I #
        #########

        self.config.rvi.rain_snow_fraction = RVI.RainSnowFractionOptions.DATA
        self.config.rvi.evaporation = "PET_MOHYSE"
Beispiel #6
0
    def __init__(self, *args, **kwds):
        kwds["identifier"] = kwds.get("identifier", "canadianshield")
        super().__init__(*args, **kwds)

        self.config.update(
            hrus=(CANADIANSHIELD.HRU_ORGANIC(), CANADIANSHIELD.HRU_BEDROCK()),
            subbasins=(
                Sub(
                    subbasin_id=1,
                    name="sub_001",
                    downstream_id=-1,
                    profile="None",
                    gauged=True,
                ),
            ),
        )

        #########
        # R V P #
        #########

        rvp_tmpl = """
        # tied parameters:
        # (it is important for OSTRICH to find every parameter place holder somewhere in this file)
        # (without this some parameters wouldn't be detectable)
        #    para_sum_x05_x06 = sum_x05_x06 = {params.par_x05} + {params.par_x06} = para_x05 + para_x06
        #    para_sum_x16_x17 = sum_x16_x17 = {params.par_x16} + {params.par_x17} = para_x16 + para_x17
        #    para_pow_x08     = par_pow_x08 = 10^({params.par_x08}) = 10^para_x08
        #    para_pow_x09     = par_pow_x09 = 10^({params.par_x09}) = 10^para_x09

        #-----------------------------------------------------------------
        # Soil Classes
        #-----------------------------------------------------------------
        :SoilClasses
          :Attributes,
          :Units,
          TOPSOIL,
          VADOSE,
          FRACBEDROCK,
        :EndSoilClasses

        #-----------------------------------------------------------------
        # Soil Profiles
        #-----------------------------------------------------------------
        :SoilProfiles
          LAKE, 0
          ROCK, 0
          SOILP_ORG,     3, TOPSOIL, {params.par_x01},  VADOSE, {params.par_x02},  FRACBEDROCK, {params.par_x03},
          SOILP_BEDROCK, 3, TOPSOIL, {params.par_x01},  VADOSE,             0.00,  FRACBEDROCK, {params.par_x03},
        # SOILP_ORG,     3, TOPSOIL, para_x01, VADOSE, para_x02, FRACBEDROCK, para_x03,
        # SOILP_BEDROCK, 3, TOPSOIL, para_x01, VADOSE, 0.00,     FRACBEDROCK, para_x03,
        :EndSoilProfiles

        #-----------------------------------------------------------------
        # Land Use Classes
        #-----------------------------------------------------------------
        {land_use_classes}

        #-----------------------------------------------------------------
        # Vegetation Classes
        #-----------------------------------------------------------------
        :VegetationClasses,
                :Attributes,            MAX_HT, MAX_LAI, MAX_LEAF_COND,
                :Units,                      m,    none,      mm_per_s,
                FOREST,                    5.0,     5.0,           5.0,
        :EndVegetationClasses

        #-----------------------------------------------------------------
        # Global Parameters
        #-----------------------------------------------------------------
        :GlobalParameter          SNOW_SWI {params.par_x15}            # para_x15
        :GlobalParameter      SNOW_SWI_MIN {params.par_x16}            # para_x16
        :GlobalParameter      SNOW_SWI_MAX {params.par_x17}            # para_x16+para_x17
        :GlobalParameter  SWI_REDUCT_COEFF {params.par_x18}            # para_x18
        :GlobalParameter     RAINSNOW_TEMP {params.par_x19}            # para_x19
        :GlobalParameter    RAINSNOW_DELTA {params.par_x20}            # para_x20
        :GlobalParameter   MAX_SWE_SURFACE {params.par_x21}            # para_x21
        :GlobalParameter    TOC_MULTIPLIER {params.par_x22}            # para_x22

        #-----------------------------------------------------------------
        # Soil Parameters
        #-----------------------------------------------------------------
        :SoilParameterList
          :Parameters,        POROSITY,         HBV_BETA,   BASEFLOW_COEFF,       BASEFLOW_N,  MAX_INTERFLOW_RATE,   FIELD_CAPACITY,         SAT_WILT,    MAX_PERC_RATE,   PET_CORRECTION,
               :Units,               -,                -,                -,                -,                   -,                -,                -,                -,                -,
              TOPSOIL,             1.0, {params.par_x07},              0.0,              0.0,    {params.par_x12}, {params.par_x06}, {params.par_x05}, {params.par_x13}, {params.par_x04},
               VADOSE,             1.0,              0.0, {params.par_x08}, {params.par_x10},                 0.0,              0.0,              0.0, {params.par_x14},              0.0,
          FRACBEDROCK,             1.0,              0.0, {params.par_x09}, {params.par_x11},                 0.0,              0.0,              0.0,              0.0,              0.0,
        #     TOPSOIL,             1.0,         para_x07,              0.0,              0.0,            para_x12, para_sum_x05_x06,         para_x05,         para_x13,         para_x04,
        #      VADOSE,             1.0,              0.0,     para_pow_x08,         para_x10,                 0.0,              0.0,              0.0,         para_x14,              0.0,
        # FRACBEDROCK,             1.0,              0.0,     para_pow_x09,         para_x11,                 0.0,              0.0,              0.0,              0.0,              0.0,
        :EndSoilParameterList

        # note: TOPSOIL FIELD_CAPACITY calculated as {params.par_x05} + {params.par_x06}
        # note: TOPSOIL BASEFLOW_COEFF calculated as  10^({params.par_x08})
        # note: PHREATIC BASEFLOW_COEFF calculated as  10^({params.par_x09})

        #-----------------------------------------------------------------
        # Land Use Parameters
        #-----------------------------------------------------------------
        :LandUseParameterList
          :Parameters, FOREST_SPARSENESS,      MELT_FACTOR,     DD_MELT_TEMP,  REFREEZE_FACTOR,          DEP_MAX,      OW_PET_CORR,
               :Units,                 -,                -,                -,                -,                -,                -,
               FOREST,               0.0, {params.par_x25}, {params.par_x24}, {params.par_x23}, {params.par_x26}, {params.par_x27},
        #      FOREST,               0.0,         para_x25,         para_x24,         para_x23,         para_x26,         para_x27,
        :EndLandUseParameterList

        #-----------------------------------------------------------------
        # Vegetation Parameters
        #-----------------------------------------------------------------
        :VegetationParameterList
          :Parameters,  SVF_EXTINCTION,   SAI_HT_RATIO,  RAIN_ICEPT_FACT,  SNOW_ICEPT_FACT,     MAX_CAPACITY, MAX_SNOW_CAPACITY,
               :Units,               -,              -,                -,                -,                -,                 -,
            FOREST,                0.5,            1.0, {params.par_x28}, {params.par_x29}, {params.par_x30},  {params.par_x31},
        #   FOREST,                0.5,            1.0,         para_x28,         para_x29,         para_x30,          para_x31,
        :EndVegetationParameterList


        # Can leave all as 1.0 to keep generic across any watershed. In Ontario would hardcode to reduce ratio over winter months.
        :SeasonalRelativeLAI
                #                 J       F       M       A       M       J       J       A       S       O       N       D
                [DEFAULT]       1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0
        :EndSeasonalRelativeLAI
        :SeasonalRelativeHeight
                #                 J       F       M       A       M       J       J       A       S       O       N       D
                [DEFAULT]       1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0,    1.0
        :EndSeasonalRelativeHeight
        """
        self.config.rvp.set_tmpl(rvp_tmpl)

        #########
        # R V I #
        #########

        rvi_tmpl = """
        :Routing               {routing}
        :CatchmentRoute        ROUTE_TRI_CONVOLUTION
        :Evaporation           {evaporation}
        :OW_Evaporation        {ow_evaporation}
        :SWCanopyCorrect       SW_CANOPY_CORR_STATIC
        :RainSnowFraction      {rain_snow_fraction}
        :PotentialMeltMethod   POTMELT_DEGREE_DAY
        :PrecipIceptFract      PRECIP_ICEPT_LAI
        :SoilModel             SOIL_MULTILAYER 3

        :MonthlyInterpolationMethod MONTHINT_LINEAR_MID

        :Alias TOPSOIL          SOIL[0]
        :Alias VADOSE           SOIL[1]
        :Alias FRACBEDROCK      SOIL[2]

        :HydrologicProcesses
            :SnowRefreeze             FREEZE_DEGREE_DAY    SNOW_LIQ        SNOW
            :Precipitation            PRECIP_RAVEN         ATMOS_PRECIP    MULTIPLE
            :CanopyEvaporation        CANEVP_MAXIMUM       CANOPY          ATMOSPHERE
            :CanopySnowEvap           CANEVP_MAXIMUM       CANOPY_SNOW     ATMOSPHERE
            :SnowBalance              SNOBAL_TWO_LAYER     MULTIPLE        MULTIPLE
            :Abstraction              ABST_FILL            PONDED_WATER    DEPRESSION
            :OpenWaterEvaporation     OPEN_WATER_EVAP      DEPRESSION      ATMOSPHERE
            :Infiltration             INF_HBV              PONDED_WATER    MULTIPLE
            :Interflow                INTERFLOW_PRMS       TOPSOIL         SURFACE_WATER
            :Baseflow                 BASE_POWER_LAW       VADOSE          SURFACE_WATER
                  :-->Conditional HRU_TYPE IS SOIL_ORG
            :Baseflow                 BASE_POWER_LAW       FRACBEDROCK     SURFACE_WATER
                :Percolation          PERC_GAWSER          TOPSOIL         VADOSE
                  :-->Conditional HRU_TYPE IS SOIL_ORG
            :Percolation              PERC_GAWSER          VADOSE          FRACBEDROCK
                  :-->Conditional HRU_TYPE IS SOIL_ORG
                :Percolation          PERC_GAWSER          TOPSOIL         FRACBEDROCK
                  :-->Conditional HRU_TYPE IS SOIL_BEDROCK
            :SoilEvaporation          SOILEVAP_ROOT        TOPSOIL         ATMOSPHERE
        :EndHydrologicProcesses
        """

        self.config.rvi.set_tmpl(rvi_tmpl)

        self.config.rvi.routing = RVI.RoutingOptions.NONE
        self.config.rvi.rain_snow_fraction = RVI.RainSnowFractionOptions.DINGMAN
        self.config.rvi.evaporation = RVI.EvaporationOptions.PET_HARGREAVES_1985
        self.config.rvi.ow_evaporation = RVI.EvaporationOptions.PET_HARGREAVES_1985
Beispiel #7
0
    def __init__(self, *args, **kwds):
        kwds["identifier"] = kwds.get("identifier", "hbvec")
        super().__init__(*args, **kwds)

        self.config.update(
            hrus=(GR4JCN.LandHRU(),),
            subbasins=(
                Sub(
                    subbasin_id=1,
                    name="sub_001",
                    downstream_id=-1,
                    profile="None",
                    gauged=True,
                ),
            ),
        )

        #########
        # R V P #
        #########

        rvp_tmpl = """
        #------------------------------------------------------------------------
        # Global parameters
        #
        #                             HBV_PARA_13=TCALT
        :AdiabaticLapseRate                   {params.par_x13}
        #                                   HBV_PARA_01, CONSTANT,
        :RainSnowTransition                   {params.par_x01},      2.0
        #                                   HBV_PARA_04,
        :IrreducibleSnowSaturation            {params.par_x04}
        #                             HBV_PARA_12=PCALT
        :GlobalParameter PRECIP_LAPSE         {params.par_x12}

        #---------------------------------------------------------
        # Soil classes
        :SoilClasses
         :Attributes,
         :Units,
           TOPSOIL,      1.0,    0.0,       0
           SLOW_RES,     1.0,    0.0,       0
           FAST_RES,     1.0,    0.0,       0
        :EndSoilClasses

        :SoilParameterList
          :Parameters,                POROSITY,FIELD_CAPACITY,    SAT_WILT,    HBV_BETA, MAX_CAP_RISE_RATE,MAX_PERC_RATE,BASEFLOW_COEFF,            BASEFLOW_N
          :Units     ,                    none,          none,        none,        none,              mm/d,         mm/d,           1/d,                  none
          #                        HBV_PARA_05,   HBV_PARA_06, HBV_PARA_14, HBV_PARA_07,       HBV_PARA_16,     CONSTANT,      CONSTANT,              CONSTANT,
            [DEFAULT],               {params.par_x05},     {params.par_x06},   {params.par_x14},    {params.par_x07},        {params.par_x16},          0.0,           0.0,                   0.0
          #                                                       CONSTANT,                                  HBV_PARA_08,   HBV_PARA_09, 1+HBV_PARA_15=1+ALPHA,
             FAST_RES,                _DEFAULT,      _DEFAULT,         0.0,    _DEFAULT,          _DEFAULT,    {params.par_x08},     {params.par_x09},    {one_plus_par_x15}
          #                                                       CONSTANT,                                                 HBV_PARA_10,              CONSTANT,
             SLOW_RES,                _DEFAULT,      _DEFAULT,         0.0,    _DEFAULT,          _DEFAULT,     _DEFAULT,     {params.par_x10},                   1.0
        :EndSoilParameterList

        #---------------------------------------------------------
        # Soil profiles
        # name, layers, (soilClass, thickness) x layers
        #
        :SoilProfiles
        #                        HBV_PARA_17,           CONSTANT,           CONSTANT,
           DEFAULT_P, 3, TOPSOIL,  {params.par_x17}, FAST_RES,    100.0, SLOW_RES,    100.0
        :EndSoilProfiles

        #---------------------------------------------------------
        # Vegetation classes
        #
        :VegetationClasses
         :Attributes,   MAX_HT,  MAX_LAI, MAX_LEAF_COND
         :Units,             m,     none,      mm_per_s
           VEG_ALL,         25,      6.0,           5.3
        :EndVegetationClasses

        :VegetationParameterList
          :Parameters,  MAX_CAPACITY, MAX_SNOW_CAPACITY,  TFRAIN,  TFSNOW,
          :Units,                 mm,                mm,    frac,    frac,
          VEG_ALL,             10000,             10000,    0.88,    0.88,
        :EndVegetationParameterList

        #---------------------------------------------------------
        # LandUse classes
        #
        :LandUseClasses
         :Attributes,     IMPERM, FOREST_COV
         :Units,            frac,       frac
              LU_ALL,        0.0,          1
        :EndLandUseClasses

        :LandUseParameterList
          :Parameters,   MELT_FACTOR, MIN_MELT_FACTOR,   HBV_MELT_FOR_CORR, REFREEZE_FACTOR, HBV_MELT_ASP_CORR
          :Units     ,        mm/d/K,          mm/d/K,                none,          mm/d/K,              none
          #              HBV_PARA_02,        CONSTANT,         HBV_PARA_18,     HBV_PARA_03,          CONSTANT
            [DEFAULT],     {params.par_x02},             2.2,           {params.par_x18},       {params.par_x03},              0.48
        :EndLandUseParameterList

        :LandUseParameterList
         :Parameters, HBV_MELT_GLACIER_CORR,   HBV_GLACIER_KMIN, GLAC_STORAGE_COEFF, HBV_GLACIER_AG
         :Units     ,                  none,                1/d,                1/d,           1/mm
           #                       CONSTANT,           CONSTANT,        HBV_PARA_19,       CONSTANT,
           [DEFAULT],                  1.64,               0.05,          {params.par_x19},           0.05
        :EndLandUseParameterList
        """
        self.config.rvp.set_tmpl(rvp_tmpl)

        #########
        # R V I #
        #########

        rvi_tmpl = """
        :Routing             	    ROUTE_NONE
        :CatchmentRoute      	    TRIANGULAR_UH

        :Evaporation         	    {evaporation}  # PET_FROM_MONTHLY
        :OW_Evaporation      	    {ow_evaporation}  # PET_FROM_MONTHLY
        :SWRadiationMethod   	    SW_RAD_DEFAULT
        :SWCloudCorrect      	    SW_CLOUD_CORR_NONE
        :SWCanopyCorrect     	    SW_CANOPY_CORR_NONE
        :LWRadiationMethod   	    LW_RAD_DEFAULT
        :RainSnowFraction           {rain_snow_fraction}
        :PotentialMeltMethod 	    POTMELT_HBV
        :OroTempCorrect      	    OROCORR_HBV
        :OroPrecipCorrect    	    OROCORR_HBV
        :OroPETCorrect       	    OROCORR_HBV
        :CloudCoverMethod    	    CLOUDCOV_NONE
        :PrecipIceptFract    	    PRECIP_ICEPT_USER
        :MonthlyInterpolationMethod MONTHINT_LINEAR_21

        :SoilModel                  SOIL_MULTILAYER 3

        #------------------------------------------------------------------------
        # Soil Layer Alias Definitions
        #
        :Alias       FAST_RESERVOIR SOIL[1]
        :Alias       SLOW_RESERVOIR SOIL[2]
        :LakeStorage SLOW_RESERVOIR

        #------------------------------------------------------------------------
        # Hydrologic process order for HBV-EC Emulation
        #
        :HydrologicProcesses
          :SnowRefreeze      FREEZE_DEGREE_DAY  SNOW_LIQ        SNOW
          :Precipitation     PRECIP_RAVEN       ATMOS_PRECIP    MULTIPLE
          :CanopyEvaporation CANEVP_ALL         CANOPY          ATMOSPHERE
          :CanopySnowEvap    CANEVP_ALL         CANOPY_SNOW     ATMOSPHERE
          :SnowBalance       SNOBAL_SIMPLE_MELT SNOW            SNOW_LIQ
            :-->Overflow     RAVEN_DEFAULT      SNOW_LIQ        PONDED_WATER
          :Flush             RAVEN_DEFAULT      PONDED_WATER    GLACIER
            :-->Conditional HRU_TYPE IS GLACIER
          :GlacierMelt       GMELT_HBV          GLACIER_ICE     GLACIER
          :GlacierRelease    GRELEASE_HBV_EC    GLACIER         SURFACE_WATER
          :Infiltration      INF_HBV            PONDED_WATER    MULTIPLE
          :Flush             RAVEN_DEFAULT      SURFACE_WATER   FAST_RESERVOIR
            :-->Conditional HRU_TYPE IS_NOT GLACIER
          :SoilEvaporation   SOILEVAP_HBV       SOIL[0]         ATMOSPHERE
          :CapillaryRise     RISE_HBV           FAST_RESERVOIR 	SOIL[0]
          :LakeEvaporation   LAKE_EVAP_BASIC    SLOW_RESERVOIR  ATMOSPHERE
          :Percolation       PERC_CONSTANT      FAST_RESERVOIR 	SLOW_RESERVOIR
          :Baseflow          BASE_POWER_LAW     FAST_RESERVOIR  SURFACE_WATER
          :Baseflow          BASE_LINEAR        SLOW_RESERVOIR  SURFACE_WATER
        :EndHydrologicProcesses
        """
        self.config.rvi.set_tmpl(rvi_tmpl)

        #########
        # R V H #
        #########

        rvh_tmpl = """
        {subbasins}

        {hrus}

        :SubBasinProperties
        #                       HBV_PARA_11, DERIVED FROM HBV_PARA_11,
        #                            MAXBAS,                 MAXBAS/2,
           :Parameters,           TIME_CONC,             TIME_TO_PEAK
           :Units     ,                   d,                        d,
                     1,            {par_x11},          {par_x11_half},
        :EndSubBasinProperties
        """
        self.config.rvh.set_tmpl(rvh_tmpl)

        #########
        # R V I #
        #########

        self.config.rvi.evaporation = "PET_FROMMONTHLY"
        self.config.rvi.ow_evaporation = "PET_FROMMONTHLY"
        self.config.rvi.rain_snow_fraction = "RAINSNOW_HBV"
Beispiel #8
0
    def __init__(self, *args, **kwds):
        kwds["identifier"] = kwds.get("identifier", "sacsma")
        super().__init__(*args, **kwds)

        self.config.update(
            hrus=(SACSMA.HRU(), ),
            subbasins=(Sub(
                subbasin_id=1,
                name="sub_001",
                downstream_id=-1,
                profile="None",
                gauged=True,
            ), ),
        )

        #########
        # R V P #
        #########

        rvp_tmpl = """
        # --------------------------
        # Parameters and description
        # (adopted from Table 1 under https://wiki.ewater.org.au/display/SD41/Sacramento+Model+-+SRG)
        # --------------------------
        # para_x01 0.001  0.015    # LZPK;           The ratio of water in LZFPM, which drains as base flow each day.; fraction; default=0.01
        # para_x02 0.03   0.2      # LZSK;           The ratio of water in LZFSM which drains as base flow each day.; fraction; default=0.05
        # para_x03 0.2    0.5      # UZK;            The fraction of water in UZFWM, which drains as interflow each day.; fraction; default=0.3
        # para_x04 0.025  0.125    # UZTWM;          Upper Zone Tension Water Maximum. The maximum volume of water held by the upper zone between
        #                                            field capacity and the wilting point which can be lost by direct evaporation and evapotranspiration
        #                                            from soil surface. This storage is filled before any water in the upper zone is transferred to
        #                                            other storages.; m; default=0.050
        # para_x05 0.010  0.075    # UZFWM;          Upper Zone Free Water Maximum, this storage is the source of water for interflow and the driving
        #                                            force for transferring water to deeper depths.; m; default=0.040
        # para_x06 0.075  0.300    # LZTWM;          Lower Zone Tension Water Maximum, the maximum capacity of lower zone tension water. Water from
        #                                            this store can only be removed through evapotranspiration.; m; default=0.130
        # para_x07 0.015  0.300    # LZFSM;          Lower Zone Free Water Supplemental Maximum, the maximum volume from which supplemental base flow
        #                                            can be drawn.; m; default=0.025
        # para_x08 0.040  0.600    # LZFPM;          Lower Zone Free Water Primary Maximum, the maximum capacity from which primary base flow can be
        #                                            drawn.; m; default=0.060
        # para_x09 0.0    0.5      # PFREE;          The minimum proportion of percolation from the upper zone to the lower zone directly available
        #                                            for recharging the lower zone free water stores.; percent/100; default=0.06
        # para_x10 0.0    3.0      # REXP;           An exponent determining the rate of change of the percolation rate with changing lower zone water
        #                                            storage.; none; default=1.0
        # para_x11 0.0    80       # ZPERC;          The proportional increase in Pbase that defines the maximum percolation rate.;
        #                                            none; default=40
        # para_x12 0.0    0.8      # SIDE;           The ratio of non-channel baseflow (deep recharge) to channel (visible) baseflow.; ratio;
        #                                            default=0.0
        # n/a      0.0    0.1      # SSOUT;          The volume of the flow which can be conveyed by porous material in the bed of stream.; mm;
        #                                            default=0.0
        # para_x13 0.0    0.05     # PCTIM;          The permanently impervious fraction of the basin contiguous with stream channels, which
        #                                            contributes to direct runoff.; percent/100; default=0.01
        # para_x14 0.0    0.2      # ADIMP;          The additional fraction of the catchment which develops impervious characteristics under
        #                                            soil saturation conditions.; percent/100; default=0.0
        # para_x15 0.0    0.1      # RIVA=SARVA;     A decimal fraction representing that portion of the basin normally covered by streams,
        #                                            lakes and vegetation that can deplete stream flow by evapotranspiration.; percent/100;
        #                                            default=0.0
        # para_x16 0.0    0.4      # RSERV;          Fraction of lower zone free water unavailable for transpiration; percent/100; default=0.3
        # n/a      0.0    1.0      # UH1;            The first  component of the unit hydrograph, i.e. the proportion of instantaneous runoff
        #                                            not lagged; percent/100; default=1.0
        # n/a      0.0    1.0      # UH2;            The second component of the unit hydrograph, i.e. the proportion of instantaneous runoff
        #                                            not lagged; percent/100; default=1.0
        # n/a      0.0    1.0      # UH3;            The third  component of the unit hydrograph, i.e. the proportion of instantaneous runoff
        #                                            not lagged; percent/100; default=1.0
        # n/a      0.0    1.0      # UH4;            The fourth component of the unit hydrograph, i.e. the proportion of instantaneous runoff
        #                                            not lagged; percent/100; default=1.0
        # n/a      0.0    1.0      # UH5;            The fifth  component of the unit hydrograph, i.e. the proportion of instantaneous runoff
        #                                            not lagged; percent/100; default=1.0
        # para_x17 0.0    8.0      # MELT_FACTOR;    maximum snow melt factor used in degree day models (not in original SAC-SMA
        #                                            model); mm/d/C; default=1.5
        # para_x18 0.3    20.0     # GAMMA_SHAPE;    used to build unit hydrograph, LandUseParameterList; none ; default=1.0
        # para_x19 0.01   5.0      # GAMMA_SCALE;    used to build unit hydrograph, LandUseParameterList; none ; default=1.0
        # para_x20 0.8    1.2      # RAINCORRECTION; Muliplier to correct rain, Gauge; none ; default=1.0
        # para_x21 0.8    1.2      # SNOWCORRECTION; Muliplier to correct snow, Gauge; none ; default=1.0

        # tied parameters:
        # (it is important for OSTRICH to find every parameter place holder somewhere in this file)
        # (without this parameters that are used to derive parameters wouldn't be detectable by Ostrich)
        #    para_x04_mm       = par_soil0_mm     = para_x04 * 1000       =  par_x04 * 1000
        #    para_x06_mm       = par_soil0_mm     = para_x06 * 1000       =  par_x06 * 1000
        #    para_bf_loss_frac = PAR_BF_LOSS_FRAC = para_x12/(1+para_x12) = par_x12/(1+par_x12)
        #    para_pow_x01      = POW_X01          = 10^(para_x01)         = 10^par_x01
        #    para_pow_x02      = POW_X02          = 10^(para_x02)         = 10^par_x02
        #    para_pow_x03      = POW_X03          = 10^(para_x03)         = 10^par_x03

        #-----------------------------------------------------------------
        # Soil Classes
        #-----------------------------------------------------------------
        :SoilClasses
          :Attributes,
          :Units,
            UZT,
            UZF,
            LZT,
            LZFP,
            LZFS,
            ADIM,
            GW
        :EndSoilClasses

        #-----------------------------------------------------------------
        # Land Use Classes
        #-----------------------------------------------------------------
        :LandUseClasses,
          :Attributes,           IMPERM,    FOREST_COV,
               :Units,             frac,          frac,
               FOREST, {params.par_x13},           1.0,
        #      FOREST,          <PCTIM>,           1.0,
        #      FOREST,         para_x13,           1.0,
        #
        :EndLandUseClasses

        #-----------------------------------------------------------------
        # Vegetation Classes
        #-----------------------------------------------------------------
        :VegetationClasses,
          :Attributes,        MAX_HT,       MAX_LAI, MAX_LEAF_COND,
               :Units,             m,          none,      mm_per_s,
               FOREST,             4,             5,             5,
        #      FOREST,             4,             5,             5,
        :EndVegetationClasses

        #-----------------------------------------------------------------
        # Soil Profiles
        #-----------------------------------------------------------------
        :SoilProfiles
               LAKE, 0
          DEFAULT_P, 7, UZT, {params.par_x04}, UZF, {params.par_x05}, LZT,  {params.par_x06}, LZFP,  {params.par_x08}, LZFS, {params.par_x07}, ADIM, 100, GW, 100
        # DEFAULT_P, 7, UZT,          <UZTWM>, UZF,          <UZFWM>, LZT,           <LZTWM>, LZFP,           <LZFPM>, LZFS,          <LZFSM>, ADIM, 100, GW, 100
        # DEFAULT_P, 7, UZT,         para_x04, UZF,         para_x05, LZT,          para_x06, LZFP,          para_x08, LZFS,         para_x07, ADIM, 100, GW, 100
        :EndSoilProfiles

        #-----------------------------------------------------------------
        # Global Parameters
        #-----------------------------------------------------------------

        #-----------------------------------------------------------------
        # Soil Parameters
        #-----------------------------------------------------------------
        :SoilParameterList
          :Parameters,        POROSITY,   SAC_PERC_ALPHA,   SAC_PERC_EXPON,   SAC_PERC_PFREE,
               :Units,             [-],              [-],              [-],           [0..1],
            [DEFAULT],             1.0, {params.par_x11}, {params.par_x10}, {params.par_x09},
        #   [DEFAULT],             1.0,          <ZPERC>,           <REXP>,          <PFREE>,
        #   [DEFAULT],             1.0,         para_x11,         para_x10,         para_x09,
        :EndSoilParameterList
        :SoilParameterList
          :Parameters,              BASEFLOW_COEFF,     UNAVAIL_FRAC
               :Units,                         1/d,             0..1
            [DEFAULT],                         0.0,              0.0
               UZF,               {params.par_x03},              0.0
               LZFP,              {params.par_x01}, {params.par_x16}
               LZFS,              {params.par_x02},              0.0
        #   [DEFAULT],                         0.0,              0.0
        #      UZF,                          <UZK>,              0.0
        #      LZFP,                        <LZPK>,          <RSERV>
        #      LZFS,                        <LZSK>,              0.0
        #   [DEFAULT],                         0.0,              0.0
        #      UZF,                    10^para_x03,              0.0
        #      LZFP,                   10^para_x01,         para_x16
        #      LZFS,                   10^para_x02,              0.0
        :EndSoilParameterList

        #-----------------------------------------------------------------
        # Land Use Parameters
        #-----------------------------------------------------------------
        :LandUseParameterList
          :Parameters,      GAMMA_SHAPE,      GAMMA_SCALE,      MELT_FACTOR,  STREAM_FRACTION, MAX_SAT_AREA_FRAC,      BF_LOSS_FRACTION
               :Units,                -,                -,           mm/d/C,           [0..1],            [0..1],                [0..1]
            [DEFAULT], {params.par_x18}, {params.par_x19}, {params.par_x17}, {params.par_x15},  {params.par_x14},      {params.par_x12}
        #                      para_x18,         para_x19,         para_x17,           <RIVA>,           <ADIMP>,     <SIDE>/(1+<SIDE>)
        #                      para_x18,         para_x19,         para_x17,         para_x15,          para_x14, para_x12/(1+para_x12)
        :EndLandUseParameterList

        #-----------------------------------------------------------------
        # Vegetation Parameters
        #-----------------------------------------------------------------
        :VegetationParameterList
          :Parameters,  RAIN_ICEPT_PCT,  SNOW_ICEPT_PCT,
               :Units,               -,               -,
            [DEFAULT],             0.0,             0.0,
        :EndVegetationParameterList
        """

        self.config.rvp.set_tmpl(rvp_tmpl)

        #########
        # R V I #
        #########

        rvi_tmpl = """
        :PotentialMeltMethod     POTMELT_DEGREE_DAY
        :RainSnowFraction        {rain_snow_fraction}
        :Evaporation             {evaporation}
        :CatchmentRoute          ROUTE_GAMMA_CONVOLUTION
        :Routing                 ROUTE_NONE

        :SoilModel               SOIL_MULTILAYER 7

        :Alias UZ_T  SOIL[0]
        :Alias UZ_F  SOIL[1]
        :Alias LZ_T  SOIL[2]
        :Alias LZ_PF SOIL[3]
        :Alias LZ_PS SOIL[4]

        :HydrologicProcesses
          :SnowBalance           SNOBAL_SIMPLE_MELT   SNOW          PONDED_WATER
          :Precipitation         RAVEN_DEFAULT        ATMOS_PRECIP  MULTIPLE
          :SoilEvaporation       SOILEVAP_SACSMA      MULTIPLE      ATMOSPHERE
          :SoilBalance           SOILBAL_SACSMA       MULTIPLE      MULTIPLE
          :OpenWaterEvaporation  OPEN_WATER_RIPARIAN  SURFACE_WATER ATMOSPHERE
        :EndHydrologicProcesses
        """
        self.config.rvi.set_tmpl(rvi_tmpl)

        self.config.rvi.rain_snow_fraction = RVI.RainSnowFractionOptions.DATA
        self.config.rvi.evaporation = RVI.EvaporationOptions.PET_OUDIN
Beispiel #9
0
    def __init__(self, *args, **kwds):
        kwds["identifier"] = kwds.get("identifier", "hmets")
        super().__init__(*args, **kwds)

        self.config.update(
            hrus=(HMETS.ForestHRU(), ),
            subbasins=(Sub(
                subbasin_id=1,
                name="sub_001",
                downstream_id=-1,
                profile="None",
                gauged=True,
            ), ),
        )

        #########
        # R V P #
        #########

        rvp_tmpl = """
        #-----------------------------------------------------------------
        # Soil Classes
        #-----------------------------------------------------------------
        :SoilClasses
          :Attributes,
          :Units,
          TOPSOIL,
          PHREATIC,
        :EndSoilClasses

        #-----------------------------------------------------------------
        # Land Use Classes
        #-----------------------------------------------------------------
        :LandUseClasses,
          :Attributes,        IMPERM,    FOREST_COV,
               :Units,          frac,          frac,
               FOREST,           0.0,           1.0,
        :EndLandUseClasses

        #-----------------------------------------------------------------
        # Vegetation Classes
        #-----------------------------------------------------------------
        :VegetationClasses,
          :Attributes,        MAX_HT,       MAX_LAI, MAX_LEAF_COND,
               :Units,             m,          none,      mm_per_s,
               FOREST,             4,             5,             5,
        :EndVegetationClasses

        #-----------------------------------------------------------------
        # Soil Profiles
        #-----------------------------------------------------------------
        :SoilProfiles
                 LAKE, 0
                 ROCK, 0
          DEFAULT_P, 2, TOPSOIL,  {TOPSOIL_m}, PHREATIC, {PHREATIC_m},
        # DEFAULT_P, 2, TOPSOIL,   x(20)/1000, PHREATIC,   x(21)/1000,
        :EndSoilProfiles

        #-----------------------------------------------------------------
        # Global Parameters
        #-----------------------------------------------------------------
        :GlobalParameter         SNOW_SWI_MIN {params.SNOW_SWI_MIN}     # x(9)
        :GlobalParameter         SNOW_SWI_MAX {SUM_SNOW_SWI}     # x(9)+x(10)
        :GlobalParameter     SWI_REDUCT_COEFF {params.SWI_REDUCT_COEFF} # x(11)
        :GlobalParameter             SNOW_SWI 0.05         # not sure why/if needed...

        #-----------------------------------------------------------------
        # Soil Parameters
        #-----------------------------------------------------------------
        :SoilParameterList
          :Parameters,        POROSITY,      PERC_COEFF,  PET_CORRECTION,  BASEFLOW_COEFF
               :Units,               -,             1/d,               -,             1/d
              TOPSOIL,             1.0,     {params.PERC_COEFF},{params.PET_CORRECTION},{params.BASEFLOW_COEFF_1}
             PHREATIC,             1.0,             0.0,             0.0, {params.BASEFLOW_COEFF_2}
         #    TOPSOIL,             1.0,           x(17),           x(15),           x(18)
         #   PHREATIC,             1.0,             0.0,             0.0,           x(19)
        :EndSoilParameterList

        #-----------------------------------------------------------------
        # Land Use Parameters
        #-----------------------------------------------------------------
        :LandUseParameterList
          :Parameters, MIN_MELT_FACTOR,  MAX_MELT_FACTOR,    DD_MELT_TEMP,  DD_AGGRADATION,  REFREEZE_FACTOR,    REFREEZE_EXP,  DD_REFREEZE_TEMP,  HMETS_RUNOFF_COEFF,
               :Units,          mm/d/C,          mm/d/C,               C,            1/mm,          mm/d/C,               -,                C,                  -,
            [DEFAULT],{params.MIN_MELT_FACTOR},{SUM_MELT_FACTOR},  {params.DD_MELT_TEMP},{params.DD_AGGRADATION},{params.REFREEZE_FACTOR},  {params.REFREEZE_EXP},{params.DD_REFREEZE_TEMP},{params.HMETS_RUNOFF_COEFF},
        #                         x(5),       x(5)+x(6),            x(7),            x(8),           x(13),           x(14),            x(12),              x(16),
        :EndLandUseParameterList
        :LandUseParameterList
          :Parameters,   GAMMA_SHAPE,     GAMMA_SCALE,    GAMMA_SHAPE2,    GAMMA_SCALE2,
               :Units,             -,             1/d,               -,             1/d,
            [DEFAULT],  {params.GAMMA_SHAPE},   {params.GAMMA_SCALE},  {params.GAMMA_SHAPE2},  {params.GAMMA_SCALE2},
            #                   x(1),            x(2),            x(3),            x(4),
        :EndLandUseParameterList
        #-----------------------------------------------------------------
        # Vegetation Parameters
        #-----------------------------------------------------------------
        :VegetationParameterList
          :Parameters,  RAIN_ICEPT_PCT,  SNOW_ICEPT_PCT,
               :Units,               -,               -,
            [DEFAULT],             0.0,             0.0,
        :EndVegetationParameterList
        """
        self.config.rvp.set_tmpl(rvp_tmpl)

        #########
        # R V I #
        #########

        rvi_tmpl = """
        :PotentialMeltMethod     POTMELT_HMETS
        :RainSnowFraction        {rain_snow_fraction}
        :Evaporation             {evaporation}  # PET_OUDIN
        :CatchmentRoute          ROUTE_DUMP
        :Routing                 ROUTE_NONE

        :SoilModel               SOIL_TWO_LAYER

        :Alias DELAYED_RUNOFF CONVOLUTION[1]

        :HydrologicProcesses
          :SnowBalance     SNOBAL_HMETS    MULTIPLE     MULTIPLE
          :Precipitation   RAVEN_DEFAULT   ATMOS_PRECIP MULTIPLE
          :Infiltration    INF_HMETS       PONDED_WATER MULTIPLE
            :Overflow      OVERFLOW_RAVEN  SOIL[0]      DELAYED_RUNOFF
          :Baseflow        BASE_LINEAR     SOIL[0]      SURFACE_WATER   # interflow, really
          :Percolation     PERC_LINEAR     SOIL[0]      SOIL[1]         # recharge
            :Overflow      OVERFLOW_RAVEN  SOIL[1]      DELAYED_RUNOFF
          :SoilEvaporation SOILEVAP_ALL    SOIL[0]      ATMOSPHERE      # AET
          :Convolve        CONVOL_GAMMA    CONVOLUTION[0] SURFACE_WATER #'surface runoff'
          :Convolve        CONVOL_GAMMA_2  DELAYED_RUNOFF SURFACE_WATER #'delayed runoff'
          :Baseflow        BASE_LINEAR     SOIL[1]      SURFACE_WATER
        :EndHydrologicProcesses
        """
        self.config.rvi.set_tmpl(rvi_tmpl)

        self.config.rvi.evaporation = "PET_OUDIN"
        self.config.rvi.rain_snow_fraction = RVI.RainSnowFractionOptions.DATA