* GAMS CODE FOR COLORADO SAN LUIS VALLEY * FARM MANAGEMENT SURFACE WATER + AQUIFER * CROP PRODUCTION WATER MANAGEMENT MODEL $INLINECOM { } * Written by Mark Sperow, Ph.D. Colorado State University, 1998 * Surface and groundwater share is attached to the farm rather than ditch. * Farm ID, ditch ID, and aquifer ID are independent from one another. SETS i rights /1*124/ l ditches /1*5/ c crops /alfalfa, barley, potatoes/ M farms /1*33/ t months /1*6/ q aquifer cell /1*9/ alias (i,j); PARAMETERS FarmAcre(M) total acre limit on farm M (acres) / 1 12847 2 8999 3 8683 4 10970 5 2541 6 2316 7 154 8 426 9 865 10 6159 11 2061 12 1727 13 11555 14 2530 15 2730 16 1826 17 1281 18 2321 19 1928 20 1375 21 791 22 2092 23 2250 24 659 25 840 26 870 27 8291 28 1249 29 594 30 4170 31 2948 32 1976 33 2105 / ETA(M) irrigation efficiency on farm M (water consumed pr unit water applied) / 1 0.5 2 0.5 3 0.5 4 0.5 5 0.5 6 0.5 7 0.5 8 0.5 9 0.5 10 0.5 11 0.5 12 0.5 13 0.5 14 0.5 15 0.5 16 0.5 17 0.5 18 0.5 19 0.5 20 0.5 21 0.5 22 0.5 23 0.5 24 0.5 25 0.5 26 0.5 27 0.5 28 0.5 29 0.5 30 0.5 31 0.5 32 0.5 33 0.5 / PRICE(c) per-unit-yield crop prices by crop c ($ pr unit) /Alfalfa 85.00 Barley 3.26 Potatoes 5.50/ PAVC(c) per-acre variable costs by crop c ($ pr acre) /Alfalfa 129.60 Barley 179.66 Potatoes 596.12/ PYVC(c) per-unit-yield variable costs by crop c ($ pr unit) /Alfalfa 24.25 Barley 0.34 Potatoes 0.12/ Vo(q) starting volume aquifer cell q. Full for all cells is 2461440 (ac ft) / 1 238080 2 245760 3 250080 4 245760 5 505600 6 235520 7 453120 8 241920 9 44800 / MTCHARGE(t) aquifer recharge from mountain snowmelt in month t (ac ft) / 1 1363 2 1363 3 1363 4 1363 5 1363 6 1363 / DITCHID(l) numeric ditch identifier for lth ditch (ordinal upstream to downstream) / 1 1 2 2 3 3 4 4 5 5 / WATERRIGHT(i) volume of water right i (ac ft) / 1 666.3 2 18941.6 3 1356.4 4 1350.4 5 1546.7 6 1998.9 7 1451.6 8 987.5 9 2581.9 10 3093.5 11 17472.2 12 2677.1 13 5054.3 14 2914.4 15 2304.6 16 2459.3 17 5243.4 18 4860.9 19 10922.4 20 4918.6 21 2672.3 22 2595 23 14.9 24 8257.2 25 14.9 26 56.5 27 324.2 28 6270.8 29 16685.2 30 9500 31 6554.6 32 7864.6 33 7454.1 34 794.2 35 1224.3 36 561.6 37 223.1 38 97 39 619.9 40 309.9 41 852.5 42 271.3 43 178.5 44 6252.4 45 44.6 46 44.6 47 169.5 48 658.6 49 2191.6 50 3563.5 51 1200.5 52 1355.8 53 1239.8 54 1471.8 55 963.7 56 929.8 57 619.9 58 387.3 59 406.9 60 155.3 61 18578.7 62 356.9 63 136.8 64 5473.1 65 5551.6 66 5526.6 67 9605.3 68 2633.6 69 1859.1 70 619.9 71 464.6 72 1084.5 73 1239.8 74 1549.1 75 619.9 76 1626.5 77 2974.5 78 2489.1 79 20270.6 80 7328 81 3979.9 82 636.5 83 6133.4 84 119 85 785.3 86 6264.3 87 1778.8 88 119 89 621.1 90 178.5 91 107.1 92 615.7 93 41.6 94 285.6 95 559.2 96 1066.7 97 1427.2 98 1191 99 332.5 100 944.1 101 935.2 102 135.6 103 33.9 104 67.8 105 767.4 106 7.7 107 971.5 108 232.6 109 834 110 121.4 111 264.7 112 193.9 113 999.4 114 38.7 115 333.7 116 155.3 117 1560.4 118 38.7 119 324.8 120 832.9 121 338.5 122 3391.5 123 23225.5 124 100000 / PRIORITY(i) priority of water right i (ordinal senior-1 to junior-124) / 1 4 2 6 3 14 4 16 5 23 6 31 7 33 8 39 9 44 10 45 11 46 12 58 13 65 14 72 15 80 16 86 17 92 18 98 19 104 20 110 21 114 22 119 23 20 24 25 25 27 26 35 27 49 28 54 29 61 30 68 31 76 32 8 33 38 34 56 35 63 36 70 37 78 38 84 39 90 40 96 41 102 42 108 43 2 44 18 45 21 46 28 47 36 48 48 49 52 50 60 51 66 52 74 53 82 54 88 55 94 56 100 57 106 58 112 59 117 60 120 61 10 62 22 63 30 64 41 65 42 66 12 67 51 68 59 69 73 70 81 71 87 72 93 73 99 74 105 75 111 76 115 77 122 78 1 79 3 80 5 81 7 82 9 83 11 84 13 85 15 86 17 87 19 88 24 89 26 90 29 91 32 92 34 93 37 94 40 95 43 96 47 97 50 98 53 99 55 100 57 101 62 102 64 103 67 104 69 105 71 106 75 107 77 108 79 109 83 110 85 111 89 112 91 113 95 114 97 115 101 116 103 117 107 118 109 119 113 120 116 121 118 122 121 123 123 124 124 / OWNER (i) assigns water right i to ditch l (ordinal) / 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 2 24 2 25 2 26 2 27 2 28 2 29 2 30 2 31 2 32 3 33 3 34 3 35 3 36 3 37 3 38 3 39 3 40 3 41 3 42 3 43 3 44 3 45 3 46 3 47 3 48 3 49 3 50 4 51 4 52 4 53 4 54 4 55 5 56 5 57 5 58 5 59 5 60 5 61 5 62 5 63 5 64 5 65 5 66 5 67 5 68 5 69 5 70 5 71 5 72 5 73 5 74 5 75 5 76 5 77 5 78 5 79 5 80 5 81 5 82 5 83 5 84 5 85 5 86 5 87 5 88 5 89 5 90 5 91 5 92 5 93 5 94 5 95 5 96 5 97 5 98 5 99 5 100 5 101 5 102 5 103 5 104 5 105 5 106 5 107 5 108 5 109 5 110 5 111 5 112 5 113 5 114 5 115 5 116 5 117 5 118 5 119 5 120 5 121 5 122 5 123 5 124 5 / INFLOW (t) stream inflows in mo t where 423964 is full flow for 6 mo season (ac ft) / 1 22645 2 125462 3 147338 4 71880 5 29416 6 27223 / GWRT(M) groundwater decree amount for farm M (ac ft) / 1 9028 2 13840 3 28656 4 43359 5 9220 6 8374 7 0 8 0 9 0 10 12099 11 6589 12 0 13 35402 14 5503 15 2788 16 3090 17 0 18 3730 19 2523 20 1547 21 685 22 2540 23 437 24 0 25 0 26 520 27 29425 28 2419 29 952 30 4782 31 6301 32 2046 33 3148 / ALLOCATION(l,t) water diverted for lth ditch in month t -- unknown till stage 1 model run (ac ft) ; * Below are (per-acre crop yield equation coefficients for crop c on farm M} * (functional form: a + b * water +d * water ** 2 + e * water ** 3 ) TABLE a(M,c) intercept coefficients for production functions farm M crop c (unitless) Alfalfa Barley Potatoes 1 0.061059 0.24736 -0.0113 2 0.061059 0.24736 -0.0113 3 0.061059 0.24736 -0.0113 4 0.061059 0.24736 -0.0113 5 0.061059 0.24736 -0.0113 6 0.488082 0.386881 0.400191 7 0.488082 0.386881 0.400191 8 0.061059 0.24736 -0.0113 9 0.061059 0.24736 -0.0113 10 0.061059 0.24736 -0.0113 11 0.061059 0.24736 -0.0113 12 0.061059 0.24736 -0.0113 13 0.488082 0.386881 0.400191 14 0.488082 0.386881 0.400191 15 0.488082 0.386881 0.400191 16 0.488082 0.386881 0.400191 17 0.061059 0.24736 -0.0113 18 0.488082 0.386881 0.400191 19 0.488082 0.386881 0.400191 20 0.061059 0.24736 -0.0113 21 0.061059 0.24736 -0.0113 22 0.488082 0.386881 0.400191 23 0.488082 0.386881 0.400191 24 0.488082 0.386881 0.400191 25 0.061059 0.24736 -0.0113 26 0.061059 0.24736 -0.0113 27 0.488082 0.386881 0.400191 28 0.488082 0.386881 0.400191 29 0.488082 0.386881 0.400191 30 0.488082 0.386881 0.400191 31 0.488082 0.386881 0.400191 32 0.488082 0.386881 0.400191 33 0.061059 0.24736 -0.0113 ; TABLE b(M,c) linear coeffiencts for production functions farm M crop c (unitless) Alfalfa Barley Potatoes 1 0.122877 -0.01422 0.056893 2 0.122877 -0.01422 0.056893 3 0.122877 -0.01422 0.056893 4 0.122877 -0.01422 0.056893 5 0.122877 -0.01422 0.056893 6 0.09003 0.069575 0.166498 7 0.09003 0.069575 0.166498 8 0.122877 -0.01422 0.056893 9 0.122877 -0.01422 0.056893 10 0.122877 -0.01422 0.056893 11 0.122877 -0.01422 0.056893 12 0.122877 -0.01422 0.056893 13 0.09003 0.069575 0.166498 14 0.09003 0.069575 0.166498 15 0.09003 0.069575 0.166498 16 0.09003 0.069575 0.166498 17 0.122877 -0.01422 0.056893 18 0.09003 0.069575 0.166498 19 0.09003 0.069575 0.166498 20 0.122877 -0.01422 0.056893 21 0.122877 -0.01422 0.056893 22 0.09003 0.069575 0.166498 23 0.09003 0.069575 0.166498 24 0.09003 0.069575 0.166498 25 0.122877 -0.01422 0.056893 26 0.122877 -0.01422 0.056893 27 0.09003 0.069575 0.166498 28 0.09003 0.069575 0.166498 29 0.09003 0.069575 0.166498 30 0.09003 0.069575 0.166498 31 0.09003 0.069575 0.166498 32 0.09003 0.069575 0.166498 33 0.122877 -0.01422 0.056893 ; TABLE d(M,c) quadratic coeffiencts for production functions farm M crop c (unitless) Alfalfa Barley Potatoes 1 -0.00395 0.005732 -0.0008 2 -0.00395 0.005732 -0.0008 3 -0.00395 0.005732 -0.0008 4 -0.00395 0.005732 -0.0008 5 -0.00395 0.005732 -0.0008 6 -0.00389 0.020244 -0.01585 7 -0.00389 0.020244 -0.01585 8 -0.00395 0.005732 -0.0008 9 -0.00395 0.005732 -0.0008 10 -0.00395 0.005732 -0.0008 11 -0.00395 0.005732 -0.0008 12 -0.00395 0.005732 -0.0008 13 -0.00389 0.020244 -0.01585 14 -0.00389 0.020244 -0.01585 15 -0.00389 0.020244 -0.01585 16 -0.00389 0.020244 -0.01585 17 -0.00395 0.005732 -0.0008 18 -0.00389 0.020244 -0.01585 19 -0.00389 0.020244 -0.01585 20 -0.00395 0.005732 -0.0008 21 -0.00395 0.005732 -0.0008 22 -0.00389 0.020244 -0.01585 23 -0.00389 0.020244 -0.01585 24 -0.00389 0.020244 -0.01585 25 -0.00395 0.005732 -0.0008 26 -0.00395 0.005732 -0.0008 27 -0.00389 0.020244 -0.01585 28 -0.00389 0.020244 -0.01585 29 -0.00389 0.020244 -0.01585 30 -0.00389 0.020244 -0.01585 31 -0.00389 0.020244 -0.01585 32 -0.00389 0.020244 -0.01585 33 -0.00395 0.005732 -0.0008 ; TABLE e(M,c) cubic coeffiencts for production functions farm M crop c (unitless) Alfalfa Barley Potatoes 1 0 -0.00016 0 2 0 -0.00016 0 3 0 -0.00016 0 4 0 -0.00016 0 5 0 -0.00016 0 6 0 -0.00245 0.000524 7 0 -0.00245 0.000524 8 0 -0.00016 0 9 0 -0.00016 0 10 0 -0.00016 0 11 0 -0.00016 0 12 0 -0.00016 0 13 0 -0.00245 0.000524 14 0 -0.00245 0.000524 15 0 -0.00245 0.000524 16 0 -0.00245 0.000524 17 0 -0.00016 0 18 0 -0.00245 0.000524 19 0 -0.00245 0.000524 20 0 -0.00016 0 21 0 -0.00016 0 22 0 -0.00245 0.000524 23 0 -0.00245 0.000524 24 0 -0.00245 0.000524 25 0 -0.00016 0 26 0 -0.00016 0 27 0 -0.00245 0.000524 28 0 -0.00245 0.000524 29 0 -0.00245 0.000524 30 0 -0.00245 0.000524 31 0 -0.00245 0.000524 32 0 -0.00245 0.000524 33 0 -0.00016 0 ; TABLE y(M,c) Full water crop yield per acre farm M crop c (units pr acre) Alfalfa Barley Potatoes 1 4 130 310 2 4 130 310 3 4 130 310 4 5 150 350 5 4 130 310 6 5 150 350 7 5 150 350 8 4 130 310 9 4 130 310 10 4 130 310 11 4 130 310 12 4 130 310 13 5 150 350 14 5 150 350 15 5 150 350 16 5 150 350 17 4 130 310 18 5 150 350 19 5 150 350 20 4 130 310 21 4 130 310 22 5 150 350 23 5 150 350 24 5 150 350 25 4 130 310 26 4 130 310 27 5 150 350 28 5 150 350 29 5 150 350 30 5 150 350 31 5 150 350 32 5 150 350 33 4 130 310 ; TABLE NIRL(M,c) initial net irrigation level farm M crop c (ac in pr acre) Alfalfa Barley Potatoes 1 14 15 34 2 14 15 34 3 14 15 34 4 14 15 34 5 14 15 34 6 10 2 9 7 10 2 9 8 14 15 34 9 14 15 34 10 14 15 34 11 14 15 34 12 14 15 34 13 10 2 9 14 10 2 9 15 10 2 9 16 10 2 9 17 14 15 34 18 14 5 9 19 14 5 9 20 14 15 34 21 14 15 34 22 10 2 9 23 10 2 9 24 10 2 9 25 14 15 34 26 14 15 34 27 10 2 9 28 10 2 9 29 10 2 9 30 10 2 9 31 10 2 9 32 10 2 9 33 14 15 34 ; TABLE CropLimit(M,c) historical acre limitation of farm M crop c (acres) Alfalfa Barley Potatoes 1 1988 5784 5075 2 1575 4573 2851 3 1622 3930 3131 4 1793 4930 4247 5 251 1210 1080 6 393 1116 807 7 10 144 0 8 6 100 320 9 318 361 186 10 562 2789 2808 11 473 1067 520 12 68 782 877 13 572 5525 5458 14 287 1176 1068 15 407 1341 983 16 363 922 541 17 5 577 700 18 117 865 1339 19 207 756 965 20 335 504 536 21 128 397 266 22 602 731 758 23 195 1426 628 24 94 354 211 25 136 303 400 26 78 312 480 27 725 3854 3712 28 515 496 237 29 406 140 49 30 690 1820 1660 31 610 1216 1122 32 416 1100 460 33 177 850 1079 ; TABLE SHARE(M,l) farm M's share of ditch l -- ea column sums to 1 --(decimal) 1 2 3 4 5 1 0.25 0 0 0 0 2 0.19 0 0 0 0 3 0.18 0 0 0 0 4 0.23 0 0 0 0 5 0.05 0 0 0 0 6 0.05 0 0 0 0 7 0.01 0 0 0 0 8 0.02 0 0 0 0 9 0.02 0 0 0 0 10 0 0.055 0 0 0 11 0 0.055 0 0 0 12 0 0.15 0 0 0 13 0 0.05 0 0 0 14 0 0.055 0 0 0 15 0 0.1 0 0 0 16 0 0.055 0 0 0 17 0 0.1 0 0 0 18 0 0.055 0 0 0 19 0 0.055 0 0 0 20 0 0.055 0 0 0 21 0 0.055 0 0 0 22 0 0.055 0 0 0 23 0 0.055 0 0 0 24 0 0.05 0 0 0 25 0 0 0.65 0 0 26 0 0 0.35 0 0 27 0 0 0 0.80 0 28 0 0 0 0.14 0 29 0 0 0 0.06 0 30 0 0 0 0 0.25 31 0 0 0 0 0.25 32 0 0 0 0 0.25 33 0 0 0 0 0.25 ; TABLE PUMPCAP(M,q) farm M monthly pump capacity in aquifer cell q (ac ft) 1 2 3 4 5 6 7 8 9 1 21823 0 0 0 0 0 0 0 0 2 0 17308 0 0 0 0 0 0 0 3 0 0 0 19565 0 0 0 0 0 4 0 0 21070 0 0 0 0 0 0 5 0 0 0 0 6020 0 0 0 0 6 0 5268 0 0 0 0 0 0 0 7 0 0 0 0 0 0 6020 0 0 8 0 0 0 0 0 0 5268 0 0 9 0 0 0 0 0 0 0 8278 0 10 0 0 0 0 11288 0 0 0 0 11 0 0 0 4515 0 0 0 0 0 12 0 0 0 0 0 3010 0 0 0 13 0 0 0 0 19565 0 0 0 0 14 0 0 0 0 0 4515 0 0 0 15 0 0 0 0 0 0 5268 0 0 16 0 0 0 0 0 3010 0 0 0 17 0 0 0 0 0 2258 0 0 0 18 0 0 0 0 0 0 0 0 3763 19 0 0 0 0 0 3763 0 0 0 20 0 0 0 0 0 0 3010 0 0 21 0 0 0 0 0 1505 0 0 0 22 0 0 0 0 0 0 6773 0 0 23 0 0 0 0 0 0 0 5268 0 24 0 0 0 0 0 0 0 0 0 25 1505 0 0 0 0 0 0 2258 0 26 0 1505 0 0 0 0 0 0 0 27 0 0 0 0 13545 0 0 0 0 28 0 0 0 0 0 5268 0 0 0 29 0 0 0 0 0 0 6773 0 0 30 0 0 0 0 9030 0 0 0 0 31 0 0 0 0 0 11288 0 0 0 32 0 0 0 0 0 0 4515 0 0 33 0 0 0 0 0 0 6773 0 0 ; TABLE AQSHARE(M,q) farm M share of aquifer cell q (ac ft) 1 2 3 4 5 6 7 8 9 1 0.94 0 0 0 0 0 0 0 0 2 0 0.72 0 0 0 0 0 0 0 3 0 0 0 0.81 0 0 0 0 0 4 0 0 1.00 0 0 0 0 0 0 5 0 0 0 0 0.10 0 0 0 0 6 0 0.22 0 0 0.00 0 0 0 0 7 0 0 0 0 0 0 0.14 0 0 8 0 0 0 0 0 0 0.12 0 0 9 0 0 0 0 0 0 0 0.52 0 10 0 0 0 0 0.19 0 0 0 0 11 0 0 0 0.19 0 0 0 0 0 12 0 0 0 0 0 0.08 0 0 0 13 0 0 0 0 0.33 0 0 0 0 14 0 0 0 0 0 0.13 0 0 0 15 0 0 0 0 0 0.00 0.12 0 0 16 0 0 0 0 0 0.09 0 0 0 17 0 0 0 0 0 0.07 0 0 0 18 0 0 0 0 0 0 0 0 1.00 19 0 0 0 0 0 0.11 0 0 0 20 0 0 0 0 0 0 0.07 0 0 21 0 0 0 0 0 0.04 0.00 0 0 22 0 0 0 0 0 0 0.15 0 0 23 0 0 0 0 0 0 0 0.33 0 24 0 0 0 0 0 0 0 0.15 0 25 0.06 0 0 0 0 0 0 0 0 26 0 0.06 0 0 0 0 0 0 0 27 0 0 0 0 0.23 0 0 0 0 28 0 0 0 0 0 0.15 0 0 0 29 0 0 0 0 0 0.00 0.15 0 0 30 0 0 0 0 0.15 0 0 0 0 31 0 0 0 0 0 0.33 0 0 0 32 0 0 0 0 0 0 0.10 0 0 33 0 0 0 0 0 0 0.15 0 0 ; TABLE RTNFRAC(M,q) portion of farm M's nonconsumption return to aquifer cell q (decimal) 1 2 3 4 5 6 7 8 9 1 0.95 0 0 0 0 0 0 0 0 2 0 0.95 0 0 0 0 0 0 0 3 0 0 0 0.95 0 0 0 0 0 4 0 0 0.95 0 0 0 0 0 0 5 0 0 0 0 0.95 0 0 0 0 6 0 0.95 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0.95 0 0 8 0 0 0 0 0 0 0.95 0 0 9 0 0 0 0 0 0 0 0.95 0 10 0 0 0 0 0.95 0 0 0 0 11 0 0 0 0.95 0 0 0 0 0 12 0 0 0 0 0 0.95 0 0 0 13 0 0 0 0 0.95 0 0 0 0 14 0 0 0 0 0 0.95 0 0 0 15 0 0 0 0 0 0 0.95 0 0 16 0 0 0 0 0 0.95 0 0 0 17 0 0 0 0 0 0.95 0 0 0 18 0 0 0 0 0 0 0 0 0.95 19 0 0 0 0 0 0.95 0 0 0 20 0 0 0 0 0 0 0.95 0 0 21 0 0 0 0 0 0.95 0 0 0 22 0 0 0 0 0 0 0.95 0 0 23 0 0 0 0 0 0 0 0.95 0 24 0 0 0 0 0 0 0 0 0 25 0.95 0 0 0 0 0 0 0.95 0 26 0 0.95 0 0 0 0 0 0 0 27 0 0 0 0 0.95 0 0 0 0 28 0 0 0 0 0 0.95 0 0 0 29 0 0 0 0 0 0 0.95 0 0 30 0 0 0 0 0.95 0 0 0 0 31 0 0 0 0 0 0.95 0 0 0 32 0 0 0 0 0 0 0.95 0 0 33 0 0 0 0 0 0 0.95 0 0 ; VARIABLES * (River Flow Variables--monthly) FLOW(i,t) stream flow at right i in month t (ac ft) OUTFLOW remaining exported annual streamflow after all diversions (ac ft) DIVERT(i,t) diversion for right i in month t (ac ft) DITCH(l,t) amount of water diverted to ditch l in month t (ac ft) * (Crop Growth Variables) CROPACRE(M,c) acres on farm M planted to crop c (acres) CROPY(M,c) per-acre yield on farm M of crop c (units pr acre) RELY(M,c) relative yield parameter on farm M of crop c (0-1) NETRET(M,c) total net returns on farm M of crop c ($) TOTNET(M) total net returns including ditch share on farm M ($ pr farm) * (Variables Describing Available Water) DRAIN(q,t) applied water percolating to aquifer cell q in month t (ac ft) V(q,t) volume of available water in aquifer cell q in month t (ac ft) VLIM(q,t) volume limit from aquifer cell q in month t (ac ft) WAPPRATE(M,c,t) per-acre sw + gw applied on farm M to crop c in month t (ac ft per acre) NIR(M,c) net irrigation rate on farm M for crop c (ac in pr ac) RECHARGE(M,q,t) surface water recharged to aquifer farm M cell q in month t (ac ft) SURFACE(M,t) total surface water used (crops + recharge) farm M month t (ac ft) SURFAPP(M,c,t) surface water applied farm M crop c month t (ac ft) PUMPED(M,c,q,t) ground water applied farm M crop c cell q month t (ac ft) WAPPLIED(M,c,t) all water applied farm M crop c month t (ac ft) SAPCST(M,c) small cost for applying surface water directly on farm M to crop c ($) PUMPCST(M,q) small cost for applying groundwater on farm M from cell q ($) RECHGLIM(M,q,t) limit groundwater applied to crop on farm M from cell q in month t (ac ft) * (Objective Function Variables) OBJPA objective function for prior appropriation (ac ft) OBJNFI objective function for net farm income ($) ; POSITIVE VARIABLES FLOW, DIVERT, DITCH, CROPACRE, CROPY, RELY, DRAIN, V, SURFACE, PUMPED, WAPPRATE, WAPPLIED, NIR, RECHARGE, SAPCST, SURFAPP; EQUATIONS * (River Flow Equations) ERIGHT(i,t) set waterright limit for right i in month t (ac ft) EFLOW(i,t) stream flow at right i in month t (ac ft) EOUTFLOW remaining annual streamflow after all diversions (ac ft pr yr) ECOMPACT Rio Grande Compact minimum reqd annual streamflow delivery (ac ft pr yr) EDIVERT(i,t) water diverted for right i in month t (ac ft) EDITCH(l,t) water in ditch l in month t (ac ft) EALLOCATE(l,t) water from ditch l for application to all farms and crops month t (ac ft) * (Water Supply and Use Equations) EV(q,t) volume of aquifer cell q in month t (ac ft) EVLIM(q,t) upper bound volume limit on aquifer cell q in month t (ac ft) EDRAIN(q,t) water applied to crops recharging aquifer q in month t (ac ft) ESURFACE(M,t) surface water applied to crops on farm M in month t (ac ft) EAQLIM(q,t) limits pumping to ground water available in cell q in month t (ac ft) EWAPPLIED(M,c,t) water applied on farm M to crop c in month t (ac ft) EPUMPCAP(M,q,t) pumping capacity farm M aquifer cell q in month t = min (pump-supply-paper right) (ac ft) EWAPPLIM(M,c,t) total water application limit farm M crop c month t (ac ft) ENIR(M,c) net irrigation rate on farm M for crop c (ac in) ERECHARGE(M,q,t) surf water not applied to crops to recharge pits farm M cell q month t (ac ft) ESURFAPP(M,c,t) amount of surface water applied to field (ac ft) ESURLIM(M,q,t) limits amount of surface water available (ac ft) ESAPCST(M,c) small cost of applying surface water directly to crop ($) EPUMPCST(M,q) small pumping cost for groundwater ($) ERECHGLIM(M,q,t) limits pumping to what farm M added to aquifer cell q in month t (ac ft) ESURFAPLIM(M,t) surface water applied le surf water available--excess to recharge pits farm M month t (ac ft) EPUMPLIM(q,t) limits total pumping to less than aquifer volume cell q in month t (ac ft) * (Crop Growth Equations) ERELY(M,c) relative yield on farm M of crop c (0 to 1) ECROPLIM(M,c) acre limit on farm M of crop c (acres) EFARMACRE(M) acre limit on farm M (acres) ECROPY(M,c) yield on farm m of crop c (units) ENETRET(M,c) net return on farm M of crop c from crop production ($) ETOTNET(M) total net returns on farm M over crops ($) * (Objective function Equations) EOBJPA objective function for prior appropriation (units) EOBJNFI objective function for farm income ($ per year) ; ERIGHT(i,t).. DIVERT(i,t) =l= WATERRIGHT(i); EFLOW(i,t).. FLOW(i,t) =e= INFLOW(t) $(ord(i) eq 1) + (FLOW(i-1,t) - DIVERT(i-1,t) $(ord(i) gt 1)); EDIVERT(i,t).. DIVERT(i,t) =l= FLOW(i,t); EOUTFLOW.. OUTFLOW =e= SUM(t, INFLOW(t) ) - SUM((i,t), DIVERT(i,t)); ECOMPACT.. OUTFLOW =G= 0.43281 * SUM(t, INFLOW(t)); * RGR compact linear regression for lobatos gage deliveries as function of rgr annual flow EDITCH(l,t).. DITCH(l,t) =L= SUM(i,(DIVERT(i,t)* (OWNER(i) eq DITCHID(l)))); EALLOCATE(l,t).. DITCH(l,t) =E= ALLOCATION(l,t); EV(q,t).. V(q,t) =E= Vo(q) $(ord(t) eq 1) + (V(q,t-1) + SUM(M,RECHARGE(M,q,t-1)) + DRAIN(q,t-1) - SUM((M,c), (PUMPED(M,c,q,t-1))) + MTCHARGE(t) $(ord(t) GT 1)); EVLIM(q,t).. VLIM(q,t) =L= 1.3 * V(q,t); EDRAIN(q,t).. DRAIN(q,t) =E= SUM(M, (1-eta(M)) * sum(c, WAPPLIED(M,c,t)) * RTNFRAC(M,q)); ESURFACE(M,t).. SURFACE(M,t) =E= SUM((l),DITCH(l,t) * SHARE(M,l)); ERECHARGE(M,q,t).. RECHARGE(M,q,t) =E= (SURFACE(M,t) - SUM(c,SURFAPP(M,c,t))) * (AQSHARE(m,q) gt 0) ; ESURFAPLIM(m,t).. SUM(c, SURFAPP(m,c,t)) =l= SURFACE(m,t); ESAPCST(M,c).. SAPCST(M,c) =E= SUM((t), SURFAPP(M,c,t) ) * .5 ; EPUMPCST(M,q).. PUMPCST(M,q) =E= SUM((t,c), PUMPED(M,c,q,t) ) * 1.0 ; EPUMPCAP(M,q,t).. SUM(c, PUMPED(M,c,q,t)) =L= min(PUMPCAP(M,q), RECHARGE(M,q,t) + GWRT(M), (AQSHARE(M,q) * V(q,t))); EPUMPLIM(q,t).. SUM((M,c), PUMPED(M,c,q,t)) =L= V(q,t); EWAPPLIED(M,c,t).. WAPPRATE(M,c,t) * CROPACRE(M,c) =E= WAPPLIED(M,c,t); EWAPPLIM(M,c,t).. WAPPLIED(M,c,t) =e= SURFAPP(M,c,t) + SUM(q, PUMPED(M,c,q,t)) ; ENIR(M,c).. NIR(M,c) =E= 12 * SUM(t, WAPPRATE(M,c,t)) * ETA(M); ERELY(M,c).. RELY(M,c) =E= a(M,c) + b(M,c) * NIR(M,c) + d(M,c) * NIR(M,c)**2 + e(M,c) * NIR(M,c)**3; ECROPY(M,c).. CROPY(M,c) =E= RELY(M,c) * y(M,c); ENETRET(M,c).. NETRET(M,c) =E= (PRICE(c)-PYVC(c)) * CROPY(M,c) * CROPACRE(M,c) - PAVC(c) * CROPACRE(M,c) - SAPCST(m,c) - SUM(q,PUMPCST(m,q)); ECROPLIM(M,c).. CROPACRE(M,c) =L= CROPLIMIT(M,c); EFARMACRE(M).. SUM(c, CROPACRE(M,c)) =L= FARMACRE(M); ETOTNET(M).. TOTNET(M) =E= SUM(C, NETRET(M,c)); NIR.L(M,c) = NIRL(M,c); NIR.lo(M,c) = .01; RELY.UP(M,c) = 1; EOBJPA.. OBJPA =E= SUM((i,t),(1/PRIORITY(I)**2) * DIVERT(i,t)); EOBJNFI.. OBJNFI =E= SUM((M,c), NETRET(M,c)); model PA /ERIGHT, EFLOW, EOUTFLOW, ECOMPACT, EDIVERT, EDITCH, EOBJPA/; model FARMALLOC /EALLOCATE, EV, EDRAIN, ESURFACE, ERECHARGE, EWAPPLIED, EPUMPCAP, EWAPPLIM, ENIR, ERELY, ESURFAPLIM, EPUMPLIM, ECROPLIM, EFARMACRE, ECROPY, ENETRET, ESAPCST, EPUMPCST, ETOTNET,EOBJNFI/; option DNLP=MINOS5; PA.OPTFILE = 1; solve PA using dnlp maximizing OBJPA; *solve water allocation via prior appropriation} ALLOCATION(l,t) = DITCH.L(l,t); *{Amount of Water available for crop = amount in ditch} option DNLP=MINOS5; FARMALLOC.OPTFILE = 1; solve FARMALLOC using dnlp maximizing OBJNFI; Vo(q) = V.L(q,"6"); *write output file for import into Excel} option decimals = 2; file out /rg5.txt/; out.ap = 2; put out; out.pc = 5; out.nd = 2; out.pw = 255; parameters SWAT(m,c) GWWAT(M,c) TWAPP(M,c) RCHG(M,c) precip(m,c); swat(m,c)=0; gwwat(M,c) = 0; TWAPP(M,c) = 0; RCHG(M,c) = 0; precip(m,c) = 0; put "Objective Value =" objnfi.l/; loop(t, swat(m,c)=swat(m,c)+surfapp.l(m,c,t)); loop(t, loop(q, gwwat(M,c) = gwwat(M,c) + PUMPED.l(M,c,q,t))); loop(t, TWAPP(M,c) = TWAPP(M,c) + wapprate.l(m,c,t)*cropacre.l(m,c)); loop(t, loop(q, RCHG(M,c) = RCHG(M,c) + RECHARGE.l(M,q,t))); loop(m, put "Farm", "Crop", "Acres", "Rel Yield", "Irrigation", "Surf Wat", "Ground Wat", "Recharge", "TotWat App", "Net Returns", "Crop Yield", "Surf App Costs"/; loop(c,put m.tl, c.tl, cropacre.l(M,c), rely.l(M,c), nir.l(M,c), swat(m,c), gwwat(M,c), rchg(M,c), twapp(M,c), netret.l(M,c), cropy.l(m,c), sapcst.l(M,c)/)); put //; option decimals = 2; file out2 /TOTNET5.txt/; out2.ap =1; put out2; out2.pc = 5; out2.nd = 0; out2.pw = 255; Parameters CropA(c); CropA(c) = 0; put "Alfalfa", "Barley", "Potatoes" put/; loop(c, cropa(c) = cropa(c) + sum(m, cropacre.l(m,C))); loop(c, put cropa(c)) PUT /; PUT "Farm", "Total Returns", "Diversion Costs", "Alfalfa", "Barley", "Potatoes"/; LOOP(M, PUT ORD(M), TOTNET.L(M), {DWCOST(M), }cropacre.l(m, "alfalfa"), cropacre.l(m, "barley"), cropacre.l(m, "potatoes"), put/); * the end