diff --git a/.gitignore b/.gitignore index 59c5f7919..6fe49eaf3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# ignore cartesius job ouput +*.out + # ignore pcraster maps *.map *.ldd diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..94a9ed024 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index b8fe57c2d..1c3f8277a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,16 @@ PCR-GLOBWB ========== +Copyright 2016 Utrecht University + PCR-GLOBWB (PCRaster Global Water Balance) is a large-scale hydrological model intended for global to regional studies and developed at the Department of Physical Geography, Utrecht University (Netherlands). -contact: Edwin Sutanudjaja (E.H.Sutanudjaja@uu.nl). +PCR-GLOBWB is copyrighted by Utrecht University and released under the GPL license, version 3 + +This program comes with ABSOLUTELY NO WARRANTY + +See the "LICENSE" file for more information. + +contact: Edwin Sutanudjaja (E.H.Sutanudjaja@uu.nl). Please also see the file README.txt. diff --git a/README.txt b/README.txt index 528a4f1a8..992ccab62 100755 --- a/README.txt +++ b/README.txt @@ -1,4 +1,11 @@ PCR-GLOBWB git repository. + +PCR-GLOBWB is copyrighted by Utrecht University and released under the GPL license, version 3 + +This program comes with ABSOLUTELY NO WARRANTY + +See the "LICENSE" file for more information. + For questions, please contact Edwin Sutanudjaja (e-mail: E.H.Sutanudjaja@uu.nl). Some git reference cards: diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_begin_part_one.ini b/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_begin_part_one.ini new file mode 100644 index 000000000..f6ee8907a --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_begin_part_one.ini @@ -0,0 +1,442 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +# PART ONE +cloneAreas = part_one +#~ # PART TWO +#~ cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1901-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = False + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = None + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = None + +includeDomesticWaterDemand = False +includeIndustryWaterDemand = False +includeLivestockWaterDemand = False + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = None +industryWaterDemandFile = None +livestockWaterDemandFile = None + +# desalination water supply (maximum/potential/capacity) +desalinationWater = None + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = None + +limitAbstraction = True + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interceptStor_forest_1901-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowCoverSWE_forest_1901-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowFreeWater_forest_1901-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/topWaterLayer_forest_1901-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storUpp_forest_1901-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storLow_forest_1901-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interflow_forest_1901-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interceptStor_grassland_1901-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowCoverSWE_grassland_1901-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowFreeWater_grassland_1901-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/topWaterLayer_grassland_1901-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storUpp_grassland_1901-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storLow_grassland_1901-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interflow_grassland_1901-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = 0.0 +avgNonFossilGroundwaterAllocationShortIni = 0.0 +avgTotalGroundwaterAbstractionIni = 0.0 +avgTotalGroundwaterAllocationLongIni = 0.0 +avgTotalGroundwaterAllocationShortIni = 0.0 +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/storGroundwater_1901-01-01.ini.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/relativeGroundwaterHead_1901-01-01.ini.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/baseflow_1901-01-01.ini.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = True + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/states/groundwaterHeadLayer1_1901-01-01.ini.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/states/groundwaterHeadLayer2_1901-01-01.ini.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = True + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/timestepsToAvgDischarge_1901-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/waterBodyStorage_1901-12-31.map +channelStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/channelStorage_1901-12-31.map +readAvlChannelStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/readAvlChannelStorage_1901-12-31.map +avgDischargeLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgDischargeLong_1901-12-31.map +avgDischargeShortIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgDischargeShort_1901-12-31.map +m2tDischargeLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/m2tDischargeLong_1901-12-31.map +avgBaseflowLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgBaseflowLong_1901-12-31.map +riverbedExchangeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/riverbedExchange_1901-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/subDischarge_1901-12-31.map +# +avgLakeReservoirInflowShortIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgLakeReservoirInflowShort_1901-12-31.map +avgLakeReservoirOutflowLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgLakeReservoirOutflowLong_1901-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,runoff,actualET +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_begin_part_two.ini b/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_begin_part_two.ini new file mode 100644 index 000000000..c3ebcf511 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_begin_part_two.ini @@ -0,0 +1,442 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +#~ # PART ONE +#~ cloneAreas = part_one +# PART TWO +cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1901-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = False + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = None + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = None + +includeDomesticWaterDemand = False +includeIndustryWaterDemand = False +includeLivestockWaterDemand = False + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = None +industryWaterDemandFile = None +livestockWaterDemandFile = None + +# desalination water supply (maximum/potential/capacity) +desalinationWater = None + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = None + +limitAbstraction = True + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interceptStor_forest_1901-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowCoverSWE_forest_1901-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowFreeWater_forest_1901-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/topWaterLayer_forest_1901-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storUpp_forest_1901-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storLow_forest_1901-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interflow_forest_1901-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interceptStor_grassland_1901-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowCoverSWE_grassland_1901-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowFreeWater_grassland_1901-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/topWaterLayer_grassland_1901-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storUpp_grassland_1901-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storLow_grassland_1901-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interflow_grassland_1901-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = 0.0 +avgNonFossilGroundwaterAllocationShortIni = 0.0 +avgTotalGroundwaterAbstractionIni = 0.0 +avgTotalGroundwaterAllocationLongIni = 0.0 +avgTotalGroundwaterAllocationShortIni = 0.0 +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/storGroundwater_1901-01-01.ini.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/relativeGroundwaterHead_1901-01-01.ini.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/baseflow_1901-01-01.ini.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = True + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/states/groundwaterHeadLayer1_1901-01-01.ini.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/states/groundwaterHeadLayer2_1901-01-01.ini.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = True + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/timestepsToAvgDischarge_1901-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/waterBodyStorage_1901-12-31.map +channelStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/channelStorage_1901-12-31.map +readAvlChannelStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/readAvlChannelStorage_1901-12-31.map +avgDischargeLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgDischargeLong_1901-12-31.map +avgDischargeShortIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgDischargeShort_1901-12-31.map +m2tDischargeLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/m2tDischargeLong_1901-12-31.map +avgBaseflowLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgBaseflowLong_1901-12-31.map +riverbedExchangeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/riverbedExchange_1901-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/subDischarge_1901-12-31.map +# +avgLakeReservoirInflowShortIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgLakeReservoirInflowShort_1901-12-31.map +avgLakeReservoirOutflowLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgLakeReservoirOutflowLong_1901-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,runoff,actualET +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_begin_part_one.sh b/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_begin_part_one.sh new file mode 100644 index 000000000..bec53f5f2 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_begin_part_one.sh @@ -0,0 +1,10 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_begin_part_one.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - NATURAL - with extra spin-up - part_one - start from 1901 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_begin_part_two.sh b/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_begin_part_two.sh new file mode 100644 index 000000000..6dcbde351 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/begin/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_begin_part_two.sh @@ -0,0 +1,10 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_begin_part_two.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - NATURAL - with extra spin-up - part_two - start from 1901 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1946_part_one.ini b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1946_part_one.ini new file mode 100644 index 000000000..2df771353 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1946_part_one.ini @@ -0,0 +1,442 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +# PART ONE +cloneAreas = part_one +#~ # PART TWO +#~ cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1946-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = False + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = None + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = None + +includeDomesticWaterDemand = False +includeIndustryWaterDemand = False +includeLivestockWaterDemand = False + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = None +industryWaterDemandFile = None +livestockWaterDemandFile = None + +# desalination water supply (maximum/potential/capacity) +desalinationWater = None + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = None + +limitAbstraction = True + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/interceptStor_forest_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/snowCoverSWE_forest_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/snowFreeWater_forest_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/topWaterLayer_forest_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/storUpp_forest_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/storLow_forest_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/interflow_forest_1945-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/interceptStor_grassland_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/snowCoverSWE_grassland_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/snowFreeWater_grassland_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/topWaterLayer_grassland_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/storUpp_grassland_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/storLow_grassland_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/interflow_grassland_1945-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgNonFossilGroundwaterAllocationLong_1945-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgNonFossilGroundwaterAllocationShort_1945-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgTotalGroundwaterAbstraction_1945-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgTotalGroundwaterAllocationLong_1945-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgTotalGroundwaterAllocationShort_1945-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/maps/storGroundwater_1945-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/maps/relativeGroundwaterHead_1945-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/maps/baseflow_1945-12-31.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = True + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/states/groundwaterHeadLayer1_1945-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/states/groundwaterHeadLayer2_1945-12-31.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = True + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/timestepsToAvgDischarge_1945-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/waterBodyStorage_1945-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/channelStorage_1945-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/readAvlChannelStorage_1945-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgDischargeLong_1945-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgDischargeShort_1945-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/m2tDischargeLong_1945-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgBaseflowLong_1945-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/riverbedExchange_1945-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/subDischarge_1945-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgLakeReservoirInflowShort_1945-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgLakeReservoirOutflowLong_1945-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,runoff,actualET +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1946_part_two.ini b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1946_part_two.ini new file mode 100644 index 000000000..a5d2a91a6 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1946_part_two.ini @@ -0,0 +1,442 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +#~ # PART ONE +#~ cloneAreas = part_one +# PART TWO +cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1946-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = False + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = None + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = None + +includeDomesticWaterDemand = False +includeIndustryWaterDemand = False +includeLivestockWaterDemand = False + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = None +industryWaterDemandFile = None +livestockWaterDemandFile = None + +# desalination water supply (maximum/potential/capacity) +desalinationWater = None + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = None + +limitAbstraction = True + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/interceptStor_forest_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/snowCoverSWE_forest_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/snowFreeWater_forest_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/topWaterLayer_forest_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/storUpp_forest_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/storLow_forest_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/interflow_forest_1945-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/interceptStor_grassland_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/snowCoverSWE_grassland_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/snowFreeWater_grassland_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/topWaterLayer_grassland_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/storUpp_grassland_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/storLow_grassland_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/interflow_grassland_1945-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgNonFossilGroundwaterAllocationLong_1945-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgNonFossilGroundwaterAllocationShort_1945-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgTotalGroundwaterAbstraction_1945-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgTotalGroundwaterAllocationLong_1945-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgTotalGroundwaterAllocationShort_1945-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/maps/storGroundwater_1945-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/maps/relativeGroundwaterHead_1945-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/maps/baseflow_1945-12-31.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = True + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/states/groundwaterHeadLayer1_1945-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/modflow/transient/states/groundwaterHeadLayer2_1945-12-31.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = True + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/timestepsToAvgDischarge_1945-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/waterBodyStorage_1945-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/channelStorage_1945-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/readAvlChannelStorage_1945-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgDischargeLong_1945-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgDischargeShort_1945-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/m2tDischargeLong_1945-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgBaseflowLong_1945-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/riverbedExchange_1945-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/subDischarge_1945-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgLakeReservoirInflowShort_1945-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/begin/global/states/avgLakeReservoirOutflowLong_1945-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,runoff,actualET +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1946_part_one.sh b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1946_part_one.sh new file mode 100644 index 000000000..0bdee60ab --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1946_part_one.sh @@ -0,0 +1,11 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1946_part_one.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - NATURAL - with extra spin-up - part_one - start from 1901 +# - continue from 1946 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1946_part_two.sh b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1946_part_two.sh new file mode 100644 index 000000000..e6b8867f0 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1946_part_two.sh @@ -0,0 +1,11 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1946_part_two.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - NATURAL - with extra spin-up - part_two - start from 1901 +# - continue from 1946 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1958_part_one.ini b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1958_part_one.ini new file mode 100644 index 000000000..7e6b523dd --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1958_part_one.ini @@ -0,0 +1,442 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +# PART ONE +cloneAreas = part_one +#~ # PART TWO +#~ cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1958-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = False + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = None + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = None + +includeDomesticWaterDemand = False +includeIndustryWaterDemand = False +includeLivestockWaterDemand = False + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = None +industryWaterDemandFile = None +livestockWaterDemandFile = None + +# desalination water supply (maximum/potential/capacity) +desalinationWater = None + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = None + +limitAbstraction = True + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/interceptStor_forest_1957-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/snowCoverSWE_forest_1957-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/snowFreeWater_forest_1957-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/topWaterLayer_forest_1957-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/storUpp_forest_1957-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/storLow_forest_1957-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/interflow_forest_1957-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/interceptStor_grassland_1957-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/snowCoverSWE_grassland_1957-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/snowFreeWater_grassland_1957-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/topWaterLayer_grassland_1957-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/storUpp_grassland_1957-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/storLow_grassland_1957-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/interflow_grassland_1957-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgNonFossilGroundwaterAllocationLong_1957-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgNonFossilGroundwaterAllocationShort_1957-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAbstraction_1957-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAllocationLong_1957-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAllocationShort_1957-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/maps/storGroundwater_1957-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/maps/relativeGroundwaterHead_1957-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/maps/baseflow_1957-12-31.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = True + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/states/groundwaterHeadLayer1_1957-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/states/groundwaterHeadLayer2_1957-12-31.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = True + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/timestepsToAvgDischarge_1957-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/waterBodyStorage_1957-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/channelStorage_1957-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/readAvlChannelStorage_1957-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgDischargeLong_1957-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgDischargeShort_1957-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/m2tDischargeLong_1957-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgBaseflowLong_1957-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/riverbedExchange_1957-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/subDischarge_1957-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgLakeReservoirInflowShort_1957-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgLakeReservoirOutflowLong_1957-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,runoff,actualET +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1958_part_two.ini b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1958_part_two.ini new file mode 100644 index 000000000..06b1fdb7b --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1958_part_two.ini @@ -0,0 +1,442 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +#~ # PART ONE +#~ cloneAreas = part_one +# PART TWO +cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1958-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = False + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = None + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = None + +includeDomesticWaterDemand = False +includeIndustryWaterDemand = False +includeLivestockWaterDemand = False + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = None +industryWaterDemandFile = None +livestockWaterDemandFile = None + +# desalination water supply (maximum/potential/capacity) +desalinationWater = None + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = None + +limitAbstraction = True + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/interceptStor_forest_1957-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/snowCoverSWE_forest_1957-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/snowFreeWater_forest_1957-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/topWaterLayer_forest_1957-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/storUpp_forest_1957-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/storLow_forest_1957-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/interflow_forest_1957-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/interceptStor_grassland_1957-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/snowCoverSWE_grassland_1957-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/snowFreeWater_grassland_1957-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/topWaterLayer_grassland_1957-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/storUpp_grassland_1957-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/storLow_grassland_1957-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/interflow_grassland_1957-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgNonFossilGroundwaterAllocationLong_1957-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgNonFossilGroundwaterAllocationShort_1957-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAbstraction_1957-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAllocationLong_1957-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAllocationShort_1957-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/maps/storGroundwater_1957-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/maps/relativeGroundwaterHead_1957-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/maps/baseflow_1957-12-31.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = True + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/states/groundwaterHeadLayer1_1957-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/modflow/transient/states/groundwaterHeadLayer2_1957-12-31.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = True + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/timestepsToAvgDischarge_1957-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/waterBodyStorage_1957-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/channelStorage_1957-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/readAvlChannelStorage_1957-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgDischargeLong_1957-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgDischargeShort_1957-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/m2tDischargeLong_1957-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgBaseflowLong_1957-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/riverbedExchange_1957-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/subDischarge_1957-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgLakeReservoirInflowShort_1957-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1946/global/states/avgLakeReservoirOutflowLong_1957-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,runoff,actualET +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1958_part_one.sh b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1958_part_one.sh new file mode 100644 index 000000000..576e02d55 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1958_part_one.sh @@ -0,0 +1,12 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/natural/continue_from_1958/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1958_part_one.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - NATURAL - with extra spin-up - part_one - start from 1901 +# - continue from 1946 +# - continue from 1958 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1958_part_two.sh b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1958_part_two.sh new file mode 100644 index 000000000..2bfbf9239 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_1958/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_1958_part_two.sh @@ -0,0 +1,12 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/natural/continue_from_1958/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_1958_part_two.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - NATURAL - with extra spin-up - part_two - start from 1901 +# - continue from 1946 +# - continue from 1958 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_2004_part_one.ini b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_2004_part_one.ini new file mode 100644 index 000000000..576d699d3 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_2004_part_one.ini @@ -0,0 +1,442 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_2004/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +# PART ONE +cloneAreas = part_one +#~ # PART TWO +#~ cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 2004-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = False + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = None + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = None + +includeDomesticWaterDemand = False +includeIndustryWaterDemand = False +includeLivestockWaterDemand = False + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = None +industryWaterDemandFile = None +livestockWaterDemandFile = None + +# desalination water supply (maximum/potential/capacity) +desalinationWater = None + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = None + +limitAbstraction = True + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/interceptStor_forest_2003-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/snowCoverSWE_forest_2003-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/snowFreeWater_forest_2003-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/topWaterLayer_forest_2003-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/storUpp_forest_2003-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/storLow_forest_2003-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/interflow_forest_2003-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/interceptStor_grassland_2003-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/snowCoverSWE_grassland_2003-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/snowFreeWater_grassland_2003-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/topWaterLayer_grassland_2003-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/storUpp_grassland_2003-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/storLow_grassland_2003-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/interflow_grassland_2003-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgNonFossilGroundwaterAllocationLong_2003-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgNonFossilGroundwaterAllocationShort_2003-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgTotalGroundwaterAbstraction_2003-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgTotalGroundwaterAllocationLong_2003-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgTotalGroundwaterAllocationShort_2003-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/maps/storGroundwater_2003-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/maps/relativeGroundwaterHead_2003-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/maps/baseflow_2003-12-31.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = True + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/states/groundwaterHeadLayer1_2003-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/states/groundwaterHeadLayer2_2003-12-31.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = True + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/timestepsToAvgDischarge_2003-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/waterBodyStorage_2003-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/channelStorage_2003-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/readAvlChannelStorage_2003-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgDischargeLong_2003-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgDischargeShort_2003-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/m2tDischargeLong_2003-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgBaseflowLong_2003-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/riverbedExchange_2003-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/subDischarge_2003-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgLakeReservoirInflowShort_2003-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgLakeReservoirOutflowLong_2003-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,runoff,actualET +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_2004_part_two.ini b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_2004_part_two.ini new file mode 100644 index 000000000..c4e3d734f --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_2004_part_two.ini @@ -0,0 +1,442 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_2004/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +#~ # PART ONE +#~ cloneAreas = part_one +# PART TWO +cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 2004-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = False + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = None + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = None + +includeDomesticWaterDemand = False +includeIndustryWaterDemand = False +includeLivestockWaterDemand = False + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = None +industryWaterDemandFile = None +livestockWaterDemandFile = None + +# desalination water supply (maximum/potential/capacity) +desalinationWater = None + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = None + +limitAbstraction = True + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/interceptStor_forest_2003-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/snowCoverSWE_forest_2003-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/snowFreeWater_forest_2003-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/topWaterLayer_forest_2003-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/storUpp_forest_2003-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/storLow_forest_2003-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/interflow_forest_2003-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/interceptStor_grassland_2003-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/snowCoverSWE_grassland_2003-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/snowFreeWater_grassland_2003-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/topWaterLayer_grassland_2003-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/storUpp_grassland_2003-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/storLow_grassland_2003-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/interflow_grassland_2003-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgNonFossilGroundwaterAllocationLong_2003-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgNonFossilGroundwaterAllocationShort_2003-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgTotalGroundwaterAbstraction_2003-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgTotalGroundwaterAllocationLong_2003-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgTotalGroundwaterAllocationShort_2003-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/maps/storGroundwater_2003-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/maps/relativeGroundwaterHead_2003-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/maps/baseflow_2003-12-31.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = True + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/states/groundwaterHeadLayer1_2003-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/modflow/transient/states/groundwaterHeadLayer2_2003-12-31.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = True + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/timestepsToAvgDischarge_2003-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/waterBodyStorage_2003-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/channelStorage_2003-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/readAvlChannelStorage_2003-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgDischargeLong_2003-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgDischargeShort_2003-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/m2tDischargeLong_2003-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgBaseflowLong_2003-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/riverbedExchange_2003-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/subDischarge_2003-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgLakeReservoirInflowShort_2003-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set_natural/no_correction/continue_from_1958/global/states/avgLakeReservoirOutflowLong_2003-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,runoff,actualET +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_2004_part_one.sh b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_2004_part_one.sh new file mode 100644 index 000000000..341ffb618 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_2004_part_one.sh @@ -0,0 +1,14 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/natural/continue_from_2004/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_2004_part_one.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - NATURAL - with extra spin-up - part_one - start from 1901 +# - continue from 1946 +# - continue from 1958 +# - continue from 2004 + diff --git a/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_2004_part_two.sh b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_2004_part_two.sh new file mode 100644 index 000000000..df0a56931 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/natural/continue_from_2004/wmod1901_4LCs_edwin_parameter_set_natural_extra_spinup_continue_from_2004_part_two.sh @@ -0,0 +1,14 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/natural/continue_from_2004/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_natural_extra_spinup_from_1901_continue_from_2004_part_two.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - NATURAL - with extra spin-up - part_two - start from 1901 +# - continue from 1946 +# - continue from 1958 +# - continue from 2004 + diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_begin_part_one.ini b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_begin_part_one.ini new file mode 100644 index 000000000..7d83081b0 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_begin_part_one.ini @@ -0,0 +1,546 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +# PART ONE +cloneAreas = part_one +#~ # PART TWO +#~ cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1901-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = True + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = PCRGLOBWB20/input30min/landSurface/waterDemand/efficiency/efficiency.map + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = PCRGLOBWB20/input5min/landSurface/waterDemand/irrigated_areas/irrigationArea05ArcMin.nc + +includeDomesticWaterDemand = True +includeIndustryWaterDemand = True +includeLivestockWaterDemand = True + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/domestic_water_demand_5min_meter_per_day.nc +industryWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/industry_water_demand_5min_meter_per_day.nc +livestockWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/livestock_water_demand_5min_meter_per_day.nc + +# desalination water supply (maximum/potential/capacity) +desalinationWater = /projects/0/dfguu/users/edwin/data/data_from_yoshi/desalination/desalination_in_m_per_day_05min/desalination_water_version_april_2015.nc + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map + +limitAbstraction = True + +# pcraster maps defining the partitioning of groundwater - surface water source to minimize +# - predefined surface water - groundwater partitioning for irrigation demand (based on Siebert, 2010/2013: Global Map of Irrigation Areas version 5) +irrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_SWFRAC.map +irrigationSurfaceWaterAbstractionFractionDataQuality = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_QUAL.map +# - predefined surface water - groundwater partitioning for irrigation demand (based on McDonald, 2014) +maximumNonIrrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/McDonald_water_infrastructure/max_city_sw_fraction.map +# threshold values defining the preference for surface water source for irrigation purpose +# - treshold to maximize surface water irrigation use (cells with irrSurfaceWaterAbstractionFraction above this will prioritize irrigation surface water use) +treshold_to_maximize_irrigation_surface_water = 0.50 +# - treshold to minimize fossil water withdrawal for irrigation (cells with irrSurfaceWaterAbstractionFraction below this have no fossil withdrawal for irrigation) +treshold_to_minimize_fossil_groundwater_irrigation = 0.70 + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interceptStor_forest_1901-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowCoverSWE_forest_1901-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowFreeWater_forest_1901-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/topWaterLayer_forest_1901-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storUpp_forest_1901-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storLow_forest_1901-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interflow_forest_1901-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interceptStor_grassland_1901-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowCoverSWE_grassland_1901-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowFreeWater_grassland_1901-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/topWaterLayer_grassland_1901-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storUpp_grassland_1901-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storLow_grassland_1901-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interflow_grassland_1901-12-31.map + +[irrPaddyOptions] + +name = irrPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map +maxRootDepth = 0.5 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.05 +minCropKC = 0.2 +cropDeplFactor = 0.2 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc + +# initial conditions: +interceptStorIni = 0.0 +snowCoverSWEIni = 0.0 +snowFreeWaterIni = 0.0 +topWaterLayerIni = 0.0 +storUppIni = 0.0 +storLowIni = 0.0 +interflowIni = 0.0 + +[irrNonPaddyOptions] + +name = irrNonPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map +maxRootDepth = 1.0 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 +cropDeplFactor = 0.5 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc + +# initial conditions: +interceptStorIni = 0.0 +snowCoverSWEIni = 0.0 +snowFreeWaterIni = 0.0 +topWaterLayerIni = 0.0 +storUppIni = 0.0 +storLowIni = 0.0 +interflowIni = 0.0 + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# annual pumping capacity for each region (unit: billion cubic meter per year), should be given in a netcdf file +pumpingCapacityNC = /projects/0/dfguu/users/edwin/data/limit_gw_abstraction_half_arc_degree/design_pumping_capacity/regional_abstraction_limit.nc + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = 0.0 +avgNonFossilGroundwaterAllocationShortIni = 0.0 +avgTotalGroundwaterAbstractionIni = 0.0 +avgTotalGroundwaterAllocationLongIni = 0.0 +avgTotalGroundwaterAllocationShortIni = 0.0 +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/storGroundwater_1901-01-01.ini.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/relativeGroundwaterHead_1901-01-01.ini.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/baseflow_1901-01-01.ini.map + +allocationSegmentsForGroundwater = others/irrigationZones/half_arc_degree/uniqueIds30min.nom.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = False + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/states/groundwaterHeadLayer1_1901-01-01.ini.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/states/groundwaterHeadLayer2_1901-01-01.ini.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = False + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/timestepsToAvgDischarge_1901-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/waterBodyStorage_1901-12-31.map +channelStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/channelStorage_1901-12-31.map +readAvlChannelStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/readAvlChannelStorage_1901-12-31.map +avgDischargeLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgDischargeLong_1901-12-31.map +avgDischargeShortIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgDischargeShort_1901-12-31.map +m2tDischargeLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/m2tDischargeLong_1901-12-31.map +avgBaseflowLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgBaseflowLong_1901-12-31.map +riverbedExchangeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/riverbedExchange_1901-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/subDischarge_1901-12-31.map +# +avgLakeReservoirInflowShortIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgLakeReservoirInflowShort_1901-12-31.map +avgLakeReservoirOutflowLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgLakeReservoirOutflowLong_1901-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal,totalGroundwaterAbstraction,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation,fracSurfaceWaterAllocation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,totalGroundwaterAbstraction,totalAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow,runoff,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,irrigationWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,irrigationWaterWithdrawalVolume,domesticWaterWithdrawalVolume,industryWaterWithdrawalVolume,livestockWaterWithdrawalVolume,totalGroundwaterAbstractionVolume,surfaceWaterAbstractionVolume,desalinationAbstractionVolume,irrGrossDemandVolume,nonIrrGrossDemandVolume,totalGrossDemandVolume,precipitation_at_irrigation,netLqWaterToSoil_at_irrigation,evaporation_from_irrigation,transpiration_from_irrigation,precipitation_at_irrigation_volume,netLqWaterToSoil_at_irrigation_volume,evaporation_from_irrigation_volume,transpiration_from_irrigation_volume +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation,fracSurfaceWaterAllocation,fracDesalinatedWaterAllocation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction,surfaceWaterAbstraction,totalAbstraction,nonIrrGrossDemand,nonIrrWaterConsumption,irrPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,precipitation_at_irrigation,evaporation_from_irrigation +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False + diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_begin_part_two.ini b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_begin_part_two.ini new file mode 100644 index 000000000..8fae3b97d --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_begin_part_two.ini @@ -0,0 +1,546 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +#~ # PART ONE +#~ cloneAreas = part_one +# PART TWO +cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1901-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = True + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = PCRGLOBWB20/input30min/landSurface/waterDemand/efficiency/efficiency.map + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = PCRGLOBWB20/input5min/landSurface/waterDemand/irrigated_areas/irrigationArea05ArcMin.nc + +includeDomesticWaterDemand = True +includeIndustryWaterDemand = True +includeLivestockWaterDemand = True + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/domestic_water_demand_5min_meter_per_day.nc +industryWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/industry_water_demand_5min_meter_per_day.nc +livestockWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/livestock_water_demand_5min_meter_per_day.nc + +# desalination water supply (maximum/potential/capacity) +desalinationWater = /projects/0/dfguu/users/edwin/data/data_from_yoshi/desalination/desalination_in_m_per_day_05min/desalination_water_version_april_2015.nc + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map + +limitAbstraction = True + +# pcraster maps defining the partitioning of groundwater - surface water source to minimize +# - predefined surface water - groundwater partitioning for irrigation demand (based on Siebert, 2010/2013: Global Map of Irrigation Areas version 5) +irrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_SWFRAC.map +irrigationSurfaceWaterAbstractionFractionDataQuality = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_QUAL.map +# - predefined surface water - groundwater partitioning for irrigation demand (based on McDonald, 2014) +maximumNonIrrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/McDonald_water_infrastructure/max_city_sw_fraction.map +# threshold values defining the preference for surface water source for irrigation purpose +# - treshold to maximize surface water irrigation use (cells with irrSurfaceWaterAbstractionFraction above this will prioritize irrigation surface water use) +treshold_to_maximize_irrigation_surface_water = 0.50 +# - treshold to minimize fossil water withdrawal for irrigation (cells with irrSurfaceWaterAbstractionFraction below this have no fossil withdrawal for irrigation) +treshold_to_minimize_fossil_groundwater_irrigation = 0.70 + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interceptStor_forest_1901-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowCoverSWE_forest_1901-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowFreeWater_forest_1901-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/topWaterLayer_forest_1901-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storUpp_forest_1901-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storLow_forest_1901-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interflow_forest_1901-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interceptStor_grassland_1901-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowCoverSWE_grassland_1901-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/snowFreeWater_grassland_1901-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/topWaterLayer_grassland_1901-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storUpp_grassland_1901-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/storLow_grassland_1901-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/interflow_grassland_1901-12-31.map + +[irrPaddyOptions] + +name = irrPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map +maxRootDepth = 0.5 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.05 +minCropKC = 0.2 +cropDeplFactor = 0.2 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc + +# initial conditions: +interceptStorIni = 0.0 +snowCoverSWEIni = 0.0 +snowFreeWaterIni = 0.0 +topWaterLayerIni = 0.0 +storUppIni = 0.0 +storLowIni = 0.0 +interflowIni = 0.0 + +[irrNonPaddyOptions] + +name = irrNonPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map +maxRootDepth = 1.0 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 +cropDeplFactor = 0.5 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc + +# initial conditions: +interceptStorIni = 0.0 +snowCoverSWEIni = 0.0 +snowFreeWaterIni = 0.0 +topWaterLayerIni = 0.0 +storUppIni = 0.0 +storLowIni = 0.0 +interflowIni = 0.0 + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# annual pumping capacity for each region (unit: billion cubic meter per year), should be given in a netcdf file +pumpingCapacityNC = /projects/0/dfguu/users/edwin/data/limit_gw_abstraction_half_arc_degree/design_pumping_capacity/regional_abstraction_limit.nc + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = 0.0 +avgNonFossilGroundwaterAllocationShortIni = 0.0 +avgTotalGroundwaterAbstractionIni = 0.0 +avgTotalGroundwaterAllocationLongIni = 0.0 +avgTotalGroundwaterAllocationShortIni = 0.0 +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/storGroundwater_1901-01-01.ini.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/relativeGroundwaterHead_1901-01-01.ini.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/maps/baseflow_1901-01-01.ini.map + +allocationSegmentsForGroundwater = others/irrigationZones/half_arc_degree/uniqueIds30min.nom.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = False + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/states/groundwaterHeadLayer1_1901-01-01.ini.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state//modflow//steady-state_only/states/groundwaterHeadLayer2_1901-01-01.ini.map + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = False + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/timestepsToAvgDischarge_1901-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/waterBodyStorage_1901-12-31.map +channelStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/channelStorage_1901-12-31.map +readAvlChannelStorageIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/readAvlChannelStorage_1901-12-31.map +avgDischargeLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgDischargeLong_1901-12-31.map +avgDischargeShortIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgDischargeShort_1901-12-31.map +m2tDischargeLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/m2tDischargeLong_1901-12-31.map +avgBaseflowLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgBaseflowLong_1901-12-31.map +riverbedExchangeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/riverbedExchange_1901-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/subDischarge_1901-12-31.map +# +avgLakeReservoirInflowShortIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgLakeReservoirInflowShort_1901-12-31.map +avgLakeReservoirOutflowLongIni = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/states/avgLakeReservoirOutflowLong_1901-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal,totalGroundwaterAbstraction,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation,fracSurfaceWaterAllocation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,totalGroundwaterAbstraction,totalAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow,runoff,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,irrigationWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,irrigationWaterWithdrawalVolume,domesticWaterWithdrawalVolume,industryWaterWithdrawalVolume,livestockWaterWithdrawalVolume,totalGroundwaterAbstractionVolume,surfaceWaterAbstractionVolume,desalinationAbstractionVolume,irrGrossDemandVolume,nonIrrGrossDemandVolume,totalGrossDemandVolume,precipitation_at_irrigation,netLqWaterToSoil_at_irrigation,evaporation_from_irrigation,transpiration_from_irrigation,precipitation_at_irrigation_volume,netLqWaterToSoil_at_irrigation_volume,evaporation_from_irrigation_volume,transpiration_from_irrigation_volume +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation,fracSurfaceWaterAllocation,fracDesalinatedWaterAllocation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction,surfaceWaterAbstraction,totalAbstraction,nonIrrGrossDemand,nonIrrWaterConsumption,irrPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,precipitation_at_irrigation,evaporation_from_irrigation +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False + diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/wmod1901_4LCs_edwin_parameter_set_extra_spinup_begin_part_one.sh b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/wmod1901_4LCs_edwin_parameter_set_extra_spinup_begin_part_one.sh new file mode 100644 index 000000000..fd3ed21c0 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/wmod1901_4LCs_edwin_parameter_set_extra_spinup_begin_part_one.sh @@ -0,0 +1,10 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/non-natural/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_begin_part_one.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - non-natural - with extra spin-up - part_one - start from 1901 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/wmod1901_4LCs_edwin_parameter_set_extra_spinup_begin_part_two.sh b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/wmod1901_4LCs_edwin_parameter_set_extra_spinup_begin_part_two.sh new file mode 100644 index 000000000..07aea234e --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/begin/wmod1901_4LCs_edwin_parameter_set_extra_spinup_begin_part_two.sh @@ -0,0 +1,10 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/non-natural/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_begin_part_two.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - non-natural - with extra spin-up - part_two - start from 1901 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1946_part_one.ini b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1946_part_one.ini new file mode 100644 index 000000000..5c7bd57e2 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1946_part_one.ini @@ -0,0 +1,547 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +# PART ONE +cloneAreas = part_one +#~ # PART TWO +#~ cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1946-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = True + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = PCRGLOBWB20/input30min/landSurface/waterDemand/efficiency/efficiency.map + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = PCRGLOBWB20/input5min/landSurface/waterDemand/irrigated_areas/irrigationArea05ArcMin.nc + +includeDomesticWaterDemand = True +includeIndustryWaterDemand = True +includeLivestockWaterDemand = True + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/domestic_water_demand_5min_meter_per_day.nc +industryWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/industry_water_demand_5min_meter_per_day.nc +livestockWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/livestock_water_demand_5min_meter_per_day.nc + +# desalination water supply (maximum/potential/capacity) +desalinationWater = /projects/0/dfguu/users/edwin/data/data_from_yoshi/desalination/desalination_in_m_per_day_05min/desalination_water_version_april_2015.nc + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map + +limitAbstraction = True + +# pcraster maps defining the partitioning of groundwater - surface water source to minimize +# - predefined surface water - groundwater partitioning for irrigation demand (based on Siebert, 2010/2013: Global Map of Irrigation Areas version 5) +irrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_SWFRAC.map +irrigationSurfaceWaterAbstractionFractionDataQuality = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_QUAL.map +# - predefined surface water - groundwater partitioning for irrigation demand (based on McDonald, 2014) +maximumNonIrrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/McDonald_water_infrastructure/max_city_sw_fraction.map +# threshold values defining the preference for surface water source for irrigation purpose +# - treshold to maximize surface water irrigation use (cells with irrSurfaceWaterAbstractionFraction above this will prioritize irrigation surface water use) +treshold_to_maximize_irrigation_surface_water = 0.50 +# - treshold to minimize fossil water withdrawal for irrigation (cells with irrSurfaceWaterAbstractionFraction below this have no fossil withdrawal for irrigation) +treshold_to_minimize_fossil_groundwater_irrigation = 0.70 + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interceptStor_forest_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowCoverSWE_forest_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowFreeWater_forest_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/topWaterLayer_forest_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storUpp_forest_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storLow_forest_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interflow_forest_1945-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interceptStor_grassland_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowCoverSWE_grassland_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowFreeWater_grassland_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/topWaterLayer_grassland_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storUpp_grassland_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storLow_grassland_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interflow_grassland_1945-12-31.map + +[irrPaddyOptions] + +name = irrPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map +maxRootDepth = 0.5 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.05 +minCropKC = 0.2 +cropDeplFactor = 0.2 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interceptStor_irrPaddy_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowCoverSWE_irrPaddy_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowFreeWater_irrPaddy_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/topWaterLayer_irrPaddy_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storUpp_irrPaddy_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storLow_irrPaddy_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interflow_irrPaddy_1945-12-31.map + +[irrNonPaddyOptions] + +name = irrNonPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map +maxRootDepth = 1.0 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 +cropDeplFactor = 0.5 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interceptStor_irrNonPaddy_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowCoverSWE_irrNonPaddy_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowFreeWater_irrNonPaddy_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/topWaterLayer_irrNonPaddy_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storUpp_irrNonPaddy_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storLow_irrNonPaddy_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interflow_irrNonPaddy_1945-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# annual pumping capacity for each region (unit: billion cubic meter per year), should be given in a netcdf file +pumpingCapacityNC = /projects/0/dfguu/users/edwin/data/limit_gw_abstraction_half_arc_degree/design_pumping_capacity/regional_abstraction_limit.nc + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgNonFossilGroundwaterAllocationLong_1945-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgNonFossilGroundwaterAllocationShort_1945-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgTotalGroundwaterAbstraction_1945-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgTotalGroundwaterAllocationLong_1945-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgTotalGroundwaterAllocationShort_1945-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/maps/storGroundwater_1945-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/maps/relativeGroundwaterHead_1945-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/maps/baseflow_1945-12-31.map + +allocationSegmentsForGroundwater = others/irrigationZones/half_arc_degree/uniqueIds30min.nom.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = False + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/states/groundwaterHeadLayer1_1945-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/states/groundwaterHeadLayer2_1945-12-31.map + + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = False + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/timestepsToAvgDischarge_1945-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/waterBodyStorage_1945-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/channelStorage_1945-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/readAvlChannelStorage_1945-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgDischargeLong_1945-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgDischargeShort_1945-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/m2tDischargeLong_1945-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgBaseflowLong_1945-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/riverbedExchange_1945-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/subDischarge_1945-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgLakeReservoirInflowShort_1945-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgLakeReservoirOutflowLong_1945-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal,totalGroundwaterAbstraction,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation,fracSurfaceWaterAllocation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,totalGroundwaterAbstraction,totalAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow,runoff,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,irrigationWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,irrigationWaterWithdrawalVolume,domesticWaterWithdrawalVolume,industryWaterWithdrawalVolume,livestockWaterWithdrawalVolume,totalGroundwaterAbstractionVolume,surfaceWaterAbstractionVolume,desalinationAbstractionVolume,irrGrossDemandVolume,nonIrrGrossDemandVolume,totalGrossDemandVolume,precipitation_at_irrigation,netLqWaterToSoil_at_irrigation,evaporation_from_irrigation,transpiration_from_irrigation,precipitation_at_irrigation_volume,netLqWaterToSoil_at_irrigation_volume,evaporation_from_irrigation_volume,transpiration_from_irrigation_volume +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation,fracSurfaceWaterAllocation,fracDesalinatedWaterAllocation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction,surfaceWaterAbstraction,totalAbstraction,nonIrrGrossDemand,nonIrrWaterConsumption,irrPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,precipitation_at_irrigation,evaporation_from_irrigation +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False + diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1946_part_two.ini b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1946_part_two.ini new file mode 100644 index 000000000..6b4a452de --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1946_part_two.ini @@ -0,0 +1,547 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +#~ # PART ONE +#~ cloneAreas = part_one +# PART TWO +cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1946-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = True + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = PCRGLOBWB20/input30min/landSurface/waterDemand/efficiency/efficiency.map + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = PCRGLOBWB20/input5min/landSurface/waterDemand/irrigated_areas/irrigationArea05ArcMin.nc + +includeDomesticWaterDemand = True +includeIndustryWaterDemand = True +includeLivestockWaterDemand = True + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/domestic_water_demand_5min_meter_per_day.nc +industryWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/industry_water_demand_5min_meter_per_day.nc +livestockWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/livestock_water_demand_5min_meter_per_day.nc + +# desalination water supply (maximum/potential/capacity) +desalinationWater = /projects/0/dfguu/users/edwin/data/data_from_yoshi/desalination/desalination_in_m_per_day_05min/desalination_water_version_april_2015.nc + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map + +limitAbstraction = True + +# pcraster maps defining the partitioning of groundwater - surface water source to minimize +# - predefined surface water - groundwater partitioning for irrigation demand (based on Siebert, 2010/2013: Global Map of Irrigation Areas version 5) +irrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_SWFRAC.map +irrigationSurfaceWaterAbstractionFractionDataQuality = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_QUAL.map +# - predefined surface water - groundwater partitioning for irrigation demand (based on McDonald, 2014) +maximumNonIrrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/McDonald_water_infrastructure/max_city_sw_fraction.map +# threshold values defining the preference for surface water source for irrigation purpose +# - treshold to maximize surface water irrigation use (cells with irrSurfaceWaterAbstractionFraction above this will prioritize irrigation surface water use) +treshold_to_maximize_irrigation_surface_water = 0.50 +# - treshold to minimize fossil water withdrawal for irrigation (cells with irrSurfaceWaterAbstractionFraction below this have no fossil withdrawal for irrigation) +treshold_to_minimize_fossil_groundwater_irrigation = 0.70 + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interceptStor_forest_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowCoverSWE_forest_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowFreeWater_forest_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/topWaterLayer_forest_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storUpp_forest_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storLow_forest_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interflow_forest_1945-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interceptStor_grassland_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowCoverSWE_grassland_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowFreeWater_grassland_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/topWaterLayer_grassland_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storUpp_grassland_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storLow_grassland_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interflow_grassland_1945-12-31.map + +[irrPaddyOptions] + +name = irrPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map +maxRootDepth = 0.5 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.05 +minCropKC = 0.2 +cropDeplFactor = 0.2 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interceptStor_irrPaddy_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowCoverSWE_irrPaddy_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowFreeWater_irrPaddy_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/topWaterLayer_irrPaddy_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storUpp_irrPaddy_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storLow_irrPaddy_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interflow_irrPaddy_1945-12-31.map + +[irrNonPaddyOptions] + +name = irrNonPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map +maxRootDepth = 1.0 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 +cropDeplFactor = 0.5 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interceptStor_irrNonPaddy_1945-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowCoverSWE_irrNonPaddy_1945-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/snowFreeWater_irrNonPaddy_1945-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/topWaterLayer_irrNonPaddy_1945-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storUpp_irrNonPaddy_1945-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/storLow_irrNonPaddy_1945-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/interflow_irrNonPaddy_1945-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# annual pumping capacity for each region (unit: billion cubic meter per year), should be given in a netcdf file +pumpingCapacityNC = /projects/0/dfguu/users/edwin/data/limit_gw_abstraction_half_arc_degree/design_pumping_capacity/regional_abstraction_limit.nc + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgNonFossilGroundwaterAllocationLong_1945-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgNonFossilGroundwaterAllocationShort_1945-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgTotalGroundwaterAbstraction_1945-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgTotalGroundwaterAllocationLong_1945-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgTotalGroundwaterAllocationShort_1945-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/maps/storGroundwater_1945-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/maps/relativeGroundwaterHead_1945-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/maps/baseflow_1945-12-31.map + +allocationSegmentsForGroundwater = others/irrigationZones/half_arc_degree/uniqueIds30min.nom.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = False + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/states/groundwaterHeadLayer1_1945-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/modflow/transient/states/groundwaterHeadLayer2_1945-12-31.map + + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = False + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/timestepsToAvgDischarge_1945-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/waterBodyStorage_1945-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/channelStorage_1945-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/readAvlChannelStorage_1945-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgDischargeLong_1945-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgDischargeShort_1945-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/m2tDischargeLong_1945-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgBaseflowLong_1945-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/riverbedExchange_1945-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/subDischarge_1945-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgLakeReservoirInflowShort_1945-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/begin/global/states/avgLakeReservoirOutflowLong_1945-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal,totalGroundwaterAbstraction,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation,fracSurfaceWaterAllocation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,totalGroundwaterAbstraction,totalAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow,runoff,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,irrigationWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,irrigationWaterWithdrawalVolume,domesticWaterWithdrawalVolume,industryWaterWithdrawalVolume,livestockWaterWithdrawalVolume,totalGroundwaterAbstractionVolume,surfaceWaterAbstractionVolume,desalinationAbstractionVolume,irrGrossDemandVolume,nonIrrGrossDemandVolume,totalGrossDemandVolume,precipitation_at_irrigation,netLqWaterToSoil_at_irrigation,evaporation_from_irrigation,transpiration_from_irrigation,precipitation_at_irrigation_volume,netLqWaterToSoil_at_irrigation_volume,evaporation_from_irrigation_volume,transpiration_from_irrigation_volume +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation,fracSurfaceWaterAllocation,fracDesalinatedWaterAllocation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction,surfaceWaterAbstraction,totalAbstraction,nonIrrGrossDemand,nonIrrWaterConsumption,irrPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,precipitation_at_irrigation,evaporation_from_irrigation +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False + diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1946_part_one.sh b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1946_part_one.sh new file mode 100644 index 000000000..4e010e44f --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1946_part_one.sh @@ -0,0 +1,11 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/non-natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1946_part_one.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - non-natural - with extra spin-up - part_one - start from 1901 +# - continue from 1946 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1946_part_two.sh b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1946_part_two.sh new file mode 100644 index 000000000..e0c1480f1 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1946/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1946_part_two.sh @@ -0,0 +1,11 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/non-natural/continue_from_1946/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1946_part_two.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - non-natural - with extra spin-up - part_two - start from 1901 +# - continue from 1946 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1986_part_one.ini b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1986_part_one.ini new file mode 100644 index 000000000..f5085c0a0 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1986_part_one.ini @@ -0,0 +1,547 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1986/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +# PART ONE +cloneAreas = part_one +#~ # PART TWO +#~ cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1986-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = True + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = PCRGLOBWB20/input30min/landSurface/waterDemand/efficiency/efficiency.map + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = PCRGLOBWB20/input5min/landSurface/waterDemand/irrigated_areas/irrigationArea05ArcMin.nc + +includeDomesticWaterDemand = True +includeIndustryWaterDemand = True +includeLivestockWaterDemand = True + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/domestic_water_demand_5min_meter_per_day.nc +industryWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/industry_water_demand_5min_meter_per_day.nc +livestockWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/livestock_water_demand_5min_meter_per_day.nc + +# desalination water supply (maximum/potential/capacity) +desalinationWater = /projects/0/dfguu/users/edwin/data/data_from_yoshi/desalination/desalination_in_m_per_day_05min/desalination_water_version_april_2015.nc + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map + +limitAbstraction = True + +# pcraster maps defining the partitioning of groundwater - surface water source to minimize +# - predefined surface water - groundwater partitioning for irrigation demand (based on Siebert, 2010/2013: Global Map of Irrigation Areas version 5) +irrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_SWFRAC.map +irrigationSurfaceWaterAbstractionFractionDataQuality = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_QUAL.map +# - predefined surface water - groundwater partitioning for irrigation demand (based on McDonald, 2014) +maximumNonIrrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/McDonald_water_infrastructure/max_city_sw_fraction.map +# threshold values defining the preference for surface water source for irrigation purpose +# - treshold to maximize surface water irrigation use (cells with irrSurfaceWaterAbstractionFraction above this will prioritize irrigation surface water use) +treshold_to_maximize_irrigation_surface_water = 0.50 +# - treshold to minimize fossil water withdrawal for irrigation (cells with irrSurfaceWaterAbstractionFraction below this have no fossil withdrawal for irrigation) +treshold_to_minimize_fossil_groundwater_irrigation = 0.70 + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interceptStor_forest_1985-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowCoverSWE_forest_1985-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowFreeWater_forest_1985-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/topWaterLayer_forest_1985-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storUpp_forest_1985-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storLow_forest_1985-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interflow_forest_1985-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interceptStor_grassland_1985-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowCoverSWE_grassland_1985-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowFreeWater_grassland_1985-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/topWaterLayer_grassland_1985-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storUpp_grassland_1985-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storLow_grassland_1985-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interflow_grassland_1985-12-31.map + +[irrPaddyOptions] + +name = irrPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map +maxRootDepth = 0.5 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.05 +minCropKC = 0.2 +cropDeplFactor = 0.2 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interceptStor_irrPaddy_1985-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowCoverSWE_irrPaddy_1985-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowFreeWater_irrPaddy_1985-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/topWaterLayer_irrPaddy_1985-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storUpp_irrPaddy_1985-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storLow_irrPaddy_1985-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interflow_irrPaddy_1985-12-31.map + +[irrNonPaddyOptions] + +name = irrNonPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map +maxRootDepth = 1.0 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 +cropDeplFactor = 0.5 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interceptStor_irrNonPaddy_1985-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowCoverSWE_irrNonPaddy_1985-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowFreeWater_irrNonPaddy_1985-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/topWaterLayer_irrNonPaddy_1985-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storUpp_irrNonPaddy_1985-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storLow_irrNonPaddy_1985-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interflow_irrNonPaddy_1985-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# annual pumping capacity for each region (unit: billion cubic meter per year), should be given in a netcdf file +pumpingCapacityNC = /projects/0/dfguu/users/edwin/data/limit_gw_abstraction_half_arc_degree/design_pumping_capacity/regional_abstraction_limit.nc + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgNonFossilGroundwaterAllocationLong_1985-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgNonFossilGroundwaterAllocationShort_1985-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAbstraction_1985-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAllocationLong_1985-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAllocationShort_1985-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/maps/storGroundwater_1985-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/maps/relativeGroundwaterHead_1985-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/maps/baseflow_1985-12-31.map + +allocationSegmentsForGroundwater = others/irrigationZones/half_arc_degree/uniqueIds30min.nom.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = False + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/states/groundwaterHeadLayer1_1985-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/states/groundwaterHeadLayer2_1985-12-31.map + + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = False + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/timestepsToAvgDischarge_1985-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/waterBodyStorage_1985-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/channelStorage_1985-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/readAvlChannelStorage_1985-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgDischargeLong_1985-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgDischargeShort_1985-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/m2tDischargeLong_1985-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgBaseflowLong_1985-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/riverbedExchange_1985-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/subDischarge_1985-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgLakeReservoirInflowShort_1985-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgLakeReservoirOutflowLong_1985-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal,totalGroundwaterAbstraction,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation,fracSurfaceWaterAllocation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,totalGroundwaterAbstraction,totalAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow,runoff,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,irrigationWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,irrigationWaterWithdrawalVolume,domesticWaterWithdrawalVolume,industryWaterWithdrawalVolume,livestockWaterWithdrawalVolume,totalGroundwaterAbstractionVolume,surfaceWaterAbstractionVolume,desalinationAbstractionVolume,irrGrossDemandVolume,nonIrrGrossDemandVolume,totalGrossDemandVolume,precipitation_at_irrigation,netLqWaterToSoil_at_irrigation,evaporation_from_irrigation,transpiration_from_irrigation,precipitation_at_irrigation_volume,netLqWaterToSoil_at_irrigation_volume,evaporation_from_irrigation_volume,transpiration_from_irrigation_volume +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation,fracSurfaceWaterAllocation,fracDesalinatedWaterAllocation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction,surfaceWaterAbstraction,totalAbstraction,nonIrrGrossDemand,nonIrrWaterConsumption,irrPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,precipitation_at_irrigation,evaporation_from_irrigation +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False + diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1986_part_two.ini b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1986_part_two.ini new file mode 100644 index 000000000..f3644e402 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1986_part_two.ini @@ -0,0 +1,547 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1986/ + +# the following is needed for a parallel run +#~ cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 +# +#~ # PART ONE +#~ cloneAreas = part_one +# PART TWO +cloneAreas = part_two + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_%3s.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_%3s.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1986-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW modle used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = True + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = PCRGLOBWB20/input30min/landSurface/waterDemand/efficiency/efficiency.map + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = PCRGLOBWB20/input5min/landSurface/waterDemand/irrigated_areas/irrigationArea05ArcMin.nc + +includeDomesticWaterDemand = True +includeIndustryWaterDemand = True +includeLivestockWaterDemand = True + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/domestic_water_demand_5min_meter_per_day.nc +industryWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/industry_water_demand_5min_meter_per_day.nc +livestockWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/livestock_water_demand_5min_meter_per_day.nc + +# desalination water supply (maximum/potential/capacity) +desalinationWater = /projects/0/dfguu/users/edwin/data/data_from_yoshi/desalination/desalination_in_m_per_day_05min/desalination_water_version_april_2015.nc + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map + +limitAbstraction = True + +# pcraster maps defining the partitioning of groundwater - surface water source to minimize +# - predefined surface water - groundwater partitioning for irrigation demand (based on Siebert, 2010/2013: Global Map of Irrigation Areas version 5) +irrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_SWFRAC.map +irrigationSurfaceWaterAbstractionFractionDataQuality = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_QUAL.map +# - predefined surface water - groundwater partitioning for irrigation demand (based on McDonald, 2014) +maximumNonIrrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/McDonald_water_infrastructure/max_city_sw_fraction.map +# threshold values defining the preference for surface water source for irrigation purpose +# - treshold to maximize surface water irrigation use (cells with irrSurfaceWaterAbstractionFraction above this will prioritize irrigation surface water use) +treshold_to_maximize_irrigation_surface_water = 0.50 +# - treshold to minimize fossil water withdrawal for irrigation (cells with irrSurfaceWaterAbstractionFraction below this have no fossil withdrawal for irrigation) +treshold_to_minimize_fossil_groundwater_irrigation = 0.70 + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interceptStor_forest_1985-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowCoverSWE_forest_1985-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowFreeWater_forest_1985-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/topWaterLayer_forest_1985-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storUpp_forest_1985-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storLow_forest_1985-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interflow_forest_1985-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interceptStor_grassland_1985-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowCoverSWE_grassland_1985-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowFreeWater_grassland_1985-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/topWaterLayer_grassland_1985-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storUpp_grassland_1985-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storLow_grassland_1985-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interflow_grassland_1985-12-31.map + +[irrPaddyOptions] + +name = irrPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map +maxRootDepth = 0.5 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.05 +minCropKC = 0.2 +cropDeplFactor = 0.2 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interceptStor_irrPaddy_1985-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowCoverSWE_irrPaddy_1985-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowFreeWater_irrPaddy_1985-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/topWaterLayer_irrPaddy_1985-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storUpp_irrPaddy_1985-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storLow_irrPaddy_1985-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interflow_irrPaddy_1985-12-31.map + +[irrNonPaddyOptions] + +name = irrNonPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map +maxRootDepth = 1.0 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 +cropDeplFactor = 0.5 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc + +# initial conditions: +interceptStorIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interceptStor_irrNonPaddy_1985-12-31.map +snowCoverSWEIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowCoverSWE_irrNonPaddy_1985-12-31.map +snowFreeWaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/snowFreeWater_irrNonPaddy_1985-12-31.map +topWaterLayerIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/topWaterLayer_irrNonPaddy_1985-12-31.map +storUppIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storUpp_irrNonPaddy_1985-12-31.map +storLowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/storLow_irrNonPaddy_1985-12-31.map +interflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/interflow_irrNonPaddy_1985-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# annual pumping capacity for each region (unit: billion cubic meter per year), should be given in a netcdf file +pumpingCapacityNC = /projects/0/dfguu/users/edwin/data/limit_gw_abstraction_half_arc_degree/design_pumping_capacity/regional_abstraction_limit.nc + +# initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgNonFossilGroundwaterAllocationLong_1985-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgNonFossilGroundwaterAllocationShort_1985-12-31.map +avgTotalGroundwaterAbstractionIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAbstraction_1985-12-31.map +avgTotalGroundwaterAllocationLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAllocationLong_1985-12-31.map +avgTotalGroundwaterAllocationShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgTotalGroundwaterAllocationShort_1985-12-31.map +# +# initial conditions for MODFLOW run +storGroundwaterIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/maps/storGroundwater_1985-12-31.map +storGroundwaterFossilIni = 0.0 +relativeGroundwaterHeadIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/maps/relativeGroundwaterHead_1985-12-31.map +baseflowIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/maps/baseflow_1985-12-31.map + +allocationSegmentsForGroundwater = others/irrigationZones/half_arc_degree/uniqueIds30min.nom.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = False + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +# option to ignore negative capillary rise during MODFLOW simulation +ignoreCapRise = False + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = True +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/states/groundwaterHeadLayer1_1985-12-31.map +groundwaterHeadLayer2Ini = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/modflow/transient/states/groundwaterHeadLayer2_1985-12-31.map + + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +routingMethod = accuTravelTime +#~ routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = False + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/timestepsToAvgDischarge_1985-12-31.map +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/waterBodyStorage_1985-12-31.map +channelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/channelStorage_1985-12-31.map +readAvlChannelStorageIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/readAvlChannelStorage_1985-12-31.map +avgDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgDischargeLong_1985-12-31.map +avgDischargeShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgDischargeShort_1985-12-31.map +m2tDischargeLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/m2tDischargeLong_1985-12-31.map +avgBaseflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgBaseflowLong_1985-12-31.map +riverbedExchangeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/riverbedExchange_1985-12-31.map +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/subDischarge_1985-12-31.map +# +avgLakeReservoirInflowShortIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgLakeReservoirInflowShort_1985-12-31.map +avgLakeReservoirOutflowLongIni = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/continue_from_1946/global/states/avgLakeReservoirOutflowLong_1985-12-31.map + + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal,totalGroundwaterAbstraction,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation,fracSurfaceWaterAllocation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,totalGroundwaterAbstraction,totalAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow,runoff,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,irrigationWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,irrigationWaterWithdrawalVolume,domesticWaterWithdrawalVolume,industryWaterWithdrawalVolume,livestockWaterWithdrawalVolume,totalGroundwaterAbstractionVolume,surfaceWaterAbstractionVolume,desalinationAbstractionVolume,irrGrossDemandVolume,nonIrrGrossDemandVolume,totalGrossDemandVolume,precipitation_at_irrigation,netLqWaterToSoil_at_irrigation,evaporation_from_irrigation,transpiration_from_irrigation,precipitation_at_irrigation_volume,netLqWaterToSoil_at_irrigation_volume,evaporation_from_irrigation_volume,transpiration_from_irrigation_volume +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation,fracSurfaceWaterAllocation,fracDesalinatedWaterAllocation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction +outMonthAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness +outMonthEndNC = storGroundwater,totalWaterStorageThickness +outAnnuaTotNC = totalEvaporation,precipitation,gwRecharge,totalRunoff,totalGroundwaterAbstraction,surfaceWaterAbstraction,totalAbstraction,nonIrrGrossDemand,nonIrrWaterConsumption,irrPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,precipitation_at_irrigation,evaporation_from_irrigation +outAnnuaAvgNC = discharge,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,totalWaterStorageThickness,temperature +outAnnuaEndNC = storGroundwater,totalWaterStorageThickness +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False + diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1986_part_one.sh b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1986_part_one.sh new file mode 100644 index 000000000..63cdf7124 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1986_part_one.sh @@ -0,0 +1,12 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/non-natural/continue_from_1986/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1986_part_one.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - non-natural - with extra spin-up - part_one - start from 1901 +# - continue from 1946 +# - continue from 1986 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1986_part_two.sh b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1986_part_two.sh new file mode 100644 index 000000000..7b5fbf620 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/non-natural/continue_from_1986/wmod1901_4LCs_edwin_parameter_set_extra_spinup_continue_from_1986_part_two.sh @@ -0,0 +1,12 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# transient run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model +python parallel_pcrglobwb_with_prefactors_2016_03_29.py ../config/05min_runs_may_2016/4LCs_edwin_parameter_set_with_modflow/no_correction/from_1901_extra_spin_up/non-natural/continue_from_1986/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup_from_1901_continue_from_1986_part_two.ini + +# NOTE: pcrglobwb modflow - 4 LCs - edwin parameter set - no correction - non-natural - with extra spin-up - part_two - start from 1901 +# - continue from 1946 +# - continue from 1986 diff --git a/config/4LCs_edwin_parameter_set_with_modflow/steady-state/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup.STEADYSTATE_natural_1901to1925.ini b/config/4LCs_edwin_parameter_set_with_modflow/steady-state/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup.STEADYSTATE_natural_1901to1925.ini new file mode 100644 index 000000000..006a719c0 --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/steady-state/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup.STEADYSTATE_natural_1901to1925.ini @@ -0,0 +1,177 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwin/05min_runs_may_2016/pcrglobwb_modflow_from_1901_4LCs_edwin_parameter_set/no_correction/natural_steady-state/ + +cloneAreas = Global + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 1901-01-01 +endTime = 1901-01-01 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +[globalModflowOptions] + +# option to indicate if an online coupling between PCR-GLOBWB and MODFLOW model used +online_coupling_between_pcrglobwb_and_moflow = True + +cloneMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +#~ cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M03.map + +# The area/landmask of interest: +landmask = None +# If None, area/landmask is limited for cells with ldd value. + +# temporary modflow folder: +tmp_modflow_dir = /dev/shm/edwin/pcrglobwb_modflow/ + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = 1000. + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[modflowParameterOptions] + +# number of modflow layers: +number_of_layers = 2 + +# confining layer properties (thickness in meter, maximum vertical conductivity in m/day, maximum resistance in day) +usePreDefinedConfiningLayer = True +confiningLayerThickness = /projects/0/dfguu/users/edwin/data/inge_confining_layer_parameters/confining_layer_thickness_edwin.map +maximumConfiningLayerVerticalConductivity = 0.001 +maximumConfiningLayerResistance = 20000. + +# TODO: Define aquifer specific yield/storage coefficient value for each layer +# TODO: Define aquifer conductivity values for each layer +# - At this moment, aquifer parameters for MODFLOW (specific yield/storage coefficient and conductivity values) are +# based on "groundwaterOptions" (e.g. "groundwaterPropertiesNC" and "estimateOfTotalGroundwaterThickness"). + +# minimum and maximum values for transmissivities (unit: m/day) +minTransmissivity = 10.0 +maxTransmissivity = 750. + +# netcdf files contain the information about elevations and channel/routing parameters +# - these files would be used to convert discharge to surface water elevation +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +channelNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/channel_parameters_5_arcmin_october_2015.nc +# - the manning coefficient used for converting discharge values to surface water elevation values +manningsN = 0.04 +# - lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +# - option to ignore reservoirs (using only natural water bodies) +onlyNaturalWaterBodies = True + +# assumption for the thickness/depth (m) of accessible groundwater (needed for coupling to PCR-GLOBWB) +accessibleDepth = 1000. + +[modflowTransientInputOptions] + +# the following is None for an online coupling between PCR-GLOBWB and MODFLOW +dischargeInputNC = None +groundwaterRechargeInputNC = None +groundwaterAbstractionInputNC = None +channelStorageInputNC = None + +usingPredefinedInitialHead = False +# - if False, the initial groundwater head(s) will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - if True , the following initial conditions of the groundwater head will be based on the steady state simulation using the input defined in modflowSteadyStateInputOptions +# - Note: For the online coupling PCR-GLOBWB-MODFLOW, we have to first define the initial conditions of groundwater head (usingPredefinedInitialHead = True) + +# initial conditions for groundwater head (unit: m) +groundwaterHeadLayer1Ini = None +groundwaterHeadLayer2Ini = None + +[modflowSteadyStateInputOptions] + +# The following input maps used for the steady state run +# - average discharge (unit: m3/s) +avgDischargeInputMap = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/netcdf/1901_to_1925/discharge_annuaAvg_output_average_1901_to_1925.map +# - average groundwater recharge (unit: m/day) +avgGroundwaterRechargeInputMap = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/netcdf/1901_to_1925/gwRecharge_annuaAvg_output_average_1901_to_1925.map +# - average groundwater abstraction (unit: m/day) +avgGroundwaterAbstractionInputMap = 0.0 +# - average channel storage (unit: m3) - optional +avgChannelStorageInputMap = /projects/0/wtrcycle/users/edwin/05min_runs_february_2016/pcrglobwb_only_from_1901_4LCs_edwin_parameter_set_natural/no_correction/global/netcdf/1901_to_1925/channelStorage_annuaAvg_output_average_1901_to_1925.map + +usingInitialHeadEstimate = False + +# initial estimate for groundwater head (unit: m) +groundwaterHeadLayer1Estimate = None +groundwaterHeadLayer2Estimate = None + +# option to ignore negative capillary rise during a steady state simulation +ignoreCapRiseSteadyState = True + +# option to introduce extra spin-up years (using transient simulation with constant input with 30 day stress period) +extraSpinUpYears = 20 + +[reportingForModflowOptions] + +# output files from modflow calculation that will be written in the disk in netcdf files: +outMonthEndNC = groundwaterHead,groundwaterHeadLayer1,groundwaterDepthLayer1,groundwaterHeadLayer2,groundwaterDepthLayer2,relativeGroundwaterHead,groundwaterVolumeEstimate,groundwaterThicknessEstimate +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +# At this moment, we cannot report the following. +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None + +[reportingOptions] + +# output pcrglobwb files that will be written in the disk in netcdf files: +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outMonthEndNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +[mergingOutputOptions] + +# output pcrglobw variables/files that will be merged: +outDailyTotNC = None +outMonthTotNC = None +outMonthAvgNC = None +outMonthEndNC = None +outAnnuaTotNC = None +outAnnuaAvgNC = None +outAnnuaEndNC = None +# netcdf format and zlib setup +formatNetCDF = NETCDF4 +zlib = True + +delete_unmerged_pcraster_maps = False + diff --git a/config/4LCs_edwin_parameter_set_with_modflow/steady-state/wmod1901_4LCs_edwin_parameter_set_extra_spinup_steady-state.sh b/config/4LCs_edwin_parameter_set_with_modflow/steady-state/wmod1901_4LCs_edwin_parameter_set_extra_spinup_steady-state.sh new file mode 100644 index 000000000..b6699058c --- /dev/null +++ b/config/4LCs_edwin_parameter_set_with_modflow/steady-state/wmod1901_4LCs_edwin_parameter_set_extra_spinup_steady-state.sh @@ -0,0 +1,10 @@ +#!/bin/bash +#SBATCH -N 1 +#SBATCH -t 119:59:00 +#SBATCH -p normal + +# steady state run +cd /home/edwin/github/edwinkost/PCR-GLOBWB/model/ +python deterministic_runner_for_monthly_merging_and_modflow_2016_03_29.py ../config/05min_runs_may_2016/4LCs_with_modflow/no_correction/from_1901_extra_spin_up/steady-state/setup_05min_CRU-TS3.23_ERA20C_pcrglobwb_with_modflow_4LCs_edwin_parameter_set_extra_spinup.STEADYSTATE_natural_1901to1925.ini debug steady-state-only + +# NOTE: pcrglobwb modflow - 4LCs edwin parameter set - no_correction - natural - steady-state diff --git a/config/fixing_water_bodies/example_for_rens.docx b/config/fixing_water_bodies/example_for_rens.docx new file mode 100644 index 000000000..e738cabe5 Binary files /dev/null and b/config/fixing_water_bodies/example_for_rens.docx differ diff --git a/config/fixing_water_bodies/setup_test_M13.ini b/config/fixing_water_bodies/setup_test_M13.ini new file mode 100644 index 000000000..adea34a9c --- /dev/null +++ b/config/fixing_water_bodies/setup_test_M13.ini @@ -0,0 +1,440 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwinhs/test_water_bodies_4LCs_after_indonesia_working_back_in_holland/ + +# the following is needed for a parallel run +cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M13.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +#~ landmask = None +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_M13.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (not coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 2004-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = True + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = PCRGLOBWB20/input30min/landSurface/waterDemand/efficiency/efficiency.map + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = PCRGLOBWB20/input5min/landSurface/waterDemand/irrigated_areas/irrigationArea05ArcMin.nc + +includeDomesticWaterDemand = True +includeIndustryWaterDemand = True +includeLivestockWaterDemand = True + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/domestic_water_demand_5min_meter_per_day.nc +industryWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/industry_water_demand_5min_meter_per_day.nc +livestockWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/livestock_water_demand_5min_meter_per_day.nc + +# desalination water supply (maximum/potential/capacity) +desalinationWater = /projects/0/dfguu/users/edwin/data/data_from_yoshi/desalination/desalination_in_m_per_day_05min/desalination_water_version_april_2015.nc + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map + +# pcraster maps defining the partitioning of groundwater - surface water source to minimize +# - predefined surface water - groundwater partitioning for irrigation demand (based on Siebert, 2010/2013: Global Map of Irrigation Areas version 5) +irrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_SWFRAC.map +irrigationSurfaceWaterAbstractionFractionDataQuality = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_QUAL.map +# - predefined surface water - groundwater partitioning for irrigation demand (based on McDonald, 2014) +maximumNonIrrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/McDonald_water_infrastructure/max_city_sw_fraction.map +# threshold values defining the preference for surface water source for irrigation purpose +# - treshold to maximize surface water irrigation use (cells with irrSurfaceWaterAbstractionFraction above this will prioritize irrigation surface water use) +treshold_to_maximize_irrigation_surface_water = 0.50 +# - treshold to minimize fossil water withdrawal for irrigation (cells with irrSurfaceWaterAbstractionFraction below this have no fossil withdrawal for irrigation) +treshold_to_minimize_fossil_groundwater_irrigation = 0.70 + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interceptStor_forest_2003-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowCoverSWE_forest_2003-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowFreeWater_forest_2003-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/topWaterLayer_forest_2003-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storUpp_forest_2003-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storLow_forest_2003-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interflow_forest_2003-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interceptStor_grassland_2003-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowCoverSWE_grassland_2003-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowFreeWater_grassland_2003-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/topWaterLayer_grassland_2003-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storUpp_grassland_2003-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storLow_grassland_2003-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interflow_grassland_2003-12-31.map + +[irrPaddyOptions] + +name = irrPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map +maxRootDepth = 0.5 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.05 +minCropKC = 0.2 +cropDeplFactor = 0.2 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interceptStor_irrPaddy_2003-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowCoverSWE_irrPaddy_2003-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowFreeWater_irrPaddy_2003-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/topWaterLayer_irrPaddy_2003-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storUpp_irrPaddy_2003-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storLow_irrPaddy_2003-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interflow_irrPaddy_2003-12-31.map + +[irrNonPaddyOptions] + +name = irrNonPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map +maxRootDepth = 1.0 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 +cropDeplFactor = 0.5 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interceptStor_irrNonPaddy_2003-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowCoverSWE_irrNonPaddy_2003-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowFreeWater_irrNonPaddy_2003-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/topWaterLayer_irrNonPaddy_2003-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storUpp_irrNonPaddy_2003-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storLow_irrNonPaddy_2003-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interflow_irrNonPaddy_2003-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = None + +# annual pumping capacity for each region (unit: billion cubic meter per year), should be given in a netcdf file +pumpingCapacityNC = /projects/0/dfguu/users/edwin/data/limit_gw_abstraction_half_arc_degree/design_pumping_capacity/regional_abstraction_limit.nc + +# initial conditions: +storGroundwaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storGroundwater_2003-12-31.map +storGroundwaterFossilIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storGroundwaterFossil_2003-12-31.map +# +# additional initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgNonFossilGroundwaterAllocationLong_2003-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgNonFossilGroundwaterAllocationShort_2003-12-31.map +avgTotalGroundwaterAbstractionIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgTotalGroundwaterAbstraction_2003-12-31.map +avgTotalGroundwaterAllocationLongIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgTotalGroundwaterAllocationLong_2003-12-31.map +avgTotalGroundwaterAllocationShortIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgTotalGroundwaterAllocationShort_2003-12-31.map +# +# additional initial conditions for MODFLOW run +relativeGroundwaterHeadIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/relativeGroundwaterHead_2003-12-31.map +baseflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/baseflow_2003-12-31.map + +#~ allocationSegmentsForGroundwater = None +allocationSegmentsForGroundwater = others/irrigationZones/half_arc_degree/uniqueIds30min.nom.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +#~ routingMethod = accuTravelTime +routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = False + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = 0 +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = 0.0 +channelStorageIni = 0.0 +readAvlChannelStorageIni = 0.0 +avgDischargeLongIni = 0.0 +avgDischargeShortIni = 0.0 +m2tDischargeLongIni = 0.0 +avgBaseflowLongIni = 0.0 +riverbedExchangeIni = 0.0 +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = 0.0 +# +avgLakeReservoirInflowShortIni = 0.0 +avgLakeReservoirOutflowLongIni = 0.0 + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = discharge,channelStorage,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal,totalGroundwaterAbstraction,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation,fracSurfaceWaterAllocation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outMonthMaxNC = discharge,channelStorage,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,totalGroundwaterAbstraction,totalAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow,runoff,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,irrigationWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,irrigationWaterWithdrawalVolume,domesticWaterWithdrawalVolume,industryWaterWithdrawalVolume,livestockWaterWithdrawalVolume,totalGroundwaterAbstractionVolume,surfaceWaterAbstractionVolume,desalinationAbstractionVolume,irrGrossDemandVolume,nonIrrGrossDemandVolume,totalGrossDemandVolume,precipitation_at_irrigation,netLqWaterToSoil_at_irrigation,evaporation_from_irrigation,transpiration_from_irrigation,precipitation_at_irrigation_volume,netLqWaterToSoil_at_irrigation_volume,evaporation_from_irrigation_volume,transpiration_from_irrigation_volume +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation,fracSurfaceWaterAllocation,fracDesalinatedWaterAllocation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaMaxNC = discharge,channelStorage,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage +# netcdf format and zlib setup +formatNetCDF = NETCDF3_CLASSIC +zlib = False diff --git a/config/setup_Global_30arcmin.ini b/config/setup_Global_30arcmin.ini deleted file mode 100755 index 40c6542bb..000000000 --- a/config/setup_Global_30arcmin.ini +++ /dev/null @@ -1,293 +0,0 @@ -[globalOptions] - -# Set the input directory map in an absolute path. -# - The input forcing and parameter directories will be relative to this. -inputDir = /data/hydroworld/ - -# Map of clone (must be provided in PCRaster maps) -# - Spatial resolution and coverage are based on this map: -cloneMap = others/Global/Global_CloneMap_30min.map - -# The area/landmask of interest: -landmask = None -# If None, area/landmask is limited for cells with ldd value. - -# Set the output directory in an absolute path. -#~ outputDir = OUTPUTDIRECTORY -outputDir = /scratch/edwin/test/ - -# netcdf attributes for output files: -institution = Department of Physical Geography, Utrecht University -title = PCR-GLOBWB output -description = test version (by Edwin H. Sutanudjaja) - -startTime = 1960-01-01 -endTime = 2010-12-31 -# Format: YYYY-MM-DD -# The model runs on the daily time step. - -# spinning up options -maxSpinUpsInYears = 35 -minConvForTotlSto = 0.5 -minConvForSoilSto = 0.5 -minConvForGwatSto = 0.5 -minConvForChanSto = 0.5 - -[meteoOptions] - -# Set the forcing temperature and precipitation files (relative to inputDir) -precipitationNC = forcing/CRU-TS3.21/merged_1958_to_2010/CRU-TS3.21_ERA-40_ERA-Interim_daily_precipitation_1958_to_2010.nc -temperatureNC = forcing/CRU-TS3.21/merged_1958_to_2010/CRU-TS3.21_ERA-40_ERA-Interim_daily_temperature_1958_to_2010.nc - -# Method to calculate referencePotETP (reference potential evaporation+transpiration) -referenceETPotMethod = Input -# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: -refETPotFileNC = forcing/CRU-TS3.21/merged_1958_to_2010/CRU-TS3.21_ERA-40_ERA-Interim_daily_referencePotET_1958_to_2010.nc - -[landSurfaceOptions] -debugWaterBalance = True - -numberOfUpperSoilLayers = 2 - -topographyNC = PCRGLOBWB20/input30min/landSurface/topo/topoProperties.nc -soilPropertiesNC = PCRGLOBWB20/input30min/landSurface/soil/soilProperties.nc - -includeIrrigation = True -# if True, there are four land cover types defined: forest,grassland,irrPaddy,irrNonPaddy -# if False, two (natural) land cover types defined: forest,grassland - -# netcdf time series for historical expansion of irrigation areas (unit: hectares). -# Note: The resolution of this map must be consisten with the resolution of cellArea. -#~ historicalIrrigationArea = None -historicalIrrigationArea = PCRGLOBWB20/input30min/landSurface/waterDemand/irrigated_areas/irrigationArea30ArcMin.nc - -includeDomesticWaterDemand = True -includeIndustryWaterDemand = True - -domesticWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/domesticWaterDemand30ArcMin.nc -industryWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/industryWaterDemand30ArcMin.nc - -limitAbstraction = False - -# zone IDs (scale) at which ground- surface-water allocation is performed -#~ allocationSegmentsForGroundSurfaceWater = None -allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map - -[forestOptions] -name = forest -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/forest/forestProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/forest/Global_CropCoefficientKc-Forest_30min.nc -interceptCapNC = PCRGLOBWB20/input30min/landCover/forest/interceptCapInputForest366days.nc -coverFractionNC = PCRGLOBWB20/input30min/landCover/forest/coverFractionInputForest366days.nc - -# initial conditions: -interceptStorIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interceptStor_forest_1960-12-31.map -snowCoverSWEIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowCoverSWE_forest_1960-12-31.map -snowFreeWaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowFreeWater_forest_1960-12-31.map -topWaterLayerIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/topWaterLayer_forest_1960-12-31.map -storUppIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storUpp_forest_1960-12-31.map -storLowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storLow_forest_1960-12-31.map -interflowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interflow_forest_1960-12-31.map - -[grasslandOptions] -name = grassland -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/grassland/grasslandProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/grassland/Global_CropCoefficientKc-Grassland_30min.nc -interceptCapNC = PCRGLOBWB20/input30min/landCover/grassland/interceptCapInputGrassland366days.nc -coverFractionNC = PCRGLOBWB20/input30min/landCover/grassland/coverFractionInputGrassland366days.nc - -# initial conditions: -interceptStorIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interceptStor_grassland_1960-12-31.map -snowCoverSWEIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowCoverSWE_grassland_1960-12-31.map -snowFreeWaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowFreeWater_grassland_1960-12-31.map -topWaterLayerIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/topWaterLayer_grassland_1960-12-31.map -storUppIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storUpp_grassland_1960-12-31.map -storLowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storLow_grassland_1960-12-31.map -interflowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interflow_grassland_1960-12-31.map - -[irrPaddyOptions] -name = irrPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/irrPaddy/paddyProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.05 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.2 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc - -# initial conditions: -interceptStorIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interceptStor_irrPaddy_1960-12-31.map -snowCoverSWEIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowCoverSWE_irrPaddy_1960-12-31.map -snowFreeWaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowFreeWater_irrPaddy_1960-12-31.map -topWaterLayerIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/topWaterLayer_irrPaddy_1960-12-31.map -storUppIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storUpp_irrPaddy_1960-12-31.map -storLowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storLow_irrPaddy_1960-12-31.map -interflowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interflow_irrPaddy_1960-12-31.map - -[irrNonPaddyOptions] -name = irrNonPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/nonPaddyProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.5 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc - -# initial conditions: -interceptStorIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interceptStor_irrNonPaddy_1960-12-31.map -snowCoverSWEIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowCoverSWE_irrNonPaddy_1960-12-31.map -snowFreeWaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowFreeWater_irrNonPaddy_1960-12-31.map -topWaterLayerIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/topWaterLayer_irrNonPaddy_1960-12-31.map -storUppIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storUpp_irrNonPaddy_1960-12-31.map -storLowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storLow_irrNonPaddy_1960-12-31.map -interflowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interflow_irrNonPaddy_1960-12-31.map - -[groundwaterOptions] -debugWaterBalance = True - -groundwaterPropertiesNC = PCRGLOBWB20/input30min/groundwater/groundwaterProperties.nc - -# minimum value for groundwater recession coefficient (day-1) -minRecessionCoeff = 2.5e-4 - -# initial condition: -storGroundwaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storGroundwater_1960-12-31.map -storGroundwaterFossilIni = 0.0 -avgTotalGroundwaterAbstractionIni = 0.0 - -[routingOptions] -debugWaterBalance = True - -lddMap = PCRGLOBWB20/input30min/routing/lddsound_30min.map -cellAreaMap = PCRGLOBWB20/input30min/routing/cellarea30min.map -gradient = PCRGLOBWB20/input30min/routing/Global_ChannelGradient-RVB_30min.map - -# manning coefficient -manningsN = 0.04 - -# constant channel width (optional) -constantChannelWidth = None - -# minimum channel width (optional) -minimumChannelWidth = None - -routingMethod = accuTravelTime -# Options are kinematicWave, simplifiedKinematicWave and accuTravelTime - -# option for maximum length of a sub time step in seconds (optional and only used if kinematicWave is used) -# - Note that too long sub time step may create water balance errors. -# - Default values: 3600 seconds for 30 arcmin ; 720 seconds for 5 arcmin -#~maxiumLengthOfSubTimeStep = 3600. -#~ maxiumLengthOfSubTimeStep = 720. - -# lake and reservoir parameters -waterBodyInputNC = PCRGLOBWB20/input30min/routing/reservoirs/fromRensJune2013/reservoirparameterization/waterBodies30min.nc -onlyNaturalWaterBodies = False - -# composite crop factors for WaterBodies: -cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc -minCropWaterKC = 0.20 - -# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) -timestepsToAvgDischargeIni = 0.0 -# Note that: -# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) -# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) - -# initial conditions: -waterBodyStorageIni = 0.0 -channelStorageIni = 0.0 -readAvlChannelStorageIni = 0.0 -avgDischargeLongIni = 0.0 -m2tDischargeLongIni = 0.0 -avgBaseflowLongIni = 0.0 -riverbedExchangeIni = 0.0 -avgLakeReservoirInflowShortIni = 0.0 -avgLakeReservoirOutflowLongIni = 0.0 -# -# other initial conditions (optional): -avgDischargeShortIni = 0.0 - -[reportingOptions] - -# output files that will be written in the disk in netcdf files: -outDailyTotNC = discharge,satDegUpp,storUppTotal -outMonthTotNC = totalEvaporation -outMonthAvgNC = discharge,totalWaterStorageThickness -outMonthEndNC = satDegUpp,satDegLow,storUppTotal,storLowTotal,storGroundwater -outAnnuaTotNC = totalEvaporation -outAnnuaAvgNC = discharge,totalWaterStorageThickness,temperature,gwRecharge -outAnnuaEndNC = None diff --git a/config/setup_Global_30arcmin_with_kinematic.ini b/config/setup_Global_30arcmin_with_kinematic.ini deleted file mode 100644 index 8c9237cc7..000000000 --- a/config/setup_Global_30arcmin_with_kinematic.ini +++ /dev/null @@ -1,295 +0,0 @@ -[globalOptions] - -# Set the input directory map in an absolute path. -# - The input forcing and parameter directories will be relative to this. -inputDir = /data/hydroworld/ - -# Map of clone (must be provided in PCRaster maps) -# - Spatial resolution and coverage are based on this map: -cloneMap = others/Global/Global_CloneMap_30min.map - -# The area/landmask of interest: -landmask = None -# If None, area/landmask is limited for cells with ldd value. - -# Set the output directory in an absolute path. -#~ outputDir = OUTPUTDIRECTORY -outputDir = /scratch/edwin/test/ - -# netcdf attributes for output files: -institution = Department of Physical Geography, Utrecht University -title = PCR-GLOBWB output -description = test version (by Edwin H. Sutanudjaja) - -startTime = 1960-01-01 -endTime = 2010-12-31 -# Format: YYYY-MM-DD -# The model runs on the daily time step. - -# spinning up options -maxSpinUpsInYears = 35 -minConvForTotlSto = 0.5 -minConvForSoilSto = 0.5 -minConvForGwatSto = 0.5 -minConvForChanSto = 0.5 - -[meteoOptions] - -# Set the forcing temperature and precipitation files (relative to inputDir) -precipitationNC = /scratch/edwin/input/forcing/edwin_gpcc_merged_1958_to_2010/gpcc-v6_era-40-era-interim_daily_precipitation_1958_to_2010.nc -temperatureNC = forcing/CRU-TS3.21/merged_1958_to_2010/CRU-TS3.21_ERA-40_ERA-Interim_daily_temperature_1958_to_2010.nc - -# Method to calculate referencePotETP (reference potential evaporation+transpiration) -referenceETPotMethod = Input -# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: -refETPotFileNC = forcing/CRU-TS3.21/merged_1958_to_2010/CRU-TS3.21_ERA-40_ERA-Interim_daily_referencePotET_1958_to_2010.nc - -[landSurfaceOptions] -debugWaterBalance = True - -numberOfUpperSoilLayers = 2 - -topographyNC = PCRGLOBWB20/input30min/landSurface/topo/topoProperties.nc -soilPropertiesNC = PCRGLOBWB20/input30min/landSurface/soil/soilProperties.nc - -includeIrrigation = True -# if True, there are four land cover types defined: forest,grassland,irrPaddy,irrNonPaddy -# if False, two (natural) land cover types defined: forest,grassland - -# netcdf time series for historical expansion of irrigation areas (unit: hectares). -# Note: The resolution of this map must be consisten with the resolution of cellArea. -#~ historicalIrrigationArea = None -historicalIrrigationArea = PCRGLOBWB20/input30min/landSurface/waterDemand/irrigated_areas/irrigationArea30ArcMin.nc - -includeDomesticWaterDemand = True -includeIndustryWaterDemand = True - -domesticWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/domesticWaterDemand30ArcMin.nc -industryWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/industryWaterDemand30ArcMin.nc - -limitAbstraction = False - -# zone IDs (scale) at which ground- surface-water allocation is performed -#~ allocationSegmentsForGroundSurfaceWater = None -allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map - -[forestOptions] -name = forest -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/forest/forestProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/forest/Global_CropCoefficientKc-Forest_30min.nc -interceptCapNC = PCRGLOBWB20/input30min/landCover/forest/interceptCapInputForest366days.nc -coverFractionNC = PCRGLOBWB20/input30min/landCover/forest/coverFractionInputForest366days.nc - -# initial conditions: -interceptStorIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interceptStor_forest_1960-12-31.map -snowCoverSWEIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowCoverSWE_forest_1960-12-31.map -snowFreeWaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowFreeWater_forest_1960-12-31.map -topWaterLayerIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/topWaterLayer_forest_1960-12-31.map -storUppIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storUpp_forest_1960-12-31.map -storLowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storLow_forest_1960-12-31.map -interflowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interflow_forest_1960-12-31.map - -[grasslandOptions] -name = grassland -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/grassland/grasslandProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/grassland/Global_CropCoefficientKc-Grassland_30min.nc -interceptCapNC = PCRGLOBWB20/input30min/landCover/grassland/interceptCapInputGrassland366days.nc -coverFractionNC = PCRGLOBWB20/input30min/landCover/grassland/coverFractionInputGrassland366days.nc - -# initial conditions: -interceptStorIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interceptStor_grassland_1960-12-31.map -snowCoverSWEIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowCoverSWE_grassland_1960-12-31.map -snowFreeWaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowFreeWater_grassland_1960-12-31.map -topWaterLayerIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/topWaterLayer_grassland_1960-12-31.map -storUppIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storUpp_grassland_1960-12-31.map -storLowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storLow_grassland_1960-12-31.map -interflowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interflow_grassland_1960-12-31.map - -[irrPaddyOptions] -name = irrPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/irrPaddy/paddyProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.05 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.2 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc - -# initial conditions: -interceptStorIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interceptStor_irrPaddy_1960-12-31.map -snowCoverSWEIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowCoverSWE_irrPaddy_1960-12-31.map -snowFreeWaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowFreeWater_irrPaddy_1960-12-31.map -topWaterLayerIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/topWaterLayer_irrPaddy_1960-12-31.map -storUppIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storUpp_irrPaddy_1960-12-31.map -storLowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storLow_irrPaddy_1960-12-31.map -interflowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interflow_irrPaddy_1960-12-31.map - -[irrNonPaddyOptions] -name = irrNonPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/nonPaddyProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.5 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc - -# initial conditions: -interceptStorIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interceptStor_irrNonPaddy_1960-12-31.map -snowCoverSWEIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowCoverSWE_irrNonPaddy_1960-12-31.map -snowFreeWaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/snowFreeWater_irrNonPaddy_1960-12-31.map -topWaterLayerIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/topWaterLayer_irrNonPaddy_1960-12-31.map -storUppIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storUpp_irrNonPaddy_1960-12-31.map -storLowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storLow_irrNonPaddy_1960-12-31.map -interflowIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/interflow_irrNonPaddy_1960-12-31.map - -[groundwaterOptions] -debugWaterBalance = True - -groundwaterPropertiesNC = PCRGLOBWB20/input30min/groundwater/groundwaterProperties.nc - -# minimum value for groundwater recession coefficient (day-1) -minRecessionCoeff = 2.5e-4 - -# initial condition: -storGroundwaterIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/storGroundwater_1960-12-31.map -storGroundwaterFossilIni = 0.0 -avgTotalGroundwaterAbstractionIni = 0.0 - -[routingOptions] -debugWaterBalance = True - -lddMap = PCRGLOBWB20/input30min/routing/lddsound_30min.map -cellAreaMap = PCRGLOBWB20/input30min/routing/cellarea30min.map -gradient = PCRGLOBWB20/input30min/routing/Global_ChannelGradient-RVB_30min.map - -# manning coefficient -manningsN = 0.04 - -# constant channel width (optional) -constantChannelWidth = None - -# minimum channel width (optional) -minimumChannelWidth = None - -routingMethod = kinematicWave -# Options are kinematicWave, simplifiedKinematicWave and accuTravelTime - -# option for maximum length of a sub time step in seconds (optional and only used if kinematicWave is used) -# - Note that too long sub time step may create water balance errors. -# - Default values: 3600 seconds for 30 arcmin ; 720 seconds for 5 arcmin -maxiumLengthOfSubTimeStep = 3600. -#~ maxiumLengthOfSubTimeStep = 720. - -# lake and reservoir parameters -waterBodyInputNC = PCRGLOBWB20/input30min/routing/reservoirs/fromRensJune2013/reservoirparameterization/waterBodies30min.nc -onlyNaturalWaterBodies = False - -# composite crop factors for WaterBodies: -cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc -minCropWaterKC = 0.20 - -# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) -timestepsToAvgDischargeIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/timestepsToAvgDischarge_1960-12-31.map -# Note that: -# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) -# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) - -# initial conditions: -waterBodyStorageIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/waterBodyStorage_1960-12-31.map -channelStorageIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/channelStorage_1960-12-31.map -readAvlChannelStorageIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/readAvlChannelStorage_1960-12-31.map -avgDischargeLongIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/avgDischargeLong_1960-12-31.map -m2tDischargeLongIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/m2tDischargeLong_1960-12-31.map -avgBaseflowLongIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/avgBaseflowLong_1960-12-31.map -riverbedExchangeIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/riverbedExchange_1960-12-31.map -avgLakeReservoirInflowShortIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/avgLakeReservoirInflowShort_1960-12-31.map -avgLakeReservoirOutflowLongIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/avgLakeReservoirOutflowLong_1960-12-31.map -# -# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) -subDischargeIni = None -# -# other initial conditions (optional): -avgDischargeShortIni = /scratch/edwin/ref_run_30min_gpcc_27_oct_2014/states/avgDischargeShort_1960-12-31.map - -[reportingOptions] -# output files that will be written in the disk in netcdf files: -outDailyTotNC = discharge -outMonthTotNC = totalEvaporation,nonIrrWaterConsumption,nonIrrReturnFlow,gwRecharge,surfaceWaterAbstraction,nonFossilGroundWaterAbstraction,otherWaterSourceAbstraction,totalAbstraction -outMonthAvgNC = discharge,accuBaseflow,storGroundwater,storGroundwaterFossil,storGroundwaterTotal,totalActiveStorageThickness,totalWaterStorageThickness,nonIrrWaterConsumption,nonIrrReturnFlow,fracSurfaceWaterAllocation,fracNonFossilGroundwaterAllocation,fracOtherWaterSourceAllocation,totalFracWaterSourceAllocation,surfaceWaterStorage -outMonthEndNC = satDegUpp,satDegLow,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,storGroundwaterTotal -outAnnuaTotNC = totalEvaporation,accuBaseflow -outAnnuaAvgNC = discharge,totalWaterStorageThickness,gwRecharge,totalEvaporation,accuBaseflow -outAnnuaEndNC = None diff --git a/config/setup_Mississippi_05arcmin_with_kinematic.ini b/config/setup_Mississippi_05arcmin_with_kinematic.ini deleted file mode 100755 index a702ecdc4..000000000 --- a/config/setup_Mississippi_05arcmin_with_kinematic.ini +++ /dev/null @@ -1,349 +0,0 @@ -[globalOptions] - -# Set the input directory map in an absolute path. -# - The input forcing and parameter directories will be relative to this. -inputDir = /data/hydroworld/ - -# Map of clone (must be provided in PCRaster maps) -# - Spatial resolution and coverage are based on this map: -#~ cloneMap = CLONEMAPFILES -cloneMap = others/Mississippi/Mississippi05min.clone.map - -# The area/landmask of interest: -#~ landmask = LANDMASKFILES -landmask = None -# If None, area/landmask is limited for cells with ldd value. - -# Set the output directory in an absolute path. -#~ outputDir = OUTPUTDIRECTORY -outputDir = /scratch/edwin/test_Mississippi - -# netcdf attributes for output files: -institution = Department of Physical Geography, Utrecht University -title = PCR-GLOBWB output -description = test version (by Edwin H. Sutanudjaja) - -startTime = 1960-01-01 -endTime = 2010-12-31 -# Format: YYYY-MM-DD -# The model runs on the daily time step. - -# spinning up options -maxSpinUpsInYears = 35 -minConvForTotlSto = 0.5 -minConvForSoilSto = 0.5 -minConvForGwatSto = 0.5 -minConvForChanSto = 0.5 - -[meteoOptions] - -# Set the forcing temperature and precipitation files (relative to inputDir) -precipitationNC = /scratch/edwin/input/forcing/edwin_gpcc_merged_1958_to_2010/gpcc-v6_era-40-era-interim_daily_precipitation_1958_to_2010.nc -temperatureNC = forcing/CRU-TS3.21/merged_1958_to_2010/CRU-TS3.21_ERA-40_ERA-Interim_daily_temperature_1958_to_2010.nc - -# Method to calculate referencePotETP (reference potential evaporation+transpiration) -referenceETPotMethod = Hamon -# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: -refETPotFileNC = None - -[meteoDownscalingOptions] - -downscalePrecipitation = None -downscaleTemperature = None -downscaleReferenceETPot = None - -# downscaling (based on the digital elevation model): -# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. -meteoDownscaleIds = None -highResolutionDEM = None - -# lapse rates: -temperLapseRateNC = None -precipLapseRateNC = None - -# downscaling criteria -temperatCorrelNC = None -precipitCorrelNC = None - -# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): -smoothingWindowsLength = 0 - -[landSurfaceOptions] -debugWaterBalance = True - -numberOfUpperSoilLayers = 2 - -topographyNC = PCRGLOBWB20/input30min/landSurface/topo/topoProperties.nc -soilPropertiesNC = PCRGLOBWB20/input30min/landSurface/soil/soilProperties.nc - -includeIrrigation = True -# if True, there are four land cover types defined: forest,grassland,irrPaddy,irrNonPaddy -# if False, two (natural) land cover types defined: forest,grassland - -# netcdf time series for historical expansion of irrigation areas (unit: hectares). -# Note: The resolution of this map must be consisten with the resolution of cellArea. -#~ historicalIrrigationArea = None -historicalIrrigationArea = PCRGLOBWB20/input30min/landSurface/waterDemand/irrigated_areas/irrigationArea30ArcMin.nc - -includeDomesticWaterDemand = True -includeIndustryWaterDemand = True - -domesticWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/domesticWaterDemand30ArcMin.nc -industryWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/industryWaterDemand30ArcMin.nc - -limitAbstraction = False - -# zone IDs (scale) at which ground- surface-water allocation is performed -#~ allocationSegmentsForGroundSurfaceWater = None -allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map - -[forestOptions] -name = forest -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following pcraster maps: -fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map -rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map -rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map -maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map - -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input5min/landCover/forest/cropCoefficientForest.nc -interceptCapNC = PCRGLOBWB20/input5min/landCover/forest/interceptCapInputForest.nc -coverFractionNC = PCRGLOBWB20/input5min/landCover/forest/coverFractionInputForest.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[grasslandOptions] -name = grassland -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following values: -fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map -rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map -rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map -maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input5min/landCover/grassland/cropCoefficientGrassland.nc -interceptCapNC = PCRGLOBWB20/input5min/landCover/grassland/interceptCapInputGrassland.nc -coverFractionNC = PCRGLOBWB20/input5min/landCover/grassland/coverFractionInputGrassland.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[irrPaddyOptions] -name = irrPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following values: -fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map -rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map -rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map -maxRootDepth = 0.5 -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.05 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.2 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[irrNonPaddyOptions] -name = irrNonPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following values: -fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map -rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map -rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map -maxRootDepth = 1.0 -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.5 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[groundwaterOptions] -debugWaterBalance = True - -groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc - -# minimum value for groundwater recession coefficient (day-1) -minRecessionCoeff = 2.5e-4 - -# initial condition: -storGroundwaterIni = 0.0 -storGroundwaterFossilIni = 0.0 -avgTotalGroundwaterAbstractionIni = 0.0 - -[routingOptions] -debugWaterBalance = True - -lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map -cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map -gradient = PCRGLOBWB20/input5min/routing/slope05min.map - -# manning coefficient -manningsN = 0.04 - -# constant channel width (optional) -constantChannelWidth = None - -# minimum channel width (optional) -minimumChannelWidth = None - -routingMethod = kinematicWave -# Options are kinematicWave, simplifiedKinematicWave and accuTravelTime - -# option for maximum length of a sub time step in seconds (optional and only used if kinematicWave is used) -# - Note that too long sub time step may create water balance errors. -# - Default values: 3600 seconds for 30 arcmin ; 720 seconds for 5 arcmin -#~ maxiumLengthOfSubTimeStep = 3600. -maxiumLengthOfSubTimeStep = 720. - -# lake and reservoir parameters -waterBodyInputNC = PCRGLOBWB20/input30min/routing/reservoirs/fromRensJune2013/reservoirparameterization/waterBodies30min.nc -onlyNaturalWaterBodies = False - -# composite crop factors for WaterBodies: -cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc -minCropWaterKC = 0.20 - -# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) -timestepsToAvgDischargeIni = 0.0 -# Note that: -# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) -# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) - -# initial conditions: -waterBodyStorageIni = 0.0 -channelStorageIni = 0.0 -readAvlChannelStorageIni = 0.0 -avgDischargeLongIni = 0.0 -m2tDischargeLongIni = 0.0 -avgBaseflowLongIni = 0.0 -riverbedExchangeIni = 0.0 -avgLakeReservoirInflowShortIni = 0.0 -avgLakeReservoirOutflowLongIni = 0.0 -# -# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) -subDischargeIni = None -# -# other initial conditions (optional): -avgDischargeShortIni = 0.0 - -[reportingOptions] -# output files that will be written in the disk in netcdf files: -outDailyTotNC = discharge -outMonthTotNC = None -outMonthAvgNC = totalWaterStorageThickness -outMonthEndNC = surfaceWaterStorage -outAnnuaTotNC = totalRunoff,runoff,waterBodyActEvaporation,totLandSurfaceActuaET,precipitation,referencePotET,totalLandSurfacePotET,gwRecharge,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,surfaceWaterAbstraction,nonFossilGroundWaterAbstraction,otherWaterSourceAbstraction,totalEvaporation -outAnnuaAvgNC = discharge -outAnnuaEndNC = None diff --git a/config/setup_RhineMeuse_05arcmin_3layers.ini b/config/setup_RhineMeuse_05arcmin_3layers.ini deleted file mode 100755 index cc515ad94..000000000 --- a/config/setup_RhineMeuse_05arcmin_3layers.ini +++ /dev/null @@ -1,353 +0,0 @@ -[globalOptions] - -# Set the input directory map in an absolute path. -# - The input forcing and parameter directories will be relative to this. -inputDir = /data/hydroworld/ - -# Map of clone (must be provided in PCRaster maps) -# - Spatial resolution and coverage are based on this map: -#~ cloneMap = CLONEMAPFILES -cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map - -# The area/landmask of interest: -#~ landmask = LANDMASKFILES -landmask = None -# If None, area/landmask is limited for cells with ldd value. - -# Set the output directory in an absolute path. -#~ outputDir = OUTPUTDIRECTORY -outputDir = /scratch/edwin/test_RhineMeuse - -# netcdf attributes for output files: -institution = Department of Physical Geography, Utrecht University -title = PCR-GLOBWB output -description = test version (by Edwin H. Sutanudjaja) - -startTime = 1960-01-01 -endTime = 2010-12-31 -# Format: YYYY-MM-DD -# The model runs on the daily time step. - -# spinning up options -maxSpinUpsInYears = 35 -minConvForTotlSto = 0.5 -minConvForSoilSto = 0.5 -minConvForGwatSto = 0.5 -minConvForChanSto = 0.5 - -[meteoOptions] - -# Set the forcing temperature and precipitation files (relative to inputDir) -precipitationNC = /scratch/edwin/input/forcing/edwin_gpcc_merged_1958_to_2010/gpcc-v6_era-40-era-interim_daily_precipitation_1958_to_2010.nc -temperatureNC = forcing/CRU-TS3.21/merged_1958_to_2010/CRU-TS3.21_ERA-40_ERA-Interim_daily_temperature_1958_to_2010.nc - -# Method to calculate referencePotETP (reference potential evaporation+transpiration) -referenceETPotMethod = Hamon -# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: -refETPotFileNC = None - -[meteoDownscalingOptions] - -downscalePrecipitation = None -downscaleTemperature = None -downscaleReferenceETPot = None - -# downscaling (based on the digital elevation model): -# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. -meteoDownscaleIds = None -highResolutionDEM = None - -# lapse rates: -temperLapseRateNC = None -precipLapseRateNC = None - -# downscaling criteria -temperatCorrelNC = None -precipitCorrelNC = None - -# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): -smoothingWindowsLength = 0 - -[landSurfaceOptions] -debugWaterBalance = True - -numberOfUpperSoilLayers = 3 - -topographyNC = PCRGLOBWB20/input5min/landSurface/topo/topoProperties5ArcMin.nc -soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc - -includeIrrigation = True -# if True, there are four land cover types defined: forest,grassland,irrPaddy,irrNonPaddy -# if False, two (natural) land cover types defined: forest,grassland - -# netcdf time series for historical expansion of irrigation areas (unit: hectares). -# Note: The resolution of this map must be consisten with the resolution of cellArea. -#~ historicalIrrigationArea = None -historicalIrrigationArea = PCRGLOBWB20/input30min/landSurface/waterDemand/irrigated_areas/irrigationArea30ArcMin.nc - -includeDomesticWaterDemand = True -includeIndustryWaterDemand = True - -domesticWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/domesticWaterDemand30ArcMin.nc -industryWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/industryWaterDemand30ArcMin.nc - -limitAbstraction = False - -# zone IDs (scale) at which ground- surface-water allocation is performed -#~ allocationSegmentsForGroundSurfaceWater = None -allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map - -[forestOptions] -name = forest -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following pcraster maps: -fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map -rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map -rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map -maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map - -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input5min/landCover/forest/cropCoefficientForest.nc -interceptCapNC = PCRGLOBWB20/input5min/landCover/forest/interceptCapInputForest.nc -coverFractionNC = PCRGLOBWB20/input5min/landCover/forest/coverFractionInputForest.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUpp000005Ini = 0.0 -storUpp005030Ini = 0.0 -storLow030150Ini = 0.0 -interflowIni = 0.0 - -[grasslandOptions] -name = grassland -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following values: -fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map -rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map -rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map -maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input5min/landCover/grassland/cropCoefficientGrassland.nc -interceptCapNC = PCRGLOBWB20/input5min/landCover/grassland/interceptCapInputGrassland.nc -coverFractionNC = PCRGLOBWB20/input5min/landCover/grassland/coverFractionInputGrassland.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUpp000005Ini = 0.0 -storUpp005030Ini = 0.0 -storLow030150Ini = 0.0 -interflowIni = 0.0 - -[irrPaddyOptions] -name = irrPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following values: -fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map -rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map -rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map -maxRootDepth = 0.5 -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.05 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.2 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUpp000005Ini = 0.0 -storUpp005030Ini = 0.0 -storLow030150Ini = 0.0 -interflowIni = 0.0 - -[irrNonPaddyOptions] -name = irrNonPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following values: -fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map -rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map -rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map -maxRootDepth = 1.0 -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.5 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUpp000005Ini = 0.0 -storUpp005030Ini = 0.0 -storLow030150Ini = 0.0 -interflowIni = 0.0 - -[groundwaterOptions] -debugWaterBalance = True - -groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc - -# minimum value for groundwater recession coefficient (day-1) -minRecessionCoeff = 2.5e-4 - -# initial condition: -storGroundwaterIni = 0.0 -storGroundwaterFossilIni = 0.0 -avgTotalGroundwaterAbstractionIni = 0.0 - -[routingOptions] -debugWaterBalance = True - -lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map -cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map -gradient = PCRGLOBWB20/input5min/routing/slope05min.map - -# manning coefficient -manningsN = 0.04 - -# constant channel width (optional) -constantChannelWidth = None - -# minimum channel width (optional) -minimumChannelWidth = None - -routingMethod = accuTravelTime -# Options are kinematicWave, simplifiedKinematicWave and accuTravelTime - -# option for maximum length of a sub time step in seconds (optional and only used if kinematicWave is used) -# - Note that too long sub time step may create water balance errors. -# - Default values: 3600 seconds for 30 arcmin ; 720 seconds for 5 arcmin -#~ maxiumLengthOfSubTimeStep = 3600. -#~ maxiumLengthOfSubTimeStep = 720. - -# lake and reservoir parameters -waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc -onlyNaturalWaterBodies = False - -# composite crop factors for WaterBodies: -cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc -minCropWaterKC = 0.20 - -# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) -timestepsToAvgDischargeIni = 0.0 -# Note that: -# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) -# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) - -# initial conditions: -waterBodyStorageIni = 0.0 -channelStorageIni = 0.0 -readAvlChannelStorageIni = 0.0 -avgDischargeLongIni = 0.0 -m2tDischargeLongIni = 0.0 -avgBaseflowLongIni = 0.0 -riverbedExchangeIni = 0.0 -avgLakeReservoirInflowShortIni = 0.0 -avgLakeReservoirOutflowLongIni = 0.0 -# -# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) -subDischargeIni = None -# -# other initial conditions (optional): -avgDischargeShortIni = 0.0 - -[reportingOptions] -# output files that will be written in the disk in netcdf files: -outDailyTotNC = discharge -outMonthTotNC = None -outMonthAvgNC = satDegUppSurface,storUppSurface -outMonthEndNC = None -outAnnuaTotNC = None -outAnnuaAvgNC = None -outAnnuaEndNC = None diff --git a/config/setup_RhineMeuse_05arcmin_with_kinematic.ini b/config/setup_RhineMeuse_05arcmin_with_kinematic.ini deleted file mode 100644 index cd2c2f6b3..000000000 --- a/config/setup_RhineMeuse_05arcmin_with_kinematic.ini +++ /dev/null @@ -1,349 +0,0 @@ -[globalOptions] - -# Set the input directory map in an absolute path. -# - The input forcing and parameter directories will be relative to this. -inputDir = /data/hydroworld/ - -# Map of clone (must be provided in PCRaster maps) -# - Spatial resolution and coverage are based on this map: -#~ cloneMap = CLONEMAPFILES -cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map - -# The area/landmask of interest: -#~ landmask = LANDMASKFILES -landmask = None -# If None, area/landmask is limited for cells with ldd value. - -# Set the output directory in an absolute path. -#~ outputDir = OUTPUTDIRECTORY -outputDir = /scratch/edwin/test_RhineMeuse - -# netcdf attributes for output files: -institution = Department of Physical Geography, Utrecht University -title = PCR-GLOBWB output -description = test version (by Edwin H. Sutanudjaja) - -startTime = 1960-01-01 -endTime = 2010-12-31 -# Format: YYYY-MM-DD -# The model runs on the daily time step. - -# spinning up options -maxSpinUpsInYears = 35 -minConvForTotlSto = 0.5 -minConvForSoilSto = 0.5 -minConvForGwatSto = 0.5 -minConvForChanSto = 0.5 - -[meteoOptions] - -# Set the forcing temperature and precipitation files (relative to inputDir) -precipitationNC = /scratch/edwin/input/forcing/edwin_gpcc_merged_1958_to_2010/gpcc-v6_era-40-era-interim_daily_precipitation_1958_to_2010.nc -temperatureNC = forcing/CRU-TS3.21/merged_1958_to_2010/CRU-TS3.21_ERA-40_ERA-Interim_daily_temperature_1958_to_2010.nc - -# Method to calculate referencePotETP (reference potential evaporation+transpiration) -referenceETPotMethod = Hamon -# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: -refETPotFileNC = None - -[meteoDownscalingOptions] - -downscalePrecipitation = None -downscaleTemperature = None -downscaleReferenceETPot = None - -# downscaling (based on the digital elevation model): -# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. -meteoDownscaleIds = None -highResolutionDEM = None - -# lapse rates: -temperLapseRateNC = None -precipLapseRateNC = None - -# downscaling criteria -temperatCorrelNC = None -precipitCorrelNC = None - -# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): -smoothingWindowsLength = 0 - -[landSurfaceOptions] -debugWaterBalance = True - -numberOfUpperSoilLayers = 2 - -topographyNC = PCRGLOBWB20/input5min/landSurface/topo/topoProperties5ArcMin.nc -soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc - -includeIrrigation = True -# if True, there are four land cover types defined: forest,grassland,irrPaddy,irrNonPaddy -# if False, two (natural) land cover types defined: forest,grassland - -# netcdf time series for historical expansion of irrigation areas (unit: hectares). -# Note: The resolution of this map must be consisten with the resolution of cellArea. -#~ historicalIrrigationArea = None -historicalIrrigationArea = PCRGLOBWB20/input30min/landSurface/waterDemand/irrigated_areas/irrigationArea30ArcMin.nc - -includeDomesticWaterDemand = True -includeIndustryWaterDemand = True - -domesticWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/domesticWaterDemand30ArcMin.nc -industryWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/industryWaterDemand30ArcMin.nc - -limitAbstraction = False - -# zone IDs (scale) at which ground- surface-water allocation is performed -#~ allocationSegmentsForGroundSurfaceWater = None -allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map - -[forestOptions] -name = forest -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following pcraster maps: -fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map -rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map -rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map -maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map - -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input5min/landCover/forest/cropCoefficientForest.nc -interceptCapNC = PCRGLOBWB20/input5min/landCover/forest/interceptCapInputForest.nc -coverFractionNC = PCRGLOBWB20/input5min/landCover/forest/coverFractionInputForest.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[grasslandOptions] -name = grassland -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following values: -fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map -rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map -rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map -maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input5min/landCover/grassland/cropCoefficientGrassland.nc -interceptCapNC = PCRGLOBWB20/input5min/landCover/grassland/interceptCapInputGrassland.nc -coverFractionNC = PCRGLOBWB20/input5min/landCover/grassland/coverFractionInputGrassland.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[irrPaddyOptions] -name = irrPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following values: -fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map -rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map -rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map -maxRootDepth = 0.5 -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.05 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.2 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[irrNonPaddyOptions] -name = irrNonPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = None -# If NC file is not provided, we have to provide the following values: -fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map -minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map -maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map -rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map -rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map -maxRootDepth = 1.0 -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.5 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[groundwaterOptions] -debugWaterBalance = True - -groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc - -# minimum value for groundwater recession coefficient (day-1) -minRecessionCoeff = 2.5e-4 - -# initial condition: -storGroundwaterIni = 0.0 -storGroundwaterFossilIni = 0.0 -avgTotalGroundwaterAbstractionIni = 0.0 - -[routingOptions] -debugWaterBalance = True - -lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map -cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map -gradient = PCRGLOBWB20/input5min/routing/slope05min.map - -# manning coefficient -manningsN = 0.04 - -# constant channel width (optional) -constantChannelWidth = None - -# minimum channel width (optional) -minimumChannelWidth = None - -routingMethod = kinematicWave -# Options are kinematicWave, simplifiedKinematicWave and accuTravelTime - -# option for maximum length of a sub time step in seconds (optional and only used if kinematicWave is used) -# - Note that too long sub time step may create water balance errors. -# - Default values: 3600 seconds for 30 arcmin ; 720 seconds for 5 arcmin -#~ maxiumLengthOfSubTimeStep = 3600. -maxiumLengthOfSubTimeStep = 720. - -# lake and reservoir parameters -waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc -onlyNaturalWaterBodies = False - -# composite crop factors for WaterBodies: -cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc -minCropWaterKC = 0.20 - -# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) -timestepsToAvgDischargeIni = 0.0 -# Note that: -# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) -# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) - -# initial conditions: -waterBodyStorageIni = 0.0 -channelStorageIni = 0.0 -readAvlChannelStorageIni = 0.0 -avgDischargeLongIni = 0.0 -m2tDischargeLongIni = 0.0 -avgBaseflowLongIni = 0.0 -riverbedExchangeIni = 0.0 -avgLakeReservoirInflowShortIni = 0.0 -avgLakeReservoirOutflowLongIni = 0.0 -# -# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) -subDischargeIni = None -# -# other initial conditions (optional): -avgDischargeShortIni = 0.0 - -[reportingOptions] -# output files that will be written in the disk in netcdf files: -outDailyTotNC = discharge -outMonthTotNC = None -outMonthAvgNC = totalWaterStorageThickness -outMonthEndNC = surfaceWaterStorage -outAnnuaTotNC = totalRunoff,runoff,waterBodyActEvaporation,totLandSurfaceActuaET,precipitation,referencePotET,totalLandSurfacePotET,gwRecharge,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,surfaceWaterAbstraction,nonFossilGroundWaterAbstraction,otherWaterSourceAbstraction,totalEvaporation -outAnnuaAvgNC = discharge -outAnnuaEndNC = None diff --git a/config/setup_RhineMeuse_30arcmin_2layers.ini b/config/setup_RhineMeuse_30arcmin_2layers.ini deleted file mode 100644 index 8a7557d65..000000000 --- a/config/setup_RhineMeuse_30arcmin_2layers.ini +++ /dev/null @@ -1,319 +0,0 @@ -[globalOptions] - -# Set the input directory map in an absolute path. -# - The input forcing and parameter directories will be relative to this. -inputDir = /data/hydroworld/ - -# Map of clone (must be provided in PCRaster maps) -# - Spatial resolution and coverage are based on this map: -#~ cloneMap = CLONEMAPFILES -cloneMap = others/RhineMeuse/RhineMeuse30min.clone.map - -# The area/landmask of interest: -#~ landmask = LANDMASKFILES -landmask = None -# If None, area/landmask is limited for cells with ldd value. - -# Set the output directory in an absolute path. -#~ outputDir = OUTPUTDIRECTORY -outputDir = /scratch/edwin/test_RhineMeuse_30min - -# netcdf attributes for output files: -institution = Department of Physical Geography, Utrecht University -title = PCR-GLOBWB output -description = test version (by Edwin H. Sutanudjaja) - -startTime = 1981-01-01 -endTime = 2010-12-31 -# Format: YYYY-MM-DD -# The model runs on the daily time step. - -# spinning up options -maxSpinUpsInYears = 35 -minConvForTotlSto = 0.5 -minConvForSoilSto = 0.5 -minConvForGwatSto = 0.5 -minConvForChanSto = 0.5 - -[meteoOptions] - -# Set the forcing temperature and precipitation files (relative to inputDir) -precipitationNC = /scratch/edwin/input/forcing/edwin_gpcc_merged_1958_to_2010/gpcc-v6_era-40-era-interim_daily_precipitation_1958_to_2010.nc -temperatureNC = forcing/CRU-TS3.21/merged_1958_to_2010/CRU-TS3.21_ERA-40_ERA-Interim_daily_temperature_1958_to_2010.nc - -# Method to calculate referencePotETP (reference potential evaporation+transpiration) -referenceETPotMethod = Hamon -# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: -refETPotFileNC = None - -[meteoDownscalingOptions] - -downscalePrecipitation = None -downscaleTemperature = None -downscaleReferenceETPot = None - -# downscaling (based on the digital elevation model): -# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. -meteoDownscaleIds = None -highResolutionDEM = None - -# lapse rates: -temperLapseRateNC = None -precipLapseRateNC = None - -# downscaling criteria -temperatCorrelNC = None -precipitCorrelNC = None - -# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): -smoothingWindowsLength = 0 - -[landSurfaceOptions] -debugWaterBalance = True - -numberOfUpperSoilLayers = 2 - -topographyNC = PCRGLOBWB20/input30min/landSurface/topo/topoProperties.nc -soilPropertiesNC = PCRGLOBWB20/input30min/landSurface/soil/soilProperties.nc - -includeIrrigation = True -# if True, there are four land cover types defined: forest,grassland,irrPaddy,irrNonPaddy -# if False, two (natural) land cover types defined: forest,grassland - -# netcdf time series for historical expansion of irrigation areas (unit: hectares). -# Note: The resolution of this map must be consisten with the resolution of cellArea. -#~ historicalIrrigationArea = None -historicalIrrigationArea = PCRGLOBWB20/input30min/landSurface/waterDemand/irrigated_areas/irrigationArea30ArcMin.nc - -includeDomesticWaterDemand = True -includeIndustryWaterDemand = True - -domesticWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/domesticWaterDemand30ArcMin.nc -industryWaterDemandFile = PCRGLOBWB20/input30min/landSurface/waterDemand/industryWaterDemand30ArcMin.nc - -limitAbstraction = False - -# zone IDs (scale) at which ground- surface-water allocation is performed -allocationSegmentsForGroundSurfaceWater = None -#~ allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map - -[forestOptions] -name = forest -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/forest/forestProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/forest/Global_CropCoefficientKc-Forest_30min.nc -interceptCapNC = PCRGLOBWB20/input30min/landCover/forest/interceptCapInputForest366days.nc -coverFractionNC = PCRGLOBWB20/input30min/landCover/forest/coverFractionInputForest366days.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[grasslandOptions] -name = grassland -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/grassland/grasslandProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/grassland/Global_CropCoefficientKc-Grassland_30min.nc -interceptCapNC = PCRGLOBWB20/input30min/landCover/grassland/interceptCapInputGrassland366days.nc -coverFractionNC = PCRGLOBWB20/input30min/landCover/grassland/coverFractionInputGrassland366days.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[irrPaddyOptions] -name = irrPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/irrPaddy/paddyProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.05 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.2 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[irrNonPaddyOptions] -name = irrNonPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/nonPaddyProperties.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.5 - -cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUppIni = 0.0 -storLowIni = 0.0 -interflowIni = 0.0 - -[groundwaterOptions] -debugWaterBalance = True - -groundwaterPropertiesNC = PCRGLOBWB20/input30min/groundwater/groundwaterProperties.nc - -# minimum value for groundwater recession coefficient (day-1) -minRecessionCoeff = 2.5e-4 - -# initial condition: -storGroundwaterIni = 0.0 -storGroundwaterFossilIni = 0.0 -avgTotalGroundwaterAbstractionIni = 0.0 - -[routingOptions] -debugWaterBalance = True - -lddMap = PCRGLOBWB20/input30min/routing/lddsound_30min.map -cellAreaMap = PCRGLOBWB20/input30min/routing/cellarea30min.map -gradient = PCRGLOBWB20/input30min/routing/Global_ChannelGradient-RVB_30min.map - -# manning coefficient -manningsN = 0.04 - -# constant channel width (optional) -constantChannelWidth = None - -# minimum channel width (optional) -minimumChannelWidth = None - -routingMethod = accuTravelTime -# Options are kinematicWave, simplifiedKinematicWave and accuTravelTime - -# option for maximum length of a sub time step in seconds (optional and only used if kinematicWave is used) -# - Note that too long sub time step may create water balance errors. -# - Default values: 3600 seconds for 30 arcmin ; 720 seconds for 5 arcmin -#~ maxiumLengthOfSubTimeStep = 3600. -#~ maxiumLengthOfSubTimeStep = 720. - -# lake and reservoir parameters -waterBodyInputNC = PCRGLOBWB20/input30min/routing/reservoirs/fromRensJune2013/reservoirparameterization/waterBodies30min.nc -onlyNaturalWaterBodies = False - -# composite crop factors for WaterBodies: -cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc -minCropWaterKC = 0.20 - -# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) -timestepsToAvgDischargeIni = 0.0 -# Note that: -# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) -# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) - -# initial conditions: -waterBodyStorageIni = 0.0 -channelStorageIni = 0.0 -readAvlChannelStorageIni = 0.0 -avgDischargeLongIni = 0.0 -m2tDischargeLongIni = 0.0 -avgBaseflowLongIni = 0.0 -riverbedExchangeIni = 0.0 -avgLakeReservoirInflowShortIni = 0.0 -avgLakeReservoirOutflowLongIni = 0.0 -# -# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) -subDischargeIni = None -# -# other initial conditions (optional): -avgDischargeShortIni = 0.0 - -[reportingOptions] -# output files that will be written in the disk in netcdf files: -outDailyTotNC = discharge,satDegUpp,storUppTotal -outMonthTotNC = totalEvaporation,nonIrrWaterConsumption,nonIrrReturnFlow -outMonthAvgNC = discharge,totalWaterStorageThickness,totalEvaporation,nonIrrWaterConsumption,nonIrrReturnFlow -outMonthEndNC = satDegUpp,satDegLow,storUppTotal,storLowTotal,storGroundwater -outAnnuaTotNC = totalEvaporation -outAnnuaAvgNC = discharge,totalWaterStorageThickness,temperature,gwRecharge,totalEvaporation,nonIrrWaterConsumption,nonIrrReturnFlow -outAnnuaEndNC = None diff --git a/config/setup_RhineMeuse_30arcmin_3layers_using_input_example.ini b/config/setup_RhineMeuse_30arcmin_3layers_using_input_example.ini deleted file mode 100755 index 4e0715c76..000000000 --- a/config/setup_RhineMeuse_30arcmin_3layers_using_input_example.ini +++ /dev/null @@ -1,319 +0,0 @@ -[globalOptions] - -# Set the input directory map in an absolute path. -# - The input forcing and parameter directories will be relative to this. -inputDir = /home/sutan101/github/UU-Hydro/PCR-GLOBWB_input_example/RhineMeuse30min/ - -# Map of clone (must be provided in PCRaster maps) -# - Spatial resolution and coverage are based on this map: -cloneMap = cloneMaps/RhineMeuse30min.map - -# The area/landmask of interest: -landmask = cloneMaps/RhineMeuse_landmask.map -# If None, area/landmask is limited for cells with ldd value. - -# Set the output directory in an absolute path. -#~ outputDir = OUTPUTDIRECTORY -outputDir = /scratch/edwin/test_RhineMeuse_30min_input_example - -# netcdf attributes for output files: -institution = Department of Physical Geography, Utrecht University -title = PCR-GLOBWB output -description = test version (by Edwin H. Sutanudjaja) - -startTime = 2002-01-01 -endTime = 2010-12-31 -# Format: YYYY-MM-DD -# The model runs on the daily time step. - -# spinning up options: -maxSpinUpsInYears = 10 -minConvForTotlSto = 0.5 -minConvForSoilSto = 0.5 -minConvForGwatSto = 0.5 -minConvForChanSto = 0.5 - -[meteoOptions] - -# Set the forcing temperature and precipitation files (relative to inputDir) -temperatureNC = forcing/temperature_2001to2010.nc -precipitationNC = forcing/precipitation_2001to2010.nc - -# Method to calculate referencePotETP (reference potential evaporation+transpiration) -referenceETPotMethod = Hamon -# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: -refETPotFileNC = None - -[meteoDownscalingOptions] - -downscalePrecipitation = None -downscaleTemperature = None -downscaleReferenceETPot = None - -# downscaling (based on the digital elevation model): -# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. -meteoDownscaleIds = None -highResolutionDEM = None - -# lapse rates: -temperLapseRateNC = None -precipLapseRateNC = None - -# downscaling criteria -temperatCorrelNC = None -precipitCorrelNC = None - -# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): -smoothingWindowsLength = 0 - -[landSurfaceOptions] -debugWaterBalance = True - -numberOfUpperSoilLayers = 3 - -topographyNC = landSurface/topoPropertiesRhineMeuse30min.nc -soilPropertiesNC = landSurface/soilPropertiesRhineMeuse30min.nc - -includeIrrigation = True -# if True, there are four land cover types defined: forest,grassland,irrPaddy,irrNonPaddy -# if False, two (natural) land cover types defined: forest,grassland - -# netcdf time series for historical expansion of irrigation areas (unit: hectares). -# Note: The resolution of this map must be consisten with the resolution of cellArea. -historicalIrrigationArea = None - -includeDomesticWaterDemand = False -includeIndustryWaterDemand = False - -domesticWaterDemandFile = None -industryWaterDemandFile = None - -limitAbstraction = False - -# zone IDs (scale) at which water demand allocation is performed -allocationSegmentsForGroundSurfaceWater = None - -[forestOptions] -name = forest -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -landCoverMapsNC = landCover/forest/forestPropertiesRhineMeuse.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = landCover/forest/cropKC_forest_daily366.nc -interceptCapNC = landCover/forest/interceptCap_forest_daily366.nc -coverFractionNC = landCover/forest/coverFraction_forest_daily366.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUpp000005Ini = 0.0 -storUpp005030Ini = 0.0 -storLow030150Ini = 0.0 -interflowIni = 0.0 - -[grasslandOptions] -name = grassland -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 - -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 - -landCoverMapsNC = landCover/grassland/grasslandPropertiesRhineMeuse.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. - -cropCoefficientNC = landCover/grassland/cropKC_grassland_daily366.nc -interceptCapNC = landCover/grassland/interceptCap_grassland_daily366.nc -coverFractionNC = landCover/grassland/coverFraction_grassland_daily366.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUpp000005Ini = 0.0 -storUpp005030Ini = 0.0 -storLow030150Ini = 0.0 -interflowIni = 0.0 - -[irrPaddyOptions] -name = irrPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = landCover/irrPaddy/irrPaddyPropertiesRhineMeuse.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.05 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.2 - -cropCoefficientNC = landCover/irrPaddy/cropKC_irrPaddy_daily366.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUpp000005Ini = 0.0 -storUpp005030Ini = 0.0 -storLow030150Ini = 0.0 -interflowIni = 0.0 - -[irrNonPaddyOptions] -name = irrNonPaddy -debugWaterBalance = True - -# snow module properties -snowModuleType = Simple -freezingT = -0.0 -degreeDayFactor = 0.0025 -snowWaterHoldingCap = 0.1 -refreezingCoeff = 0.05 -# -landCoverMapsNC = landCover/irrNonPaddy/irrNonPaddyPropertiesRhineMeuse.nc -# -# Parameters for the Arno's scheme: -arnoBeta = None -# If arnoBeta is defined, the soil water capacity distribution is based on this. -# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. -# -# other paramater values -minTopWaterLayer = 0.0 -minCropKC = 0.2 -minInterceptCap = 0.0002 -cropDeplFactor = 0.5 - -cropCoefficientNC = landCover/irrNonPaddy/cropKC_irrNonPaddy_daily366.nc - -# initial conditions: -interceptStorIni = 0.0 -snowCoverSWEIni = 0.0 -snowFreeWaterIni = 0.0 -topWaterLayerIni = 0.0 -storUpp000005Ini = 0.0 -storUpp005030Ini = 0.0 -storLow030150Ini = 0.0 -interflowIni = 0.0 - - -[groundwaterOptions] -debugWaterBalance = True - -groundwaterPropertiesNC = groundwater/groundwaterProperties.nc - -# minimum value for groundwater recession coefficient (day-1) -minRecessionCoeff = 2.5e-4 - -storGroundwaterIni = initialConditions/storGroundwaterIni_2001-12-31.map -storGroundwaterFossilIni = 0.0 -avgTotalGroundwaterAbstractionIni = 0.0 - -[routingOptions] -debugWaterBalance = True - -lddMap = routing/RhineMeuse_lddsound_30min.map -cellAreaMap = routing/RhineMeuse_cellarea30min.map -gradient = routing/RhineMeuse_ChannelGradient-RVB_30min.map - -# manning coefficient -manningsN = 0.04 - -# constant channel width (optional) -constantChannelWidth = None - -# minimum channel width (optional) -minimumChannelWidth = None - -routingMethod = kinematicWave -# Options are kinematicWave, simplifiedKinematicWave and accuTravelTime - -# option for maximum length of a sub time step in seconds (optional and only used if kinematicWave is used) -# - Note that too long sub time step may create water balance errors. -# - Default values: 3600 seconds for 30 arcmin ; 720 seconds for 5 arcmin -#~ maxiumLengthOfSubTimeStep = 3600. -#~ maxiumLengthOfSubTimeStep = 720. - -# lake and reservoir parameters -waterBodyInputNC = routing/waterBodiesRhineMeuse2001To2010.nc -onlyNaturalWaterBodies = False - -# composite crop factors for WaterBodies: -cropCoefficientWaterNC = routing/cropCoefficientForOpenWaterRhineMeuse.nc -minCropWaterKC = 0.20 - -# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) -timestepsToAvgDischargeIni = 0.0 -# Note that: -# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) -# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) - -# initial conditions: -waterBodyStorageIni = 0.0 -channelStorageIni = 0.0 -readAvlChannelStorageIni = 0.0 -avgDischargeLongIni = 0.0 -m2tDischargeLongIni = 0.0 -avgBaseflowLongIni = 0.0 -riverbedExchangeIni = 0.0 -avgLakeReservoirInflowShortIni = 0.0 -avgLakeReservoirOutflowLongIni = 0.0 -# -# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) -subDischargeIni = None -# -# other initial conditions (optional): -avgDischargeShortIni = 0.0 - -[reportingOptions] -# output files that will be written in the disk in netcdf files: -outDailyTotNC = discharge,satDegUpp,storUppTotal -outMonthTotNC = precipitation,totalRunoff,totalEvaporation,interceptEvap,actBareSoilEvap,actTranspiTotal,topWaterLayerEvap,waterBodyActEvaporation,actSnowFreeWaterEvap,infiltration,gwRecharge,interflowTotal,directRunoff,baseflow,local_water_body_flux,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonFossilGroundWaterAbstraction,otherWaterSourceAbstraction,surfaceWaterAbstraction -outMonthAvgNC = totalWaterStorageThickness,discharge,satDegUpp,storUppTotal,totalRunoff,totalEvaporation,interceptEvap,actBareSoilEvap,actTranspiTotal,topWaterLayerEvap,waterBodyActEvaporation,actSnowFreeWaterEvap,infiltration,gwRecharge,interflowTotal,directRunoff,baseflow,local_water_body_flux,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonFossilGroundWaterAbstraction,otherWaterSourceAbstraction,surfaceWaterAbstraction -outMonthEndNC = totalWaterStorageThickness,satDegUpp,satDegLow,storUppTotal,storLowTotal,storGroundwater -outAnnuaTotNC = precipitation,totalRunoff,totalEvaporation,interceptEvap,actBareSoilEvap,actTranspiTotal,topWaterLayerEvap,waterBodyActEvaporation,actSnowFreeWaterEvap,infiltration,gwRecharge,interflowTotal,directRunoff,baseflow,local_water_body_flux,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonFossilGroundWaterAbstraction,otherWaterSourceAbstraction,surfaceWaterAbstraction -outAnnuaAvgNC = totalWaterStorageThickness,discharge,totalRunoff,totalEvaporation,interceptEvap,actBareSoilEvap,actTranspiTotal,topWaterLayerEvap,waterBodyActEvaporation,actSnowFreeWaterEvap,infiltration,gwRecharge,interflowTotal,directRunoff,baseflow,local_water_body_flux,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonFossilGroundWaterAbstraction,otherWaterSourceAbstraction,surfaceWaterAbstraction -outAnnuaEndNC = totalWaterStorageThickness diff --git a/config/setup_test.ini b/config/setup_test.ini new file mode 100644 index 000000000..c4e9ef9f8 --- /dev/null +++ b/config/setup_test.ini @@ -0,0 +1,440 @@ +[globalOptions] + +# Set the input directory map in an absolute path. +# - The input forcing and parameter directories will be relative to this. +inputDir = /projects/0/dfguu/data/hydroworld/ + +# set the pcrglobwb output directory in an absolute path +outputDir = /scratch-shared/edwinhs/test/ + +# the following is needed for a parallel run +cloneAreas = Global +#~ cloneAreas = M47,M48,M49 +#~ cloneAreas = M47,M48,M49,M29 +#~ cloneAreas = M17,M26,M44,M29,M52,M02 + +# Map of clone (must be provided in PCRaster maps) +# - Spatial resolution and coverage are based on this map: +#~ cloneMap = others/RhineMeuse/RhineMeuse05min.clone.map +#~ cloneMap = others/Mississippi/Mississippi05min.clone.map +#~ cloneMap = others/Indus/Indus05min.clone.map +#~ cloneMap = others/Nile/Nile05min.clone.map +cloneMap = others/05ArcMinCloneMaps/new_masks_from_top/clone_M13.map + +# The area/landmask of interest: +# If None, area/landmask is limited for cells with ldd value. +#~ landmask = None +landmask = others/05ArcMinCloneMaps/new_masks_from_top/mask_M13.map + +# netcdf attributes for output files: +institution = Department of Physical Geography, Utrecht University +title = PCR-GLOBWB 2 output (not coupled to MODFLOW) +description = test version (by Edwin H. Sutanudjaja) + +startTime = 2004-01-01 +endTime = 2010-12-31 +# Format: YYYY-MM-DD ; The current model runs on the daily time step. + +# spinning up options: +maxSpinUpsInYears = 0 +minConvForSoilSto = 0.0 +minConvForGwatSto = 0.0 +minConvForChanSto = 0.0 +minConvForTotlSto = 0.0 + +# option/directory for saving the spin-up directory +spinUpOutputDir = True + +[prefactorOptions] + +linear_multiplier_for_refPotET = 1.0 +linear_multiplier_for_degreeDayFactor = 1.0 +linear_multiplier_for_minSoilDepthFrac = 1.0 +log_10_multiplier_for_kSat = 0.0 +linear_multiplier_for_storCap = 1.0 +log_10_multiplier_for_recessionCoeff = 0.0 + +[meteoOptions] + +# Set the forcing temperature and precipitation files (relative to inputDir) +precipitationNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_precipitation_1901_to_2010.nc +temperatureNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_temperature_1901_to_2010.nc + +# Method to calculate referencePotETP (reference potential evaporation+transpiration) +# options are "Hamon" and "Input" ; If "Input", the netcdf input file must be given: +referenceETPotMethod = Input +refETPotFileNC = forcing/ERA20C/CRU-TS3.23_ERA20C_daily_referencePotET_1901_to_2010.nc + +[meteoDownscalingOptions] + +downscalePrecipitation = False +downscaleTemperature = True +downscaleReferenceETPot = False + +# downscaling (based on the digital elevation model): +# The downscaling will be performed by providing the "cellIds" (meteoDownscaleIds) of lower resolution cells. +meteoDownscaleIds = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/uniqueIds_30min.map +highResolutionDEM = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/gtopo05min.map + +# lapse rates: +temperLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_slope.nc +precipLapseRateNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_slope.nc + +# downscaling criteria (TODO: remove these): +temperatCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/temperature_correl.nc +precipitCorrelNC = PCRGLOBWB20/input5min/meteo/downscalingFrom30ArcMin/precipitation_correl.nc + +# windows length (unit: arc-degree) for smoothing/averaging forcing data (not recommended): +smoothingWindowsLength = 0 + +[landSurfaceOptions] +debugWaterBalance = True + +numberOfUpperSoilLayers = 2 + +# soil and parameters +# - they are used for all land cover types, unless they are are defined in certain land cover type options +# (e.g. different/various soil types for agriculture areas) +topographyNC = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/topography_parameters_5_arcmin_october_2015.nc +soilPropertiesNC = PCRGLOBWB20/input5min/landSurface/soil/v03Jul2013/soilProperties5ArcMin.nc + +includeIrrigation = True + +# a pcraster map/value defining irrigation efficiency (dimensionless) - optional +irrigationEfficiency = PCRGLOBWB20/input30min/landSurface/waterDemand/efficiency/efficiency.map + +# netcdf time series for historical expansion of irrigation areas (unit: hectares). +# Note: The resolution of this map must be consisten with the resolution of cellArea. +historicalIrrigationArea = PCRGLOBWB20/input5min/landSurface/waterDemand/irrigated_areas/irrigationArea05ArcMin.nc + +includeDomesticWaterDemand = True +includeIndustryWaterDemand = True +includeLivestockWaterDemand = True + +# domestic and industrial water demand data (unit must be in m.day-1) +domesticWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/domestic_water_demand_5min_meter_per_day.nc +industryWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/industry_water_demand_5min_meter_per_day.nc +livestockWaterDemandFile = /projects/0/dfguu/users/edwin/data/data_from_yoshi/GLOWASIS_water_demand/05min/remapbil/livestock_water_demand_5min_meter_per_day.nc + +# desalination water supply (maximum/potential/capacity) +desalinationWater = /projects/0/dfguu/users/edwin/data/data_from_yoshi/desalination/desalination_in_m_per_day_05min/desalination_water_version_april_2015.nc + +# zone IDs (scale) at which allocations of groundwater and surface water (as well as desalinated water) are performed +allocationSegmentsForGroundSurfaceWater = others/irrigationZones/one_arc_degree/uniqueIds60min.nom.map + +# pcraster maps defining the partitioning of groundwater - surface water source to minimize +# - predefined surface water - groundwater partitioning for irrigation demand (based on Siebert, 2010/2013: Global Map of Irrigation Areas version 5) +irrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_SWFRAC.map +irrigationSurfaceWaterAbstractionFractionDataQuality = /projects/0/dfguu/users/edwin/data/siebert_map/05min/AEI_QUAL.map +# - predefined surface water - groundwater partitioning for irrigation demand (based on McDonald, 2014) +maximumNonIrrigationSurfaceWaterAbstractionFractionData = /projects/0/dfguu/users/edwin/data/McDonald_water_infrastructure/max_city_sw_fraction.map +# threshold values defining the preference for surface water source for irrigation purpose +# - treshold to maximize surface water irrigation use (cells with irrSurfaceWaterAbstractionFraction above this will prioritize irrigation surface water use) +treshold_to_maximize_irrigation_surface_water = 0.50 +# - treshold to minimize fossil water withdrawal for irrigation (cells with irrSurfaceWaterAbstractionFraction below this have no fossil withdrawal for irrigation) +treshold_to_minimize_fossil_groundwater_irrigation = 0.70 + +[forestOptions] + +name = forest +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/forest/forestProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following pcraster maps: +fracVegCover = PCRGLOBWB20/input5min/landCover/forest/vegf_tall.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/minf_tall_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/forest/maxf_tall.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/forest/rfrac1_tall.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/forest/rfrac2_tall.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/forest/maxrootdepth_tall.map + +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientForest.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputForest.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputForest.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interceptStor_forest_2003-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowCoverSWE_forest_2003-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowFreeWater_forest_2003-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/topWaterLayer_forest_2003-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storUpp_forest_2003-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storLow_forest_2003-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interflow_forest_2003-12-31.map + +[grasslandOptions] + +name = grassland +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 + +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 + +#~ landCoverMapsNC = PCRGLOBWB20/input5min/landCover/grassland/grasslandProperties5ArcMin.nc +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/grassland/vegf_short.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/minf_short_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/grassland/maxf_short.map +rootFraction1 = PCRGLOBWB20/input5min/landCover/grassland/rfrac1_short.map +rootFraction2 = PCRGLOBWB20/input5min/landCover/grassland/rfrac2_short.map +maxRootDepth = PCRGLOBWB20/input5min/landCover/grassland/maxrootdepth_short.map +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. + +cropCoefficientNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/cropCoefficientGrassland.nc +interceptCapNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/interceptCapInputGrassland.nc +coverFractionNC = PCRGLOBWB20/input5min/landCover_v05Jul2013/Global/netcdf/coverFractionInputGrassland.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interceptStor_grassland_2003-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowCoverSWE_grassland_2003-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowFreeWater_grassland_2003-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/topWaterLayer_grassland_2003-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storUpp_grassland_2003-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storLow_grassland_2003-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interflow_grassland_2003-12-31.map + +[irrPaddyOptions] + +name = irrPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/minf_paddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrPaddy/maxf_paddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac1_paddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrPaddy/rfrac2_paddy.map +maxRootDepth = 0.5 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.05 +minCropKC = 0.2 +cropDeplFactor = 0.2 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrPaddy/Global_CropCoefficientKc-IrrPaddy_30min.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interceptStor_irrPaddy_2003-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowCoverSWE_irrPaddy_2003-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowFreeWater_irrPaddy_2003-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/topWaterLayer_irrPaddy_2003-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storUpp_irrPaddy_2003-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storLow_irrPaddy_2003-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interflow_irrPaddy_2003-12-31.map + +[irrNonPaddyOptions] + +name = irrNonPaddy +debugWaterBalance = True + +# snow module properties +snowModuleType = Simple +freezingT = 0.0 +degreeDayFactor = 0.0025 +snowWaterHoldingCap = 0.1 +refreezingCoeff = 0.05 +# +landCoverMapsNC = None +# If NC file is not provided, we have to provide the following values: +fracVegCover = PCRGLOBWB20/input5min/landCover/irrigation/fractionNonPaddy.map +minSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/minf_nonpaddy_permafrost.map +maxSoilDepthFrac = PCRGLOBWB20/input30min/landCover/irrNonPaddy/maxf_nonpaddy.map +rootFraction1 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac1_nonpaddy.map +rootFraction2 = PCRGLOBWB20/input30min/landCover/irrNonPaddy/rfrac2_nonpaddy.map +maxRootDepth = 1.0 +# +# Parameters for the Arno's scheme: +arnoBeta = None +# If arnoBeta is defined, the soil water capacity distribution is based on this. +# If arnoBeta is NOT defined, maxSoilDepthFrac must be defined such that arnoBeta will be calculated based on maxSoilDepthFrac and minSoilDepthFrac. +# +# other paramater values +minTopWaterLayer = 0.0 +minCropKC = 0.2 +cropDeplFactor = 0.5 +minInterceptCap = 0.0002 + +cropCoefficientNC = PCRGLOBWB20/input30min/landCover/irrNonPaddy/Global_CropCoefficientKc-IrrNonPaddy_30min.nc + +# initial conditions: +interceptStorIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interceptStor_irrNonPaddy_2003-12-31.map +snowCoverSWEIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowCoverSWE_irrNonPaddy_2003-12-31.map +snowFreeWaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/snowFreeWater_irrNonPaddy_2003-12-31.map +topWaterLayerIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/topWaterLayer_irrNonPaddy_2003-12-31.map +storUppIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storUpp_irrNonPaddy_2003-12-31.map +storLowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storLow_irrNonPaddy_2003-12-31.map +interflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/interflow_irrNonPaddy_2003-12-31.map + +[groundwaterOptions] + +debugWaterBalance = True + +groundwaterPropertiesNC = PCRGLOBWB20/input5min/groundwater/groundwaterProperties5ArcMin.nc + +# minimum value for groundwater recession coefficient (day-1) +minRecessionCoeff = 1.0e-4 + +# some options for constraining groundwater abstraction +limitFossilGroundWaterAbstraction = True +estimateOfRenewableGroundwaterCapacity = 0.0 +estimateOfTotalGroundwaterThickness = /projects/0/dfguu/users/edwin/data/aquifer_properties/thickness_05min.map +# minimum and maximum total groundwater thickness +minimumTotalGroundwaterThickness = 100. +maximumTotalGroundwaterThickness = None + +# annual pumping capacity for each region (unit: billion cubic meter per year), should be given in a netcdf file +pumpingCapacityNC = /projects/0/dfguu/users/edwin/data/limit_gw_abstraction_half_arc_degree/design_pumping_capacity/regional_abstraction_limit.nc + +# initial conditions: +storGroundwaterIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storGroundwater_2003-12-31.map +storGroundwaterFossilIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/storGroundwaterFossil_2003-12-31.map +# +# additional initial conditions for pumping behaviors +avgNonFossilGroundwaterAllocationLongIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgNonFossilGroundwaterAllocationLong_2003-12-31.map +avgNonFossilGroundwaterAllocationShortIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgNonFossilGroundwaterAllocationShort_2003-12-31.map +avgTotalGroundwaterAbstractionIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgTotalGroundwaterAbstraction_2003-12-31.map +avgTotalGroundwaterAllocationLongIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgTotalGroundwaterAllocationLong_2003-12-31.map +avgTotalGroundwaterAllocationShortIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/avgTotalGroundwaterAllocationShort_2003-12-31.map +# +# additional initial conditions for MODFLOW run +relativeGroundwaterHeadIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/relativeGroundwaterHead_2003-12-31.map +baseflowIni = /projects/0/wtrcycle/users/edwinhs/05min_runs_january_2016/pcrglobwb_only_from_1958_4LCs_edwin_parameter_set/M13/states/baseflow_2003-12-31.map + +#~ allocationSegmentsForGroundwater = None +allocationSegmentsForGroundwater = others/irrigationZones/half_arc_degree/uniqueIds30min.nom.map + +# assumption for the minimum transmissivity value (unit: m2/day) that can be extracted (via capillary rise and/or groundwater abstraction) +minTransimissivityForProductiveAquifer = 50.0 +# - if None, abstraction and/or capillary rise can always occur everywhere and unlimited +# - TODO: Shall we also defined the minimum value for storage coefficient? + +[routingOptions] + +debugWaterBalance = True + +lddMap = PCRGLOBWB20/input5min/routing/lddsound_05min.map +cellAreaMap = PCRGLOBWB20/input5min/routing/cellsize05min.correct.map +#~ gradient = PCRGLOBWB20/input5min/routing/slope05min.map +gradient = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/channel_gradient.map + +# manning coefficient +manningsN = 0.04 + +# manning coefficient for floodplain +floodplainManningsN= 0.07 + +# routing method: (options are kinematicWave, simplifiedKinematicWave and accuTravelTime) +#~ routingMethod = accuTravelTime +routingMethod = kinematicWave + +# Option for flood plain simulation +dynamicFloodPlain = True + +# constant channel width (optional) +#~ constantChannelWidth = None +constantChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# minimum channel width (optional) +#~ minimumChannelWidth = None +minimumChannelWidth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_width.map + +# constant channel depth +constantChannelDepth = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/bankfull_depth.map + +# files for relative elevation (above minimum dem) +relativeElevationFiles = /projects/0/dfguu/users/edwin/data/floodplain_05arcmin_world_final/based_on_daily_runoff/map/dzRel%04d.map +relativeElevationLevels = 0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00 +# TODO: Define a netcdf file + +# Channel properties for flooding +bankfullCapacity = None +# - If None, it will be estimated from (bankfull) channel depth (m) and width (m) + +# lake and reservoir parameters +waterBodyInputNC = PCRGLOBWB20/input5min/routing/reservoirs/waterBodiesFinal_version15Sept2013/maps/waterBodies5ArcMin.nc +onlyNaturalWaterBodies = False + +# composite crop factors for WaterBodies: +cropCoefficientWaterNC = PCRGLOBWB20/input30min/routing/cropCoefficientForOpenWater.nc +minCropWaterKC = 1.00 + +# number of days (timesteps) that have been performed for spinning up initial conditions in the routing module (i.e. channelStorageIni, avgDischargeLongIni, avgDischargeShortIni, etc.) +timestepsToAvgDischargeIni = 0 +# Note that: +# - maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) +# - maximum number of days (timesteps) to calculate short term average values (default: 1 month = 1 * 30 days = 30) + +# initial conditions: +waterBodyStorageIni = 0.0 +channelStorageIni = 0.0 +readAvlChannelStorageIni = 0.0 +avgDischargeLongIni = 0.0 +avgDischargeShortIni = 0.0 +m2tDischargeLongIni = 0.0 +avgBaseflowLongIni = 0.0 +riverbedExchangeIni = 0.0 +# +# initial condition of sub-time step discharge (needed for estimating number of time steps in kinematic wave methods) +subDischargeIni = 0.0 +# +avgLakeReservoirInflowShortIni = 0.0 +avgLakeReservoirOutflowLongIni = 0.0 + +[reportingOptions] + +# output files that will be written in the disk in netcdf files: +outDailyTotNC = discharge,channelStorage,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage +outMonthTotNC = totalEvaporation,waterBodyActEvaporation,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,precipitation,gwRecharge,runoff,totalRunoff,baseflow,directRunoff,interflowTotal,totalGroundwaterAbstraction,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow +outMonthAvgNC = discharge,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalActiveStorageThickness,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionTotalEvaporation,fracSurfaceWaterAllocation +outMonthEndNC = storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outMonthMaxNC = discharge,channelStorage,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage +outAnnuaTotNC = precipitation,referencePotET,gwRecharge,totalRunoff,baseflow,totalEvaporation,desalinationAbstraction,surfaceWaterAbstraction,nonFossilGroundwaterAbstraction,fossilGroundwaterAbstraction,totalGroundwaterAbstraction,totalAbstraction,irrGrossDemand,nonIrrGrossDemand,totalGrossDemand,nonIrrWaterConsumption,nonIrrReturnFlow,runoff,actualET,irrPaddyWaterWithdrawal,irrNonPaddyWaterWithdrawal,irrigationWaterWithdrawal,domesticWaterWithdrawal,industryWaterWithdrawal,livestockWaterWithdrawal,irrigationWaterWithdrawalVolume,domesticWaterWithdrawalVolume,industryWaterWithdrawalVolume,livestockWaterWithdrawalVolume,totalGroundwaterAbstractionVolume,surfaceWaterAbstractionVolume,desalinationAbstractionVolume,irrGrossDemandVolume,nonIrrGrossDemandVolume,totalGrossDemandVolume,precipitation_at_irrigation,netLqWaterToSoil_at_irrigation,evaporation_from_irrigation,transpiration_from_irrigation,precipitation_at_irrigation_volume,netLqWaterToSoil_at_irrigation_volume,evaporation_from_irrigation_volume,transpiration_from_irrigation_volume +outAnnuaAvgNC = temperature,discharge,surfaceWaterStorage,waterBodyStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,totalWaterStorageThickness,satDegUpp,satDegLow,channelStorage,waterBodyStorage,fractionWaterBodyEvaporation,fractionTotalEvaporation,fracSurfaceWaterAllocation,fracDesalinatedWaterAllocation +outAnnuaEndNC = surfaceWaterStorage,interceptStor,snowFreeWater,snowCoverSWE,topWaterLayer,storUppTotal,storLowTotal,storGroundwater,storGroundwaterFossil,waterBodyStorage,channelStorage,totalWaterStorageThickness,totalActiveStorageThickness +outAnnuaMaxNC = discharge,channelStorage,dynamicFracWat,floodVolume,floodDepth,surfaceWaterStorage +# netcdf format and zlib setup +formatNetCDF = NETCDF3_CLASSIC +zlib = False diff --git a/model/ETPFunctions.py b/model/ETPFunctions.py old mode 100755 new mode 100644 index b0c22296f..ce5f9ffab --- a/model/ETPFunctions.py +++ b/model/ETPFunctions.py @@ -1,12 +1,34 @@ -#! /usr/bin/python +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import pcraster as pcr import math + # LET OP!! PCR Pythong computes trigonometric function in degres by default. UNLIKE C, UNLIKE PYTON! # Convert all arguments to deg using * 180 / pi - def HamonPotET(airT,doy,lat): rhoSat = 2.167 * satPressure (airT) / (airT + 273.15) dayLen = dayLength(doy,lat) @@ -18,7 +40,7 @@ def HamonPotET(airT,doy,lat): def dayLength(doy,lat): """ daylength fraction of day """ lat = lat * pcr.scalar(math.pi) / 180.0 - M_PI_2 = pcr.spatial(pcr.scalar(math.pi / 2)) + M_PI_2 = pcr.spatial(pcr.scalar(math.pi / 2.0)) dec = pcr.sin( (6.224111 + 0.017202 * doy) * 180 / math.pi) dec = pcr.scalar(0.39785 * pcr.sin ((4.868961 + .017203 * doy + 0.033446 * pcr.sin (dec* 180 / math.pi)) * 180 / math.pi)) dec = pcr.scalar(pcr.asin(dec)) diff --git a/model/configuration.py b/model/configuration.py old mode 100755 new mode 100644 index 657532ff3..cfe227d4d --- a/model/configuration.py +++ b/model/configuration.py @@ -1,5 +1,26 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import ConfigParser import optparse @@ -8,40 +29,56 @@ import virtualOS as vos import time import datetime -import logging import shutil import glob +import logging logger = logging.getLogger(__name__) - - +import disclaimer class Configuration(object): - def __init__(self): + def __init__(self, iniFileName, debug_mode = False, no_modification = True, system_arguments = None): object.__init__(self) # timestamp of this run, used in logging file names, etc self._timestamp = datetime.datetime.now() - # reading configuration file name from command line arguments - # Note: this may not be very useful - usage = 'usage: %prog [options] ' - parser = optparse.OptionParser(usage=usage) - (options, arguments) = parser.parse_args() + # get the full path of iniFileName + self.iniFileName = os.path.abspath(iniFileName) - self.iniFileName = os.path.abspath(arguments[0]) + # debug option + self.debug_mode = debug_mode # read configuration from given file self.parse_configuration_file(self.iniFileName) + # option to define an online coupling between PCR-GLOBWB and MODFLOW + self.set_options_for_coupling_betweeen_pcrglobwb_and_modflow() + + # if no_modification, set configuration directly (otherwise, the function/method + if no_modification: self.set_configuration(system_arguments) + + def set_options_for_coupling_betweeen_pcrglobwb_and_modflow(self): + + self.online_coupling_between_pcrglobwb_and_moflow = False + if 'globalModflowOptions' in self.allSections and self.globalModflowOptions['online_coupling_between_pcrglobwb_and_moflow'] == "True": + + self.online_coupling_between_pcrglobwb_and_moflow = True + self.groundwaterOptions['useMODFLOW'] = "True" + + # the main output directory + self.main_output_directory = self.globalOptions['outputDir'] + + def set_configuration(self, system_arguments = None): + # set all paths, clean output when requested self.set_input_files() self.create_output_directories() # initialize logging - self.initialize_logging() + self.initialize_logging("Default", system_arguments) # copy ini file self.backup_configuration() @@ -49,51 +86,85 @@ def __init__(self): # repair key names of initial conditions self.repair_ini_key_names() + # options/settings used during debugging to PCR-GLOBWB version 1.0 + self.set_debug_to_version_one() - def initialize_logging(self): + def initialize_logging(self, log_file_location = "Default", system_arguments = None): """ Initialize logging. Prints to both the console and a log file, at configurable levels """ - #set root logger to debug level + # set root logger to debug level logging.getLogger().setLevel(logging.DEBUG) + # logging format formatter = logging.Formatter('%(asctime)s %(name)s %(levelname)s %(message)s') - log_level_console = "INFO" - log_level_file = "DEBUG" - + # default logging levels + log_level_console = "INFO" + log_level_file = "INFO" + # order: DEBUG, INFO, WARNING, ERROR, CRITICAL + + # log level based on ini/configuration file: + if "log_level_console" in self.globalOptions.keys(): + log_level_console = self.globalOptions['log_level_console'] + if "log_level_file" in self.globalOptions.keys(): + log_level_file = self.globalOptions['log_level_file'] + + # log level for debug mode: + if self.debug_mode == True: + log_level_console = "DEBUG" + log_level_file = "DEBUG" + console_level = getattr(logging, log_level_console.upper(), logging.INFO) if not isinstance(console_level, int): raise ValueError('Invalid log level: %s', log_level_console) - #create handler, add to root logger + # create handler, add to root logger console_handler = logging.StreamHandler() console_handler.setFormatter(formatter) - console_handler.setLevel(logging.DEBUG) + console_handler.setLevel(console_level) logging.getLogger().addHandler(console_handler) - log_filename = self.logFileDir + os.path.basename(self.iniFileName) + '_' + self._timestamp.isoformat() + '.log' + # log file name (and location) + if log_file_location != "Default": self.logFileDir = log_file_location + log_filename = self.logFileDir + os.path.basename(self.iniFileName) + '_' + str(self._timestamp.isoformat()).replace(":",".") + '.log' - file_level = getattr(logging, log_level_file, logging.DEBUG) + file_level = getattr(logging, log_level_file.upper(), logging.DEBUG) if not isinstance(console_level, int): raise ValueError('Invalid log level: %s', log_level_file) - #create handler, add to root logger + # create handler, add to root logger file_handler = logging.FileHandler(log_filename) file_handler.setFormatter(formatter) file_handler.setLevel(file_level) logging.getLogger().addHandler(file_handler) + # file name for debug log + dbg_filename = self.logFileDir + os.path.basename(self.iniFileName) + '_' + str(self._timestamp.isoformat()).replace(":",".") + '.dbg' + + # create handler, add to root logger + debug_handler = logging.FileHandler(dbg_filename) + debug_handler.setFormatter(formatter) + debug_handler.setLevel(logging.DEBUG) + logging.getLogger().addHandler(debug_handler) + + # print disclaimer + disclaimer.print_disclaimer(with_logger = True) + logger.info('Model run started at %s', self._timestamp) logger.info('Logging output to %s', log_filename) + logger.info('Debugging output to %s', dbg_filename) + if system_arguments != None: + logger.info('The system arguments given to execute this run: %s', system_arguments) + def backup_configuration(self): # copy ini File to logDir: shutil.copy(self.iniFileName, self.logFileDir + \ - os.path.basename(self.iniFileName) + '_' + self._timestamp.isoformat() + '.ini') + os.path.basename(self.iniFileName) + '_' + str(self._timestamp.isoformat()).replace(":",".") + '.ini') def parse_configuration_file(self, modelFileName): @@ -160,7 +231,9 @@ def create_output_directories(self): shutil.rmtree(self.scriptDir) os.makedirs(self.scriptDir) - path_of_this_module = os.path.dirname(__file__) + # working/starting directory where all s + path_of_this_module = os.path.abspath(os.path.dirname(__file__)) + self.starting_directory = path_of_this_module for filename in glob.glob(os.path.join(path_of_this_module, '*.py')): shutil.copy(filename, self.scriptDir) @@ -195,7 +268,8 @@ def create_output_directories(self): def repair_ini_key_names(self): """ Change key names for initial condition fields. - This is needed because Edwin was very stupid as once he changed some key names of initial conditions! + This is introduced because Edwin was very stupid as once he changed some key names of initial conditions! + However, it is also useful particularly for a run without """ # temporal resolution of the model @@ -203,25 +277,74 @@ def repair_ini_key_names(self): self.timeStepUnit = "day" if 'timeStep' in self.globalOptions.keys() and \ 'timeStepUnit'in self.globalOptions.keys(): - if float(self.globalOptions['timeStep']) != 1.0 or \ self.globalOptions['timeStepUnit'] != "day": - logger.info('The model runs only on daily time step. Please check your ini/configuration file') + logger.error('The model runs only on daily time step. Please check your ini/configuration file') self.timeStep = None self.timeStepUnit = None - # adjusment for routingOptions + # adjustment for limitAbstraction (to use only renewable water) + if 'limitAbstraction' not in self.landSurfaceOptions.keys(): + self.landSurfaceOptions['limitAbstraction'] = False + + # irrigation efficiency map + if 'irrigationEfficiency' not in self.landSurfaceOptions.keys() or\ + self.landSurfaceOptions['irrigationEfficiency'] == "False" or\ + self.landSurfaceOptions['irrigationEfficiency'] == "None": + logger.warning('The "irrigationEfficiency" map is not defined in the configuration file. This run assumes 100% efficiency.') + self.landSurfaceOptions['irrigationEfficiency'] = "1.00" + + # adjustment for desalinationWater + if 'desalinationWater' not in self.landSurfaceOptions.keys(): + msg = 'The option "desalinationWater" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'We assume "None" for this option. Desalination water use is NOT included in the calculation.' + logger.warning(msg) + self.landSurfaceOptions['desalinationWater'] = "None" + + # adjustment for routingOptions if 'routingMethod' not in self.routingOptions.keys(): - logger.info('The "routingMethod" is not defined in the "routingOptions" of the configuration file. "accuTravelTime" is used in this run.') + logger.warning('The "routingMethod" is not defined in the "routingOptions" of the configuration file. "accuTravelTime" is used in this run.') iniItems.routingOptions['routingMethod'] = "accuTravelTime" - # adjusment for initial conditions in the routingOptions + # adjustment for option 'limitRegionalAnnualGroundwaterAbstraction' + if 'pumpingCapacityNC' not in self.groundwaterOptions.keys(): + msg = 'The "pumpingCapacityNC" (annual groundwater pumping capacity limit netcdf file) ' + msg += 'is not defined in the "groundwaterOptions" of the configuration file. ' + msg += 'We assume no annual pumping limit used in this run. ' + msg += 'It may result too high groundwater abstraction.' + logger.warning(msg) + self.groundwaterOptions['pumpingCapacityNC'] = "None" + + # adjustment for option 'allocationSegmentsForGroundSurfaceWater' + if 'allocationSegmentsForGroundSurfaceWater' not in self.landSurfaceOptions.keys(): + msg = 'The option "allocationSegmentsForGroundSurfaceWater" is not defined in the "groundwaterOptions" of the configuration file. ' + msg += 'We assume "None" for this option. Here, water demand will be satisfied by local source only. ' + logger.warning(msg) + self.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'] = "None" + + # adjustment for option 'dynamicFloodPlain' + if 'dynamicFloodPlain' not in self.routingOptions.keys(): + msg = 'The option "dynamicFloodPlain" is not defined in the "routingOptions" of the configuration file. ' + msg += 'We assume "False" for this option. Hence, the flood plain extent is constant for the entire simulation.' + logger.warning(msg) + self.routingOptions['dynamicFloodPlain'] = "False" + + # adjustment for option 'useMODFLOW' + if 'useMODFLOW' not in self.groundwaterOptions.keys(): + msg = 'The option "useMODFLOW" is not defined in the "groundwaterOptions" of the configuration file. ' + msg += 'We assume "False" for this option.' + logger.warning(msg) + self.groundwaterOptions['useMODFLOW'] = "False" + + # adjustment for initial conditions in the routingOptions # if 'm2tChannelDischargeLongIni' in self.routingOptions.keys(): self.routingOptions['m2tDischargeLongIni'] = self.routingOptions['m2tChannelDischargeLongIni'] # if 'waterBodyStorageIni' not in self.routingOptions.keys(): - logger.info("Note that waterBodyStorageIni will be calculated from channelStorageIni.") + logger.warning("Note that 'waterBodyStorageIni' is not defined in the ini/configuration file will be calculated from 'channelStorageIni'.") + self.routingOptions['waterBodyStorageIni'] = "None" + if self.routingOptions['waterBodyStorageIni'] == "None": self.routingOptions['waterBodyStorageIni'] = None # if 'avgChannelDischargeIni' in self.routingOptions.keys(): @@ -232,38 +355,194 @@ def repair_ini_key_names(self): # if 'avgBaseflowIni' in self.routingOptions.keys(): self.routingOptions['avgBaseflowLongIni'] = self.routingOptions['avgBaseflowIni'] - # + if 'avgInflowLakeReservIni' in self.routingOptions.keys(): self.routingOptions['avgLakeReservoirInflowShortIni'] = self.routingOptions['avgInflowLakeReservIni'] - # + if 'avgOutflowDischargeIni' in self.routingOptions.keys(): self.routingOptions['avgLakeReservoirOutflowLongIni'] = self.routingOptions['avgOutflowDischargeIni'] - # + if 'avgDischargeShortIni' not in self.routingOptions.keys(): - logger.info('The initial condition "avgDischargeShortIni" is not defined. "avgDischargeLongIni" is used in this run.') + logger.warning('The initial condition "avgDischargeShortIni" is not defined. "avgDischargeLongIni" is used in this run.') self.routingOptions['avgDischargeShortIni'] = self.routingOptions['avgDischargeLongIni'] - # - if 'avgSurfaceWaterInputLongIni' not in self.routingOptions.keys(): - logger.info("Note that avgSurfaceWaterInputLongIni is not used and not needed.") + + if 'avgSurfaceWaterInputLongIni' in self.routingOptions.keys(): + logger.warning("Note that avgSurfaceWaterInputLongIni is not used and not needed in the ini/configuration file.") - if 'subDischargeIni' not in self.routingOptions.keys() or self.routingOptions['subDischargeIni'] == str(None): - msg = 'The initial condition "subDischargeIni" is not defined. Either "avgDischargeShortIni" or "avgDischargeLongIni" is used in this run. ' + if 'subDischargeIni' not in self.routingOptions.keys(): + msg = 'The initial condition "subDischargeIni" is not defined. The "avgDischargeShortIni" is used in this run. ' msg += 'Note that the "subDischargeIni" is only relevant if kinematic wave approaches are used.' - logger.info(msg) + logger.warning(msg) self.routingOptions['subDischargeIni'] = self.routingOptions['avgDischargeShortIni'] - # + + if self.routingOptions['subDischargeIni'] == "None": + msg = 'The initial condition "subDischargeIni" is given as "None". The "avgDischargeShortIni" is used in this run. ' + msg += 'Note that the "subDischargeIni" is only relevant if kinematic wave approaches are used.' + logger.warning(msg) + self.routingOptions['subDischargeIni'] = self.routingOptions['avgDischargeShortIni'] + if 'storGroundwaterFossilIni' not in self.groundwaterOptions.keys(): msg = 'The initial condition "storGroundwaterFossilIni" is not defined. ' - msg += 'Zero initial condition is assumed here.' - logger.info(msg) + msg += 'Zero initial condition is assumed here. ' + logger.warning(msg) self.groundwaterOptions['storGroundwaterFossilIni'] = "0.0" # Note for Edwin: Zero initial condition cannot be used for the run with IWMI project. if 'avgTotalGroundwaterAbstractionIni' not in self.groundwaterOptions.keys(): - msg = 'The initial condition "avgTotalGroundwaterAbstractionIni" is not defined. ' - msg += 'Zero initial condition is assumed here.' - logger.info(msg) + msg = "The initial condition 'avgTotalGroundwaterAbstractionIni' is not defined, " + msg += 'Zero initial condition is assumed here. ' + logger.warning(msg) self.groundwaterOptions['avgTotalGroundwaterAbstractionIni'] = "0.0" - # TODO: repair key names while somebody wants to run 3 layer model but use 2 layer initial conditions (and vice versa). - + if 'avgTotalGroundwaterAllocationLongIni' not in self.groundwaterOptions.keys(): + msg = "The initial condition 'avgTotalGroundwaterAllocationLongIni' is not defined, " + msg += 'Zero initial condition is assumed here. ' + logger.warning(msg) + self.groundwaterOptions['avgTotalGroundwaterAllocationLongIni'] = "0.0" + + if 'avgTotalGroundwaterAllocationShortIni' not in self.groundwaterOptions.keys(): + msg = "The initial condition 'avgTotalGroundwaterAllocationShortIni' is not defined, " + msg += 'Zero initial condition is assumed here. ' + logger.warning(msg) + self.groundwaterOptions['avgTotalGroundwaterAllocationShortIni'] = "0.0" + + if 'avgNonFossilGroundwaterAllocationLongIni' not in self.groundwaterOptions.keys(): + msg = "The initial condition 'avgNonFossilGroundwaterAllocationLongIni' is not defined, " + msg += 'Zero initial condition is assumed here. ' + logger.warning(msg) + self.groundwaterOptions['avgNonFossilGroundwaterAllocationLongIni'] = "0.0" + + if 'avgNonFossilGroundwaterAllocationShortIni' not in self.groundwaterOptions.keys(): + msg = "The initial condition 'avgNonFossilGroundwaterAllocationShortIni' is not defined, " + msg += "'avgNonFossilGroundwaterAllocationLongIni' is used here." + logger.warning(msg) + self.groundwaterOptions['avgNonFossilGroundwaterAllocationShortIni'] = self.groundwaterOptions['avgNonFossilGroundwaterAllocationLongIni'] + + if 'relativeGroundwaterHeadIni' not in self.groundwaterOptions.keys(): + msg = 'The initial condition "relativeGroundwaterHeadIni" is not defined. "None" is assumed here. ' + msg += 'Note that the "relativeGroundwaterIni" is only relevant for the run that couples PCR-GLOBWB and MODFLOW.' + logger.warning(msg) + self.groundwaterOptions['relativeGroundwaterHeadIni'] = "None" + + if 'baseflowIni' not in self.groundwaterOptions.keys(): + msg = 'The initial condition "relativeGroundWaterIni" is not defined. "0.0" is assumed here. ' + msg += 'Note that the "baseflowIni" is only relevant for the run that couples PCR-GLOBWB and MODFLOW.' + logger.warning(msg) + self.groundwaterOptions['baseflowIni'] = "0.0" + + if 'limitFossilGroundWaterAbstraction' not in self.groundwaterOptions.keys(): + msg = 'The option "limitFossilGroundWaterAbstraction" is not defined in the "groundwaterOptions" of the configuration file. ' + msg += 'This run assumes "False" for this option.' + logger.warning(msg) + self.groundwaterOptions['limitFossilGroundWaterAbstraction'] = "False" + + if 'treshold_to_maximize_irrigation_surface_water' not in self.landSurfaceOptions.keys(): + msg = 'The option "treshold_to_maximize_irrigation_surface_water" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'This run assumes "0.0" for this option.' + logger.warning(msg) + self.landSurfaceOptions['treshold_to_maximize_irrigation_surface_water'] = "0.0" + + if 'treshold_to_minimize_fossil_groundwater_irrigation' not in self.landSurfaceOptions.keys(): + msg = 'The option "treshold_to_minimize_fossil_groundwater_irrigation" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'This run assumes "0.0" for this option.' + logger.warning(msg) + self.landSurfaceOptions['treshold_to_minimize_fossil_groundwater_irrigation'] = "0.0" + + # maximum daily rate of groundwater abstraction (unit: m/day) + if 'maximumDailyGroundwaterAbstraction' not in self.groundwaterOptions.keys(): + msg = 'The option "maximumDailyGroundwaterAbstraction" is not defined in the "groundwaterOptions" of the configuration file. ' + msg += 'This run assumes "0.050 m/day" for this option.' + logger.warning(msg) + self.groundwaterOptions['maximumDailyGroundwaterAbstraction'] = "0.050" + + # maximum daily rate of fossil groundwater abstraction (unit: m/day) + if 'maximumDailyFossilGroundwaterAbstraction' not in self.groundwaterOptions.keys(): + msg = 'The option "maximumDailyFossilGroundwaterAbstraction" is not defined in the "groundwaterOptions" of the configuration file. ' + msg += 'This run assumes "0.020 m/day" for this option.' + logger.warning(msg) + self.groundwaterOptions['maximumDailyFossilGroundwaterAbstraction'] = "0.020" + + # option to include irrigation + if 'includeIrrigation' not in self.landSurfaceOptions.keys(): + msg = 'The option "includeIrrigation" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'This run assumes "False" for this option.' + logger.warning(msg) + self.landSurfaceOptions['includeIrrigation'] = "False" + + # adjustment for the option 'historicalIrrigationArea' + if 'historicalIrrigationArea' not in self.landSurfaceOptions.keys(): + msg = 'The option "historicalIrrigationArea" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'This run assumes "None" for this option.' + logger.warning(msg) + self.landSurfaceOptions['historicalIrrigationArea'] = "None" + + # adjustment for the option 'includeDomesticWaterDemand' + if 'includeDomesticWaterDemand' not in self.landSurfaceOptions.keys(): + msg = 'The option "includeDommesticWaterDemand" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'We assume "False" for this option. Domestic water demand is NOT included in the calculation.' + logger.warning(msg) + self.landSurfaceOptions['includeDomesticWaterDemand'] = "False" + + # adjustment for the option 'domesticWaterDemandFile' + if (self.landSurfaceOptions['includeDomesticWaterDemand'] == "False") and ('domesticWaterDemandFile' not in self.landSurfaceOptions.keys()): + msg = 'The option "domesticWaterDemandFile" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'We assume "None" for this option. Domestic water demand is NOT included in the calculation.' + logger.warning(msg) + self.landSurfaceOptions['domesticWaterDemandFile'] = "None" + + # adjustment for the option 'includeIndustryWaterDemand' + if 'includeIndustryWaterDemand' not in self.landSurfaceOptions.keys(): + msg = 'The option "includeDommesticWaterDemand" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'We assume "False" for this option. Industry water demand is NOT included in the calculation.' + logger.warning(msg) + self.landSurfaceOptions['includeIndustryWaterDemand'] = "False" + + # adjustment for the option 'industryWaterDemandFile' + if (self.landSurfaceOptions['includeIndustryWaterDemand'] == "False") and ('industryWaterDemandFile' not in self.landSurfaceOptions.keys()): + msg = 'The option "industryWaterDemandFile" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'We assume "None" for this option. Industry water demand is NOT included in the calculation.' + logger.warning(msg) + self.landSurfaceOptions['industryWaterDemandFile'] = "None" + + # adjustment for the option 'includeLivestockWaterDemand' + if 'includeLivestockWaterDemand' not in self.landSurfaceOptions.keys(): + msg = 'The option "includeLivestockWaterDemand" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'We assume "False" for this option. Livestock water demand is NOT included in the calculation.' + logger.warning(msg) + self.landSurfaceOptions['includeLivestockWaterDemand'] = "False" + + # adjustment for the option 'livestockWaterDemandFile' + if (self.landSurfaceOptions['includeLivestockWaterDemand'] == "False") and ('livestockWaterDemandFile' not in self.landSurfaceOptions.keys()): + msg = 'The option "livestockWaterDemandFile" is not defined in the "landSurfaceOptions" of the configuration file. ' + msg += 'We assume "None" for this option. Livestock water demand is NOT included in the calculation.' + logger.warning(msg) + self.landSurfaceOptions['livestockWaterDemandFile'] = "None" + + # adjustments for the options to read different forcing files for different years (one file for each year): + if 'precipitation_set_per_year' not in self.meteoOptions.keys(): self.meteoOptions['precipitation_set_per_year'] = "False" + if 'temperature_set_per_year' not in self.meteoOptions.keys(): self.meteoOptions['temperature_set_per_year'] = "False" + if 'refETPotFileNC_set_per_year' not in self.meteoOptions.keys(): self.meteoOptions['refETPotFileNC_set_per_year'] = "False" + + # TODO: repair key names while somebody wants to run 3 layer model but use 2 layer initial conditions (and vice versa). + + def set_debug_to_version_one(self): + + self.debug_to_version_one = False + if 'debug_to_version_one' in self.globalOptions.keys(): + if self.globalOptions['debug_to_version_one'] == "True": self.debug_to_version_one = True + + if self.debug_to_version_one: + + msg = "\n" + msg += "\n" + msg += "\n" + msg += "============================================================================\n" + msg += "============================================================================\n" + msg += "A special Run for debugging to PCR-GLOBWB version 1\n" + msg += "============================================================================\n" + msg += "============================================================================\n" + msg += "\n" + logger.info(msg) + + # TODO: Set a specific set of configuration options for a debugging run + diff --git a/model/currTimeStep.py b/model/currTimeStep.py old mode 100755 new mode 100644 index 761b0dd4c..a68051dd5 --- a/model/currTimeStep.py +++ b/model/currTimeStep.py @@ -1,5 +1,26 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import logging logger = logging.getLogger(__name__) @@ -15,7 +36,7 @@ def __init__(self): #FIXME: use __init__ - def getStartEndTimeSteps(self,strStartTime,strEndTime): + def getStartEndTimeSteps(self,strStartTime,strEndTime,showNumberOfTimeSteps=True): # get startTime, endTime, nrOfTimeSteps sd = str(strStartTime).split('-') self._startTime = datetime.date(int(sd[0]), int(sd[1]), int(sd[2])) @@ -23,7 +44,7 @@ def getStartEndTimeSteps(self,strStartTime,strEndTime): self._endTime = datetime.date(int(ed[0]), int(ed[1]), int(ed[2])) self._nrOfTimeSteps = 1 + (self.endTime - self.startTime).days self._spinUpStatus = False - logger.info("number of time steps :"+str(self._nrOfTimeSteps)) + if showNumberOfTimeSteps == True: logger.info("number of time steps: "+str(self._nrOfTimeSteps)) self._monthIdx = 0 # monthly indexes since the simulation starts self._annuaIdx = 0 # yearly indexes since the simulation starts @@ -97,9 +118,12 @@ def fulldate(self): def update(self,timeStepPCR): self._timeStepPCR = timeStepPCR self._currTime = self._startTime + datetime.timedelta(days=1 * (timeStepPCR - 1)) - self._fulldate = str(self.currTime.strftime('%Y-%m-%d')) - print(self._fulldate) - if self._spinUpStatus == True : + + #~ self._fulldate = str(self.currTime.strftime('%Y-%m-%d')) # This does not work for the date before 1900 + self._fulldate = '%04i-%02i-%02i' %(self._currTime.year, self._currTime.month, self._currTime.day) + #~ print(self._fulldate) + + if self.spinUpStatus == True : logger.info("Spin-Up "+str(self._noSpinUp)+" of "+str(self._maxSpinUps)) # The following contains hours, minutes, seconds, etc. @@ -134,6 +158,13 @@ def isLastDayOfYear(self): #tomorrow is the first day of the year return tomorrow.timetuple().tm_yday == 1 + def isLastTimeStep(self): + return self._currTime == self._endTime + + def yesterday(self): + yesterday = self.currTime - datetime.timedelta(days=1) + return str(yesterday.strftime('%Y-%m-%d')) + #FIXME: use isLastDayOfMonth @property def endMonth(self): @@ -145,5 +176,5 @@ def endYear(self): return self.isLastDayOfYear() def __str__(self): - print self._currTime + #~ print self._currTime return str(self._currTime) diff --git a/model/debug_to_version_one.sh b/model/debug_to_version_one.sh new file mode 100755 index 000000000..b1921d3f7 --- /dev/null +++ b/model/debug_to_version_one.sh @@ -0,0 +1,10 @@ +# copying the script and tbl +cp ../pcrglobwb_v1/pcrglobwb_v1.2_fullforcing_edwinVersion.txt /scratch/edwin/test_RhineMeuse30min_EFAS_test +cp ../pcrglobwb_v1/param_permafrost_edwinVersion.tbl /scratch/edwin/test_RhineMeuse30min_EFAS_test/maps + +# go to the maps directory and make the results directory +cd /scratch/edwin/test_RhineMeuse30min_EFAS_test +mkdir oldcalc_results + +# execute the script +oldcalc -f pcrglobwb_v1.2_fullforcing_edwinVersion.txt 31 60 91 121 152 182 213 244 274 305 335 366 1 diff --git a/model/deterministic_runner.py b/model/deterministic_runner.py old mode 100755 new mode 100644 index 8778d774d..ef00c4abd --- a/model/deterministic_runner.py +++ b/model/deterministic_runner.py @@ -1,8 +1,29 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- - +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os import sys -import logging from pcraster.framework import DynamicModel from pcraster.framework import DynamicFramework @@ -14,8 +35,12 @@ from pcrglobwb import PCRGlobWB +import logging logger = logging.getLogger(__name__) +import oldcalc_framework +import disclaimer + class DeterministicRunner(DynamicModel): def __init__(self, configuration, modelTime, initialState = None): @@ -43,15 +68,31 @@ def dynamic(self): self.reporting.report() def main(): - initial_state = None - configuration = Configuration() + + # print disclaimer + disclaimer.print_disclaimer() + + # get the full path of configuration/ini file given in the system argument + iniFileName = os.path.abspath(sys.argv[1]) - spin_up = SpinUp(configuration) # object for spin_up + # debug option + debug_mode = False + if len(sys.argv) > 2: + if sys.argv[2] == "debug": debug_mode = True - currTimeStep = ModelTime() # timeStep info: year, month, day, doy, hour, etc + # object to handle configuration/ini file + configuration = Configuration(iniFileName = iniFileName, \ + debug_mode = debug_mode) + + # timeStep info: year, month, day, doy, hour, etc + currTimeStep = ModelTime() + # object for spin_up + spin_up = SpinUp(configuration) + # spinningUp noSpinUps = int(configuration.globalOptions['maxSpinUpsInYears']) + initial_state = None if noSpinUps > 0: logger.info('Spin-Up #Total Years: '+str(noSpinUps)) @@ -76,18 +117,38 @@ def main(): has_converged = spin_up.checkConvergence(all_state_begin, all_state_end, spinUpRun, deterministic_runner.model.routing.cellArea) initial_state = deterministic_runner.model.getState() - # + # Running the deterministic_runner (excluding DA scheme) currTimeStep.getStartEndTimeSteps(configuration.globalOptions['startTime'], configuration.globalOptions['endTime']) - logger.info('Transient simulation run started.') deterministic_runner = DeterministicRunner(configuration, currTimeStep, initial_state) - dynamic_framework = DynamicFramework(deterministic_runner,currTimeStep.nrOfTimeSteps) dynamic_framework.setQuiet(True) dynamic_framework.run() + + # for debugging to PCR-GLOBWB version one + if configuration.debug_to_version_one: + + logger.info('\n\n\n\n\n'+'Executing PCR-GLOBWB version 1.'+'\n\n\n\n\n') + + # reset modelTime object + currTimeStep = None; currTimeStep = ModelTime() + currTimeStep.getStartEndTimeSteps(configuration.globalOptions['startTime'], + configuration.globalOptions['endTime']) + + # execute PCR-GLOBWB version 1 + # - including comparing model outputs (from versions one and two) + pcrglobwb_one = oldcalc_framework.PCRGlobWBVersionOne(configuration, \ + currTimeStep, \ + deterministic_runner.model.routing.landmask, \ + deterministic_runner.model.routing.cellArea) + dynamic_framework = DynamicFramework(pcrglobwb_one, currTimeStep.nrOfTimeSteps) + dynamic_framework.setQuiet(True) + dynamic_framework.run() + if __name__ == '__main__': + # print disclaimer + disclaimer.print_disclaimer(with_logger = True) sys.exit(main()) - diff --git a/model/disclaimer.py b/model/disclaimer.py new file mode 100644 index 000000000..f7eba7fb9 --- /dev/null +++ b/model/disclaimer.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import logging +logger = logging.getLogger(__name__) + +def print_disclaimer(with_logger = False): + + # disclaimer message + disclaimer_message = "\n" + disclaimer_message += "\n" + disclaimer_message += " PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model " + "\n" + disclaimer_message += "\n" + disclaimer_message += " Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, " + "\n" + disclaimer_message += " Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, " + "\n" + disclaimer_message += " Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, " + "\n" + disclaimer_message += " and Marc F. P. Bierkens, " + "\n" + disclaimer_message += " Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands " + "\n" + disclaimer_message += "\n" + disclaimer_message += " This program comes with ABSOLUTELY NO WARRANTY " + "\n" + disclaimer_message += " This is free software, and you are welcome to redistribute it under certain conditions " + "\n" + disclaimer_message += " See the LICENSE file for more details " + "\n" + disclaimer_message += "\n" + + # print disclaimer + if with_logger: + logger.info(disclaimer_message) + else: + print(disclaimer_message) diff --git a/model/groundwater.py b/model/groundwater.py old mode 100755 new mode 100644 index 2b75bca5c..62814b1ed --- a/model/groundwater.py +++ b/model/groundwater.py @@ -1,6 +1,28 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- - +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import math import subprocess import os @@ -14,161 +36,286 @@ from ncConverter import * class Groundwater(object): - + def getState(self): result = {} - result['storGroundwater'] = self.storGroundwater # unit: m - result['storGroundwaterFossil'] = self.storGroundwaterFossil # unit: m - result['avgTotalGroundwaterAbstractionIni'] = self.avgAbstraction # unit: m - + result['storGroundwater'] = self.storGroundwater # unit: m + result['storGroundwaterFossil'] = self.storGroundwaterFossil # unit: m + result['avgTotalGroundwaterAbstraction'] = self.avgAbstraction # unit: m/day + result['avgTotalGroundwaterAllocationLong'] = self.avgAllocation # unit: m/day + result['avgTotalGroundwaterAllocationShort'] = self.avgAllocationShort # unit: m/day + result['avgNonFossilGroundwaterAllocationLong'] = self.avgNonFossilAllocation # unit: m/day + result['avgNonFossilGroundwaterAllocationShort'] = self.avgNonFossilAllocationShort # unit: m/day + + # states that needed for the coupling between PCR-GLOBWB and MODFLOW: + result['relativeGroundwaterHead'] = self.relativeGroundwaterHead # unit: m + result['baseflow'] = self.baseflow # unit: m/day + return result def getPseudoState(self): result = {} - + return result def __init__(self, iniItems,landmask,spinUp): object.__init__(self) - + self.cloneMap = iniItems.cloneMap - self.tmpDir = iniItems.tmpDir + self.tmpDir = iniItems.tmpDir self.inputDir = iniItems.globalOptions['inputDir'] self.landmask = landmask - # option to activate water balance check + # configuration from the ini file + self.iniItems = iniItems + + # option to activate a water balance check self.debugWaterBalance = True - if iniItems.routingOptions['debugWaterBalance'] == "False": - self.debugWaterBalance = False - - if iniItems.groundwaterOptions['groundwaterPropertiesNC'] == str(None): - # assign the recession coefficient parameter(s) - self.recessionCoeff = vos.readPCRmapClone(\ - iniItems.groundwaterOptions['recessionCoeff'], - self.cloneMap,self.tmpDir,self.inputDir) - else: + if iniItems.routingOptions['debugWaterBalance'] == "False": self.debugWaterBalance = False + + self.useMODFLOW = False + if iniItems.groundwaterOptions['useMODFLOW'] == "True": self.useMODFLOW = True + + + ##################################################################################################################################################### + # limitAbstraction options + self.limitAbstraction = False + if iniItems.landSurfaceOptions['limitAbstraction'] == "True": self.limitAbstraction = True + + # option for limitting fossil groundwater abstractions: + self.limitFossilGroundwaterAbstraction = False + if iniItems.groundwaterOptions['limitFossilGroundWaterAbstraction'] == "True": + self.limitFossilGroundwaterAbstraction = True + + # if using MODFLOW, limitAbstraction must be True (the abstraction cannot exceed storGroundwater, the concept of fossil groundwater is abandoned) + if self.useMODFLOW: + self.limitAbstraction = True + self.limitFossilGroundwaterAbstraction = False + + # option for limitting regional groundwater abstractions + if iniItems.groundwaterOptions['pumpingCapacityNC'] != "None": + logger.info('Limit for annual regional groundwater abstraction is used.') + self.limitRegionalAnnualGroundwaterAbstraction = True + self.pumpingCapacityNC = vos.getFullPath(\ + iniItems.groundwaterOptions['pumpingCapacityNC'],self.inputDir,False) + else: + logger.warning('NO LIMIT for regional groundwater (annual) pumping. It may result too high groundwater abstraction.') + self.limitRegionalAnnualGroundwaterAbstraction = False + ##################################################################################################################################################### + + + ###################################################################################### + # a netcdf file containing the groundwater properties + if iniItems.groundwaterOptions['groundwaterPropertiesNC'] != "None": groundwaterPropertiesNC = vos.getFullPath(\ iniItems.groundwaterOptions[\ - 'groundwaterPropertiesNC'], - self.inputDir) - self.recessionCoeff = vos.netcdf2PCRobjCloneWithoutTime(\ - groundwaterPropertiesNC,'recessionCoeff',\ - cloneMapFileName = self.cloneMap) + 'groundwaterPropertiesNC'],self.inputDir) + ###################################################################################### - # groundwater recession coefficient (day-1_ - self.recessionCoeff = pcr.cover(self.recessionCoeff,0.00) - self.recessionCoeff = pcr.min(1.0000,self.recessionCoeff) - # - if 'minRecessionCoeff' in iniItems.groundwaterOptions.keys(): - minRecessionCoeff = float(iniItems.groundwaterOptions['minRecessionCoeff']) - else: - minRecessionCoeff = 1.0e-4 # This is the minimum value used in Van Beek et al. (2011). - self.recessionCoeff = pcr.max(minRecessionCoeff,self.recessionCoeff) - - if iniItems.groundwaterOptions['groundwaterPropertiesNC'] == str(None): - # assign aquifer specific yield + + ##################################################################################################################################################### + # assign aquifer specific yield (dimensionless) + if iniItems.groundwaterOptions['groundwaterPropertiesNC'] == "None" or 'specificYield' in iniItems.groundwaterOptions.keys(): self.specificYield = vos.readPCRmapClone(\ - iniItems.groundwaterOptions['specificYield'], - self.cloneMap,self.tmpDir,self.inputDir) - else: + iniItems.groundwaterOptions['specificYield'],self.cloneMap,self.tmpDir,self.inputDir) + else: self.specificYield = vos.netcdf2PCRobjCloneWithoutTime(\ - groundwaterPropertiesNC,'specificYield',\ - cloneMapFileName = self.cloneMap) + groundwaterPropertiesNC,'specificYield',self.cloneMap) + self.specificYield = pcr.cover(self.specificYield,0.0) + self.specificYield = pcr.max(0.010,self.specificYield) # TODO: Set the minimum values of specific yield. + self.specificYield = pcr.min(1.000,self.specificYield) + ##################################################################################################################################################### - self.specificYield = pcr.cover(self.specificYield,0.0) - self.specificYield = pcr.max(0.010,self.specificYield) # TODO: TO BE CHECKED: The resample process of specificYield - self.specificYield = pcr.min(1.000,self.specificYield) - if iniItems.groundwaterOptions['groundwaterPropertiesNC'] == str(None): - # assign aquifer saturated conductivity + ##################################################################################################################################################### + # assign aquifer hydraulic conductivity (unit: m/day) + if iniItems.groundwaterOptions['groundwaterPropertiesNC'] == "None" or 'kSatAquifer' in iniItems.groundwaterOptions.keys(): self.kSatAquifer = vos.readPCRmapClone(\ - iniItems.groundwaterOptions['kSatAquifer'], - self.cloneMap,self.tmpDir,self.inputDir) - else: + iniItems.groundwaterOptions['kSatAquifer'],self.cloneMap,self.tmpDir,self.inputDir) + else: self.kSatAquifer = vos.netcdf2PCRobjCloneWithoutTime(\ - groundwaterPropertiesNC,'kSatAquifer',\ - cloneMapFileName = self.cloneMap) + groundwaterPropertiesNC,'kSatAquifer',self.cloneMap) + self.kSatAquifer = pcr.cover(self.kSatAquifer,0.0) + self.kSatAquifer = pcr.max(0.010,self.kSatAquifer) + ##################################################################################################################################################### - self.kSatAquifer = pcr.cover(self.kSatAquifer,0.0) - self.kSatAquifer = pcr.max(0.010,self.kSatAquifer) - # limitAbstraction options - self.limitAbstraction = False - if iniItems.landSurfaceOptions['limitAbstraction'] == "True": self.limitAbstraction = True - - # option for limitting fossil groundwater abstractions - This option is only defined for IWMI project - self.limitFossilGroundwaterAbstraction = False - if self.limitAbstraction == False and\ - "extraOptionsforProjectWithIWMI" in iniItems.allSections and\ - iniItems.extraOptionsforProjectWithIWMI['limitFossilGroundWaterAbstraction'] == "True": - - logger.info('Fossil groundwater abstraction limit is used (IWMI project).') - self.limitFossilGroundwaterAbstraction = True - - # estimate of thickness (unit: mm) of aceesible groundwater: shallow and deep - totalGroundwaterThickness = vos.readPCRmapClone(\ - iniItems.extraOptionsforProjectWithIWMI['estimateOfTotalGroundwaterThickness'], - self.cloneMap,self.tmpDir,self.inputDir) - totalGroundwaterThickness = pcr.cover(totalGroundwaterThickness, - pcr.windowaverage(totalGroundwaterThickness, 1.0)) - totalGroundwaterThickness = pcr.cover(totalGroundwaterThickness, - pcr.windowaverage(totalGroundwaterThickness, 1.5)) + ##################################################################################################################################################### + # try to assign the reccesion coefficient (unit: day-1) from the netcdf file of groundwaterPropertiesNC + try: + self.recessionCoeff = vos.netcdf2PCRobjCloneWithoutTime(\ + groundwaterPropertiesNC,'recessionCoeff',\ + cloneMapFileName = self.cloneMap) + except: + self.recessionCoeff = None + msg = "The 'recessionCoeff' cannot be read from the file: "+groundwaterPropertiesNC + logger.warning(msg) + + # assign the reccession coefficient based on the given pcraster file + if 'recessionCoeff' in iniItems.groundwaterOptions.keys(): + if iniItems.groundwaterOptions['recessionCoeff'] != "None":\ + self.recessionCoeff = vos.readPCRmapClone(iniItems.groundwaterOptions['recessionCoeff'],self.cloneMap,self.tmpDir,self.inputDir) + + # calculate the reccession coefficient based on the given parameters + if isinstance(self.recessionCoeff,types.NoneType) and\ + 'recessionCoeff' not in iniItems.groundwaterOptions.keys(): + + msg = "Calculating the groundwater linear reccesion coefficient based on the given parameters." + logger.info(msg) + + # reading the 'aquiferWidth' value from the landSurfaceOptions (slopeLength) + if iniItems.landSurfaceOptions['topographyNC'] == None: + aquiferWidth = vos.readPCRmapClone(iniItems.landSurfaceOptions['slopeLength'],self.cloneMap,self.tmpDir,self.inputDir) + else: + topoPropertiesNC = vos.getFullPath(iniItems.landSurfaceOptions['topographyNC'],self.inputDir) + aquiferWidth = vos.netcdf2PCRobjCloneWithoutTime(topoPropertiesNC,'slopeLength',self.cloneMap) + # covering aquiferWidth with its maximum value + aquiferWidth = pcr.ifthen(self.landmask, pcr.cover(aquiferWidth, pcr.mapmaximum(aquiferWidth))) + + # aquifer thickness (unit: m) for recession coefficient + aquiferThicknessForRecessionCoeff = vos.readPCRmapClone(iniItems.groundwaterOptions['aquiferThicknessForRecessionCoeff'],\ + self.cloneMap,self.tmpDir,self.inputDir) + + # calculate recessionCoeff (unit; day-1) + self.recessionCoeff = (math.pi**2.) * aquiferThicknessForRecessionCoeff / \ + (4.*self.specificYield*(aquiferWidth**2.)) + + # assign the reccession coefficient based on the given pcraster file + if 'recessionCoeff' in iniItems.groundwaterOptions.keys(): + if iniItems.groundwaterOptions['recessionCoeff'] != "None":\ + self.recessionCoeff = vos.readPCRmapClone(iniItems.groundwaterOptions['recessionCoeff'],self.cloneMap,self.tmpDir,self.inputDir) + + # minimum and maximum values for groundwater recession coefficient (day-1) + self.recessionCoeff = pcr.cover(self.recessionCoeff,0.00) + self.recessionCoeff = pcr.min(0.9999,self.recessionCoeff) + if 'minRecessionCoeff' in iniItems.groundwaterOptions.keys(): + minRecessionCoeff = float(iniItems.groundwaterOptions['minRecessionCoeff']) + else: + minRecessionCoeff = 1.0e-4 # This is the minimum value used in Van Beek et al. (2011). + self.recessionCoeff = pcr.max(minRecessionCoeff,self.recessionCoeff) + ##################################################################################################################################################### + + + ##################################################################################################################################################### + # assign the river/stream/surface water bed conductivity + # - the default value is equal to kSatAquifer + self.riverBedConductivity = self.kSatAquifer + # - assign riverBedConductivity coefficient based on the given pcraster file + if 'riverBedConductivity' in iniItems.groundwaterOptions.keys(): + if iniItems.groundwaterOptions['riverBedConductivity'] != "None":\ + self.riverBedConductivity = vos.readPCRmapClone(iniItems.groundwaterOptions['riverBedConductivity'],self.cloneMap,self.tmpDir,self.inputDir) + ##################################################################################################################################################### + + + ##################################################################################################################################################### + # total groundwater thickness (unit: m) + # - For PCR-GLOBWB, the estimate of total groundwater thickness is needed to estimate for the following purpose: + # - productive aquifer areas (where capillary rise can occur and groundwater depletion can occur) + # - and also to estimate fossil groundwater capacity (the latter is needed only for run without MODFLOW) + totalGroundwaterThickness = None + if 'estimateOfTotalGroundwaterThickness' in iniItems.groundwaterOptions.keys(): + + totalGroundwaterThickness = vos.readPCRmapClone(iniItems.groundwaterOptions['estimateOfTotalGroundwaterThickness'], + self.cloneMap, self.tmpDir, self.inputDir) + + # extrapolation of totalGroundwaterThickness + # - TODO: Make a general extrapolation option as a function in the virtualOS.py totalGroundwaterThickness = pcr.cover(totalGroundwaterThickness, - pcr.windowaverage(totalGroundwaterThickness, 2.5)) + pcr.windowaverage(totalGroundwaterThickness, 0.75)) totalGroundwaterThickness = pcr.cover(totalGroundwaterThickness, - pcr.windowaverage(totalGroundwaterThickness, 5.0)) + pcr.windowaverage(totalGroundwaterThickness, 0.75)) totalGroundwaterThickness = pcr.cover(totalGroundwaterThickness, - pcr.windowaverage(totalGroundwaterThickness, 7.5)) + pcr.windowaverage(totalGroundwaterThickness, 0.75)) totalGroundwaterThickness = pcr.cover(totalGroundwaterThickness, - pcr.mapmaximum(totalGroundwaterThickness)) + pcr.windowaverage(totalGroundwaterThickness, 1.00)) + totalGroundwaterThickness = pcr.cover(totalGroundwaterThickness, 0.0) + + # set minimum thickness + if 'minimumTotalGroundwaterThickness' in iniItems.groundwaterOptions.keys(): + minimumThickness = pcr.scalar(float(\ + iniItems.groundwaterOptions['minimumTotalGroundwaterThickness'])) + totalGroundwaterThickness = pcr.max(minimumThickness, totalGroundwaterThickness) + + # set maximum thickness + if 'maximumTotalGroundwaterThickness' in iniItems.groundwaterOptions.keys() and\ + (iniItems.groundwaterOptions['maximumTotalGroundwaterThickness'] != "None"): + maximumThickness = float(iniItems.groundwaterOptions['maximumTotalGroundwaterThickness']) + totalGroundwaterThickness = pcr.min(maximumThickness, totalGroundwaterThickness) + + # estimate of total groundwater thickness (unit: m) + self.totalGroundwaterThickness = totalGroundwaterThickness + ##################################################################################################################################################### + - # set minimum thickness to 50 m: - totalGroundwaterThickness = pcr.max(50.0, totalGroundwaterThickness) - - # estimate of capacity (unit: m) of renewable groundwater (shallow) + ##################################################################################################################################################### + # extent of the productive aquifer (a boolean map) + # - Principle: In non-productive aquifer areas, no capillary rise and groundwater abstraction should not exceed recharge + # + self.productive_aquifer = pcr.ifthen(self.landmask, pcr.boolean(1.0)) + excludeUnproductiveAquifer = True + if excludeUnproductiveAquifer: + if 'minimumTransmissivityForProductiveAquifer' in iniItems.groundwaterOptions.keys() and\ + (iniItems.groundwaterOptions['minimumTransmissivityForProductiveAquifer'] != "None" or\ + iniItems.groundwaterOptions['minimumTransmissivityForProductiveAquifer'] != "False"): + minimumTransmissivityForProductiveAquifer = \ + vos.readPCRmapClone(iniItems.groundwaterOptions['minimumTransmissivityForProductiveAquifer'],\ + self.cloneMap, self.tmpDir, self.inputDir) + self.productive_aquifer = pcr.cover(\ + pcr.ifthen(self.kSatAquifer * totalGroundwaterThickness > minimumTransmissivityForProductiveAquifer, pcr.boolean(1.0)), pcr.boolean(0.0)) + self.productive_aquifer = pcr.cover(self.productive_aquifer, pcr.boolean(0.0)) + # - TODO: Check and re-calculate the GLHYMPS map to confirm the kSatAquifer value in groundwaterPropertiesNC (e.g. we miss some parts of HPA). + ##################################################################################################################################################### + + + ##################################################################################################################################################### + # estimate of fossil groundwater capacity (based on the aquifer thickness and specific yield) + if iniItems.groundwaterOptions['limitFossilGroundWaterAbstraction'] == "True" and self.limitAbstraction == False: + + logger.info('Fossil groundwater abstractions are allowed with LIMIT.') + + logger.info('Estimating fossil groundwater capacities based on aquifer thicknesses and specific yield.') + # TODO: Make the following aquifer thickness information can be used to define the extent of productive aquifer. + + # estimate of capacity (unit: m) of renewable groundwater (to correct the initial estimate of fossil groundwater capacity) + # - this value is NOT relevant, but requested in the IWMI project + if 'estimateOfRenewableGroundwaterCapacity' not in iniItems.groundwaterOptions.keys():\ + iniItems.groundwaterOptions['estimateOfRenewableGroundwaterCapacity'] = 0.0 storGroundwaterCap = pcr.cover( vos.readPCRmapClone(\ - iniItems.extraOptionsforProjectWithIWMI['estimateOfRenewableGroundwaterCapacity'], - self.cloneMap,self.tmpDir,self.inputDir),\ - 0.0) - + iniItems.groundwaterOptions['estimateOfRenewableGroundwaterCapacity'], + self.cloneMap,self.tmpDir,self.inputDir), 0.0) # fossil groundwater capacity (unit: m) - self.fossilWaterCap = pcr.max(0.0,\ - totalGroundwaterThickness*self.specificYield - storGroundwaterCap) - - # option for limitting regional groundwater abstractions - This option is only defined - self.limitRegionalAnnualGroundwaterAbstraction = False - if "extraOptionsforProjectWithIWMI" in iniItems.allSections and\ - iniItems.extraOptionsforProjectWithIWMI['limitRegionalAnnualGroundwaterAbstraction'] == "True": - - logger.info('Limit for regional groundwater abstraction is used (IWMI project).') - self.limitRegionalAnnualGroundwaterAbstraction = True - - region_ids = vos.readPCRmapClone(\ - iniItems.extraOptionsforProjectWithIWMI['regionIds'], - self.cloneMap,self.tmpDir,self.inputDir) - self.region_ids = pcr.nominal(region_ids) - self.region_ids = pcr.ifthen(self.landmask, self.region_ids) - - self.regionalAnnualGroundwaterAbstractionLimit = vos.readPCRmapClone(\ - iniItems.extraOptionsforProjectWithIWMI['pumpingCapacity'], - self.cloneMap,self.tmpDir,self.inputDir) - self.regionalAnnualGroundwaterAbstractionLimit = pcr.roundup(self.regionalAnnualGroundwaterAbstractionLimit*1000.)/1000. - self.regionalAnnualGroundwaterAbstractionLimit = pcr.cover(self.regionalAnnualGroundwaterAbstractionLimit, 0.0) - - self.regionalAnnualGroundwaterAbstractionLimit *= 1000. * 1000. * 1000. # unit: m3/year - self.regionalAnnualGroundwaterAbstractionLimit = pcr.ifthen(self.landmask,\ - self.regionalAnnualGroundwaterAbstractionLimit) - - # zones at which water allocation (surface and groundwater allocation) is determined + self.fossilWaterCap = pcr.ifthen(self.landmask,\ + pcr.max(0.0,\ + totalGroundwaterThickness*self.specificYield - storGroundwaterCap)) + ##################################################################################################################################################### + + + ##################################################################################################################################################### + # zones at which groundwater allocations are determined self.usingAllocSegments = False - if iniItems.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'] != "None": self.usingAllocSegments = True - + # - by default, it is consistent with the one defined in the landSurfaceOptions + if iniItems.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'] not in ["None", "False"]: + self.usingAllocSegments = True + groundwaterAllocationSegments = iniItems.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'] + # - yet, we can also define a specific one for groundwater + if "allocationSegmentsForGroundwater" in iniItems.groundwaterOptions.keys(): + if iniItems.groundwaterOptions['allocationSegmentsForGroundwater'] not in ["None", "False"]: + self.usingAllocSegments = True + groundwaterAllocationSegments = iniItems.groundwaterOptions['allocationSegmentsForGroundwater'] + else: + self.usingAllocSegments = False + else: + self.usingAllocSegments = False + ##################################################################################################################################################### + + + ##################################################################################################################################################### # incorporating groundwater distribution network: - if self.usingAllocSegments and self.limitAbstraction == False: + if self.usingAllocSegments: self.allocSegments = vos.readPCRmapClone(\ - iniItems.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'], + groundwaterAllocationSegments, self.cloneMap,self.tmpDir,self.inputDir,isLddMap=False,cover=None,isNomMap=True) self.allocSegments = pcr.ifthen(self.landmask, self.allocSegments) @@ -179,7 +326,30 @@ def __init__(self, iniItems,landmask,spinUp): self.segmentArea = pcr.areatotal(pcr.cover(cellArea, 0.0), self.allocSegments) self.segmentArea = pcr.ifthen(self.landmask, self.segmentArea) - + ##################################################################################################################################################### + + + ##################################################################################################################################################### + # maximumDailyGroundwaterAbstraction (unit: m/day) - in order to avoid over-abstraction of groundwater source + self.maximumDailyGroundwaterAbstraction = vos.readPCRmapClone(iniItems.groundwaterOptions['maximumDailyGroundwaterAbstraction'], + self.cloneMap,self.tmpDir,self.inputDir) + ##################################################################################################################################################### + + + ##################################################################################################################################################### + # maximumDailyFossilGroundwaterAbstraction (unit: m/day) - in order to avoid over-abstraction of groundwater source + self.maximumDailyFossilGroundwaterAbstraction = vos.readPCRmapClone(iniItems.groundwaterOptions['maximumDailyFossilGroundwaterAbstraction'], + self.cloneMap,self.tmpDir,self.inputDir) + ##################################################################################################################################################### + + + # get the initial conditions + self.getICs(iniItems,spinUp) + + # initiate old style reporting (this is useful for debugging) + self.initiate_old_style_groundwater_reporting(iniItems) + + def initiate_old_style_groundwater_reporting(self,iniItems): self.report = True try: @@ -260,28 +430,65 @@ def __init__(self, iniItems,landmask,spinUp): str(var)+"_annuaEnd.nc",\ var,"undefined") - #get initial conditions - self.getICs(iniItems,spinUp) - def getICs(self,iniItems,iniConditions = None): - print iniItems.groundwaterOptions['storGroundwaterFossilIni'] - - # initial condition for storGroundwater (unit: m) - if iniConditions == None: # when the model just start - self.storGroundwater = vos.readPCRmapClone(\ - iniItems.groundwaterOptions['storGroundwaterIni'], - self.cloneMap,self.tmpDir,self.inputDir) - self.avgAbstraction = vos.readPCRmapClone(\ - iniItems.groundwaterOptions['avgTotalGroundwaterAbstractionIni'], - self.cloneMap,self.tmpDir,self.inputDir) + self.initialize_states(iniItems, iniConditions) + + def initialize_states(self, iniItems, iniConditions): + + # initial conditions (unit: m) + if iniConditions == None: # when the model just start (reading the initial conditions from file) + + + self.storGroundwater = vos.readPCRmapClone(\ + iniItems.groundwaterOptions['storGroundwaterIni'], + self.cloneMap,self.tmpDir,self.inputDir) + self.avgAbstraction = vos.readPCRmapClone(\ + iniItems.groundwaterOptions['avgTotalGroundwaterAbstractionIni'], + self.cloneMap,self.tmpDir,self.inputDir) + self.avgAllocation = vos.readPCRmapClone(\ + iniItems.groundwaterOptions['avgTotalGroundwaterAllocationLongIni'], + self.cloneMap,self.tmpDir,self.inputDir) + self.avgAllocationShort = vos.readPCRmapClone(\ + iniItems.groundwaterOptions['avgTotalGroundwaterAllocationShortIni'], + self.cloneMap,self.tmpDir,self.inputDir) + self.avgNonFossilAllocation = vos.readPCRmapClone(\ + iniItems.groundwaterOptions['avgNonFossilGroundwaterAllocationLongIni'], + self.cloneMap,self.tmpDir,self.inputDir) + self.avgNonFossilAllocationShort = vos.readPCRmapClone(\ + iniItems.groundwaterOptions['avgNonFossilGroundwaterAllocationShortIni'], + self.cloneMap,self.tmpDir,self.inputDir) + + # additional initial conditions (needed ONLY for the online coupling between PCR-GLOBWB and MODFLOW)) + if iniItems.groundwaterOptions['relativeGroundwaterHeadIni'] != "None":\ + self.relativeGroundwaterHead = vos.readPCRmapClone(\ + iniItems.groundwaterOptions['relativeGroundwaterHeadIni'], + self.cloneMap,self.tmpDir,self.inputDir) + else: + self.relativeGroundwaterHead = self.storGroundwater / self.specificYield + self.baseflow = vos.readPCRmapClone(\ + iniItems.groundwaterOptions['baseflowIni'], + self.cloneMap,self.tmpDir,self.inputDir) + else: # during/after spinUp - self.storGroundwater = iniConditions['groundwater'][ 'storGroundwater'] - self.avgAbstraction = iniConditions['groundwater'][ 'avgTotalGroundwaterAbstractionIni'] + self.storGroundwater = iniConditions['groundwater']['storGroundwater'] + self.avgAbstraction = iniConditions['groundwater']['avgTotalGroundwaterAbstraction'] + self.avgAllocation = iniConditions['groundwater']['avgTotalGroundwaterAllocationLong'] + self.avgAllocationShort = iniConditions['groundwater']['avgTotalGroundwaterAllocationShort'] + self.avgNonFossilAllocation = iniConditions['groundwater']['avgNonFossilGroundwaterAllocationLong'] + self.avgNonFossilAllocationShort = iniConditions['groundwater']['avgNonFossilGroundwaterAllocationShort'] + + self.relativeGroundwaterHead = iniConditions['groundwater']['relativeGroundwaterHead'] + self.baseflow = iniConditions['groundwater']['baseflow'] # initial condition for storGroundwaterFossil (unit: m) # - # Note that storGroundwaterFossil should not be depleted during the spin-up. + # Note that storGroundwaterFossil should not be depleted during the spin-up. + # + if iniItems.groundwaterOptions['storGroundwaterFossilIni'] == "Maximum" and\ + self.limitFossilGroundwaterAbstraction and self.limitAbstraction == False: + logger.info("Assuming 'full' fossilWaterCap as the initial condition for fossil groundwater storage.") + self.storGroundwaterFossil = self.fossilWaterCap # if iniItems.groundwaterOptions['storGroundwaterFossilIni'] != "Maximum": logger.info("Using a pre-defined initial condition for fossil groundwater storage.") @@ -289,34 +496,59 @@ def getICs(self,iniItems,iniConditions = None): iniItems.groundwaterOptions['storGroundwaterFossilIni'], self.cloneMap,self.tmpDir,self.inputDir) # - if self.limitFossilGroundwaterAbstraction and iniItems.groundwaterOptions['storGroundwaterFossilIni'] != "Maximum": + if iniItems.groundwaterOptions['storGroundwaterFossilIni'] != "Maximum" and\ + self.limitFossilGroundwaterAbstraction and self.limitAbstraction == False: logger.info("The pre-defined initial condition for fossil groundwater is limited by fossilWaterCap (full capacity).") - self.storGroundwaterFossil = pcr.min(self.storGroundwaterFossil, self.fossilWaterCap) - # - if self.limitFossilGroundwaterAbstraction and iniItems.groundwaterOptions['storGroundwaterFossilIni'] == "Maximum": - logger.info("Assuming 'full' fossilWaterCap as the initial condition for fossil groundwater storage.") - self.storGroundwaterFossil = self.fossilWaterCap + self.storGroundwaterFossil = pcr.min(self.storGroundwaterFossil, self.fossilWaterCap) + self.storGroundwaterFossil = pcr.max(0.0, self.storGroundwaterFossil) - # make sure that active storGroundwater and avgAbstraction cannot be negative + # make sure that active storGroundwater, avgAbstraction and avgNonFossilAllocation cannot be negative # self.storGroundwater = pcr.cover( self.storGroundwater,0.0) - self.storGroundwater = pcr.max(0.,self.storGroundwater) + self.storGroundwater = pcr.max(0.,self.storGroundwater) self.storGroundwater = pcr.ifthen(self.landmask,\ self.storGroundwater) # self.avgAbstraction = pcr.cover( self.avgAbstraction,0.0) - self.avgAbstraction = pcr.max(0.,self.avgAbstraction) + self.avgAbstraction = pcr.max(0.,self.avgAbstraction) self.avgAbstraction = pcr.ifthen(self.landmask,\ self.avgAbstraction) - + # + self.avgAllocation = pcr.cover( self.avgAllocation,0.0) + self.avgAllocation = pcr.max(0.,self.avgAllocation) + self.avgAllocation = pcr.ifthen(self.landmask,\ + self.avgAllocation) + # + self.avgAllocationShort = pcr.cover( self.avgAllocationShort,0.0) + self.avgAllocationShort = pcr.max(0.,self.avgAllocationShort) + self.avgAllocationShort = pcr.ifthen(self.landmask,\ + self.avgAllocationShort) + # + self.avgNonFossilAllocation = pcr.cover( self.avgNonFossilAllocation,0.0) + self.avgNonFossilAllocation = pcr.max(0.,self.avgNonFossilAllocation) + self.avgNonFossilAllocation = pcr.ifthen(self.landmask,\ + self.avgNonFossilAllocation) + # + self.avgNonFossilAllocationShort = pcr.cover( self.avgNonFossilAllocationShort,0.0) + self.avgNonFossilAllocationShort = pcr.max(0.,self.avgNonFossilAllocationShort) + self.avgNonFossilAllocationShort = pcr.ifthen(self.landmask,\ + self.avgNonFossilAllocationShort) + + self.relativeGroundwaterHead = pcr.cover(self.relativeGroundwaterHead, 0.0) + self.relativeGroundwaterHead = pcr.ifthen(self.landmask, self.relativeGroundwaterHead) + + self.baseflow = pcr.cover(self.baseflow, 0.0) + self.baseflow = pcr.ifthen(self.landmask, self.baseflow) + # storGroundwaterFossil can be negative (particularly if limitFossilGroundwaterAbstraction == False) + self.storGroundwaterFossil = pcr.cover( self.storGroundwaterFossil, 0.0) self.storGroundwaterFossil = pcr.ifthen(self.landmask,\ self.storGroundwaterFossil) - + def perturb(self, name, **parameters): - + if name == "groundwater": - + # factor for perturbing the initial storGroundwater self.storGroundwater = self.storGroundwater * (mapnormal()*parameters['standard_deviation']+1) self.storGroundwater = pcr.max(0.,self.storGroundwater) @@ -327,128 +559,89 @@ def perturb(self, name, **parameters): def update(self,landSurface,routing,currTimeStep): + if self.useMODFLOW: + self.update_with_MODFLOW(landSurface,routing,currTimeStep) + else: + self.update_without_MODFLOW(landSurface,routing,currTimeStep) + + self.calculate_statistics(routing) + + # old-style reporting + self.old_style_groundwater_reporting(currTimeStep) # TODO: remove this one + + def update_with_MODFLOW(self,landSurface,routing,currTimeStep): + + logger.info("Updating groundwater based on the MODFLOW output.") + + # relativeGroundwaterHead, storGroundwater and baseflow fields are assumed to be constant + self.relativeGroundwaterHead = self.relativeGroundwaterHead + self.storGroundwater = self.storGroundwater + self.baseflow = self.baseflow + + if currTimeStep.day == 1 and currTimeStep.timeStepPCR > 1: + + # for online coupling, we will read files from pcraster maps, using the previous day values + directory = self.iniItems.main_output_directory + "/modflow/transient/maps/" + yesterday = str(currTimeStep.yesterday()) + + # - relative groundwater head from MODFLOW + filename = directory + "relativeGroundwaterHead_" + str(yesterday) + ".map" + self.relativeGroundwaterHead = pcr.ifthen(self.landmask, pcr.cover(vos.readPCRmapClone(filename, self.cloneMap, self.tmpDir), 0.0)) + + # - storGroundwater from MODFLOW + filename = directory + "storGroundwater_" + str(yesterday) + ".map" + self.storGroundwater = pcr.ifthen(self.landmask, pcr.cover(vos.readPCRmapClone(filename, self.cloneMap, self.tmpDir), 0.0)) + + # - baseflow from MODFLOW + filename = directory + "baseflow_" + str(yesterday) + ".map" + self.baseflow = pcr.ifthen(self.landmask, pcr.cover(vos.readPCRmapClone(filename, self.cloneMap, self.tmpDir), 0.0)) + + # river bed exchange has been accomodated in baseflow (via MODFLOW, river and drain packages) + self.surfaceWaterInf = pcr.scalar(0.0) + + # non fossil groundwater abstraction + self.nonFossilGroundwaterAbs = landSurface.nonFossilGroundwaterAbs + + # fossil groundwater abstraction (must be zero): + self.fossilGroundwaterAbstr = landSurface.fossilGroundwaterAbstr + + # groundwater allocation (Note: This is done in the landSurface module) + self.allocNonFossilGroundwater = landSurface.allocNonFossilGroundwater + self.fossilGroundwaterAlloc = landSurface.fossilGroundwaterAlloc + + # groundwater allocation (Note: This is done in the landSurface module) + self.allocNonFossilGroundwater = landSurface.allocNonFossilGroundwater + self.fossilGroundwaterAlloc = landSurface.fossilGroundwaterAlloc + + # Note: The following variable (unmetDemand) is a bad name and used in the past. + # Its definition is actually as follows: (the amount of demand that is satisfied/allocated from fossil groundwater) + # + self.unmetDemand = self.fossilGroundwaterAlloc + + + def update_without_MODFLOW(self,landSurface,routing,currTimeStep): + + logger.info("Updating groundwater") + if self.debugWaterBalance: preStorGroundwater = self.storGroundwater preStorGroundwaterFossil = self.storGroundwaterFossil - + # get riverbed infiltration from the previous time step (from routing) - self.surfaceWaterInf = routing.riverbedExchange/routing.cellArea # m + self.surfaceWaterInf = routing.riverbedExchange/\ + routing.cellArea # unit: m self.storGroundwater += self.surfaceWaterInf # get net recharge (percolation-capRise) and update storage: self.storGroundwater = pcr.max(0.,\ - self.storGroundwater + landSurface.gwRecharge) - - # potential groundwater abstraction (unit: m) - potGroundwaterAbstract = landSurface.totalPotentialGrossDemand -\ - landSurface.allocSurfaceWaterAbstract - - - if self.usingAllocSegments == False or self.limitAbstraction: - - # Note: For simplicity, no network for a run with limitAbstraction. - - logger.info("Groundwater abstraction is only to satisfy local demand. No network for distributing groundwater.") - - # nonFossil groundwater abstraction (unit: m) to fulfill water demand - # - assumption: Groundwater is only abstracted to satisfy local demand. - self.nonFossilGroundwaterAbs = \ - pcr.max(0.0, - pcr.min(self.storGroundwater,\ - potGroundwaterAbstract)) - # - self.allocNonFossilGroundwater = self.nonFossilGroundwaterAbs - - if self.usingAllocSegments and self.limitAbstraction == False: - - # Note: Incorporating distribution network of groundwater source is possible only if limitAbstraction = False. - - logger.info("Using groundwater source allocation.") - - # gross/potential demand volume in each cell (unit: m3) - cellVolGrossDemand = potGroundwaterAbstract*routing.cellArea - - # total gross demand volume in each segment/zone (unit: m3) - segTtlGrossDemand = pcr.areatotal(cellVolGrossDemand, self.allocSegments) - - # total available groundwater water volume in each cell - ignore small values (less than 1 m3) - cellAvlGroundwater = pcr.max(0.00, self.storGroundwater* routing.cellArea) - cellAvlGroundwater = pcr.rounddown( cellAvlGroundwater/1.)*1. - - # total available surface water volume in each segment/zone (unit: m3) - segAvlGroundwater = pcr.areatotal(cellAvlGroundwater, self.allocSegments) - segAvlGroundwater = pcr.max(0.00, segAvlGroundwater) - - # total actual surface water abstraction volume in each segment/zone (unit: m3) - # - # - not limited to available water - ignore small values (less than 1 m3) - segActGroundwaterAbs = pcr.max(0.0,\ - pcr.rounddown(segTtlGrossDemand)) - # - # - limited to available water - segActGroundwaterAbs = pcr.min(segAvlGroundwater, segActGroundwaterAbs) - - # actual surface water abstraction volume in each cell (unit: m3) - volActGroundwaterAbstract = vos.getValDivZero(\ - cellAvlGroundwater, segAvlGroundwater, vos.smallNumber) * \ - segActGroundwaterAbs - volActGroundwaterAbstract = pcr.min(cellAvlGroundwater , volActGroundwaterAbstract) # unit: m3 - - # actual non fossil groundwater abstraction volume in meter (unit: m) - self.nonFossilGroundwaterAbs = pcr.ifthen(self.landmask, volActGroundwaterAbstract) /\ - routing.cellArea # unit: m - - # allocation non fossil groundwater abstraction volume to each cell (unit: m3) - self.volAllocGroundwaterAbstract = vos.getValDivZero(\ - cellVolGrossDemand, segTtlGrossDemand, vos.smallNumber) *\ - segActGroundwaterAbs # unit: m3 - - # allocation surface water abstraction in meter (unit: m) - self.allocNonFossilGroundwater = pcr.ifthen(self.landmask, self.volAllocGroundwaterAbstract)/\ - routing.cellArea # unit: m - - if self.debugWaterBalance == str('True'): - - abstraction = pcr.cover(pcr.areatotal(self.nonFossilGroundwaterAbs *routing.cellArea, self.allocSegments)/self.segmentArea, 0.0) - allocation = pcr.cover(pcr.areatotal(self.allocNonFossilGroundwater*routing.cellArea, self.allocSegments)/self.segmentArea, 0.0) - - vos.waterBalanceCheck([abstraction],\ - [allocation],\ - [pcr.scalar(0.0)],\ - [pcr.scalar(0.0)],\ - 'non fossil groundwater abstraction - allocation per zone/segment (PS: Error here may be caused by rounding error.)' ,\ - True,\ - "",threshold=5e-4) - - # update storGoundwater after self.nonFossilGroundwaterAbs - self.storGroundwater = pcr.max(0.,self.storGroundwater - self.nonFossilGroundwaterAbs) - - # unmetDemand (m), satisfied by fossil gwAbstractions # TODO: Include desalinization - self.unmetDemand = pcr.max(0.0, - potGroundwaterAbstract - \ - self.allocNonFossilGroundwater) # m (equal to zero if limitAbstraction = True) - - if self.limitAbstraction: - logger.info("No fossil groundwater abstraction is allowed") - # TODO: check that self.unmetDemand = 0.0 - - # correcting unmetDemand with available fossil groundwater - # Note: For simplicity, limitFossilGroundwaterAbstraction can only be combined with local source assumption - if self.usingAllocSegments == False and self.limitFossilGroundwaterAbstraction: - self.unmetDemand = pcr.min(pcr.max(0.0, self.storGroundwaterFossil), self.unmetDemand) - - # calculate the average groundwater abstraction (m/day) from the last 365 days: - totalAbstraction = self.unmetDemand + self.nonFossilGroundwaterAbs - deltaAbstraction = totalAbstraction - self.avgAbstraction - self.avgAbstraction = self.avgAbstraction +\ - deltaAbstraction/\ - pcr.min(365., pcr.max(1.0, routing.timestepsToAvgDischarge)) - self.avgAbstraction = pcr.max(0.0, self.avgAbstraction) + self.storGroundwater + landSurface.gwRecharge) - # update storGroundwaterFossil after unmetDemand - self.storGroundwaterFossil -= self.unmetDemand - - # calculate baseflow and update storage: + # non fossil groundwater abstraction + self.nonFossilGroundwaterAbs = landSurface.nonFossilGroundwaterAbs + self.storGroundwater = pcr.max(0.,\ + self.storGroundwater - self.nonFossilGroundwaterAbs) + + # baseflow self.baseflow = pcr.max(0.,\ pcr.min(self.storGroundwater,\ self.recessionCoeff* \ @@ -457,6 +650,25 @@ def update(self,landSurface,routing,currTimeStep): self.storGroundwater - self.baseflow) # PS: baseflow must be calculated at the end (to ensure the availability of storGroundwater to support nonFossilGroundwaterAbs) + # fossil groundwater abstraction: + self.fossilGroundwaterAbstr = landSurface.fossilGroundwaterAbstr + self.storGroundwaterFossil -= self.fossilGroundwaterAbstr + + # fossil groundwater cannot be negative if limitFossilGroundwaterAbstraction is used + if self.limitFossilGroundwaterAbstraction: + self.storGroundwaterFossil = pcr.max(0.0, self.storGroundwaterFossil) + + # groundwater allocation (Note: This is done in the landSurface module) + self.allocNonFossilGroundwater = landSurface.allocNonFossilGroundwater + self.fossilGroundwaterAlloc = landSurface.fossilGroundwaterAlloc + + # Note: The following variable (unmetDemand) is a bad name and used in the past. + # Its definition is actually as follows: (the amount of demand that is satisfied/allocated from fossil groundwater) + self.unmetDemand = self.fossilGroundwaterAlloc + + # calculate relative groundwater head above the minimum level (unit: m) + # - needed to estimate areas influenced by capillary rise + self.relativeGroundwaterHead = self.storGroundwater/self.specificYield if self.debugWaterBalance: vos.waterBalanceCheck([self.surfaceWaterInf,\ @@ -471,40 +683,65 @@ def update(self,landSurface,routing,currTimeStep): if self.debugWaterBalance: vos.waterBalanceCheck([pcr.scalar(0.0)],\ - [self.unmetDemand],\ + [self.fossilGroundwaterAbstr],\ [ preStorGroundwaterFossil],\ [self.storGroundwaterFossil],\ 'storGroundwaterFossil',\ True,\ currTimeStep.fulldate,threshold=1e-3) - if self.debugWaterBalance and self.limitFossilGroundwaterAbstraction: - vos.waterBalanceCheck([pcr.scalar(0.0)],\ - [self.unmetDemand],\ - [pcr.max(0.0, preStorGroundwaterFossil)],\ - [pcr.max(0.0,self.storGroundwaterFossil)],\ - 'storGroundwaterFossil (with limitFossilGroundwaterAbstraction)',\ - True,\ - currTimeStep.fulldate,threshold=1e-3) - - if self.debugWaterBalance and landSurface.limitAbstraction: - vos.waterBalanceCheck([potGroundwaterAbstract],\ - [self.nonFossilGroundwaterAbs],\ - [pcr.scalar(0.)],\ - [pcr.scalar(0.)],\ - 'non fossil groundwater abstraction',\ - True,\ - currTimeStep.fulldate,threshold=1e-4) - if self.debugWaterBalance: - vos.waterBalanceCheck([self.unmetDemand, self.allocNonFossilGroundwater, landSurface.allocSurfaceWaterAbstract],\ + vos.waterBalanceCheck([landSurface.desalinationAllocation,\ + self.unmetDemand, \ + self.allocNonFossilGroundwater, \ + landSurface.allocSurfaceWaterAbstract],\ [landSurface.totalPotentialGrossDemand],\ [pcr.scalar(0.)],\ [pcr.scalar(0.)],\ - 'water demand allocation (from surface water, groundwater and unmetDemand)',\ + 'demand allocation (desalination, surface water, groundwater & unmetDemand. Error here may be due to rounding error.',\ True,\ - currTimeStep.fulldate,threshold=1e-4) + currTimeStep.fulldate,threshold=1e-3) + def calculate_statistics(self, routing): + + # calculate the average total groundwater abstraction (m/day) from the last 365 days: + totalAbstraction = self.fossilGroundwaterAbstr + self.nonFossilGroundwaterAbs + deltaAbstraction = totalAbstraction - self.avgAbstraction + self.avgAbstraction = self.avgAbstraction +\ + deltaAbstraction/\ + pcr.min(365., pcr.max(1.0, routing.timestepsToAvgDischarge)) + self.avgAbstraction = pcr.max(0.0, self.avgAbstraction) + + # calculate the average non fossil groundwater allocation (m/day) + # - from the last 365 days: + deltaAllocation = self.allocNonFossilGroundwater - self.avgNonFossilAllocation + self.avgNonFossilAllocation = self.avgNonFossilAllocation +\ + deltaAllocation/\ + pcr.min(365., pcr.max(1.0, routing.timestepsToAvgDischarge)) + self.avgNonFossilAllocation = pcr.max(0.0, self.avgNonFossilAllocation) + # - from the last 7 days: + deltaAllocationShort = self.allocNonFossilGroundwater - self.avgNonFossilAllocationShort + self.avgNonFossilAllocationShort = self.avgNonFossilAllocationShort +\ + deltaAllocationShort/\ + pcr.min(7., pcr.max(1.0, routing.timestepsToAvgDischarge)) + self.avgNonFossilAllocationShort = pcr.max(0.0, self.avgNonFossilAllocationShort) + + # calculate the average total (fossil + non fossil) groundwater allocation (m/day) + totalGroundwaterAllocation = self.allocNonFossilGroundwater + self.fossilGroundwaterAlloc + # - from the last 365 days: + deltaAllocation = totalGroundwaterAllocation - self.avgAllocation + self.avgAllocation = self.avgAllocation +\ + deltaAllocation/\ + pcr.min(365., pcr.max(1.0, routing.timestepsToAvgDischarge)) + self.avgAllocation = pcr.max(0.0, self.avgAllocation) + # - from the last 7 days: + deltaAllocationShort = totalGroundwaterAllocation - self.avgAllocationShort + self.avgAllocationShort = self.avgAllocationShort +\ + deltaAllocationShort/\ + pcr.min(7., pcr.max(1.0, routing.timestepsToAvgDischarge)) + self.avgAllocationShort = pcr.max(0.0, self.avgAllocationShort) + + def old_style_groundwater_reporting(self,currTimeStep): if self.report == True: timeStamp = datetime.datetime(currTimeStep.year,\ @@ -536,7 +773,7 @@ def update(self,landSurface,routing,currTimeStep): vars(self)[var+'MonthTot'] += vars(self)[var] # reporting at the end of the month: - if currTimeStep.endMonth == True: + if currTimeStep.endMonth == True: self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_monthTot.nc",\ var,\ @@ -545,8 +782,8 @@ def update(self,landSurface,routing,currTimeStep): # -average if self.outMonthAvgNC[0] != "None": for var in self.outMonthAvgNC: - # only if a accumulator variable has not been defined: - if var not in self.outMonthTotNC: + # only if a accumulator variable has not been defined: + if var not in self.outMonthTotNC: # introduce accumulator at the beginning of simulation or # reset accumulator at the beginning of the month @@ -559,7 +796,7 @@ def update(self,landSurface,routing,currTimeStep): # calculating average & reporting at the end of the month: if currTimeStep.endMonth == True: vars(self)[var+'MonthAvg'] = vars(self)[var+'MonthTot']/\ - currTimeStep.day + currTimeStep.day self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_monthAvg.nc",\ var,\ @@ -570,7 +807,7 @@ def update(self,landSurface,routing,currTimeStep): if self.outMonthEndNC[0] != "None": for var in self.outMonthEndNC: # reporting at the end of the month: - if currTimeStep.endMonth == True: + if currTimeStep.endMonth == True: self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_monthEnd.nc",\ var,\ @@ -592,7 +829,7 @@ def update(self,landSurface,routing,currTimeStep): vars(self)[var+'AnnuaTot'] += vars(self)[var] # reporting at the end of the year: - if currTimeStep.endYear == True: + if currTimeStep.endYear == True: self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_annuaTot.nc",\ var,\ @@ -601,8 +838,8 @@ def update(self,landSurface,routing,currTimeStep): # -average if self.outAnnuaAvgNC[0] != "None": for var in self.outAnnuaAvgNC: - # only if a accumulator variable has not been defined: - if var not in self.outAnnuaTotNC: + # only if a accumulator variable has not been defined: + if var not in self.outAnnuaTotNC: # introduce accumulator at the beginning of simulation or # reset accumulator at the beginning of the year if currTimeStep.timeStepPCR == 1 or \ @@ -614,7 +851,7 @@ def update(self,landSurface,routing,currTimeStep): # calculating average & reporting at the end of the year: if currTimeStep.endYear == True: vars(self)[var+'AnnuaAvg'] = vars(self)[var+'AnnuaTot']/\ - currTimeStep.doy + currTimeStep.doy self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_annuaAvg.nc",\ var,\ @@ -625,7 +862,7 @@ def update(self,landSurface,routing,currTimeStep): if self.outAnnuaEndNC[0] != "None": for var in self.outAnnuaEndNC: # reporting at the end of the year: - if currTimeStep.endYear == True: + if currTimeStep.endYear == True: self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_annuaEnd.nc",\ var,\ diff --git a/model/landCover.py b/model/landCover.py old mode 100755 new mode 100644 index 4c3abd777..151aedc16 --- a/model/landCover.py +++ b/model/landCover.py @@ -1,7 +1,29 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import re +import types import netCDF4 as nc import pcraster as pcr @@ -14,7 +36,7 @@ class LandCover(object): - def __init__(self,iniItems,nameOfSectionInIniFile,parameters,landmask,usingAllocSegments = False): + def __init__(self,iniItems,nameOfSectionInIniFile,soil_and_topo_parameters,landmask,irrigationEfficiency,usingAllocSegments = False): object.__init__(self) self.cloneMap = iniItems.cloneMap @@ -22,14 +44,88 @@ def __init__(self,iniItems,nameOfSectionInIniFile,parameters,landmask,usingAlloc self.inputDir = iniItems.globalOptions['inputDir'] self.landmask = landmask - # limitAbstraction - self.limitAbstraction = False - if iniItems.landSurfaceOptions['limitAbstraction'] == "True": self.limitAbstraction = True + # number of soil layers: + self.numberOfSoilLayers = int(iniItems.landSurfaceOptions['numberOfUpperSoilLayers']) + + # soil and topo parameters + self.parameters = soil_and_topo_parameters # configuration for a certain land cover type self.iniItemsLC = iniItems.__getattribute__(nameOfSectionInIniFile) self.name = self.iniItemsLC['name'] - self.debugWaterBalance = self.iniItemsLC['debugWaterBalance'] + + # limitAbstraction + self.limitAbstraction = False + if iniItems.landSurfaceOptions['limitAbstraction'] == "True": self.limitAbstraction = True + + # if using MODFLOW, limitAbstraction must be True (the abstraction cannot exceed storGroundwater) + if "useMODFLOW" in iniItems.groundwaterOptions.keys(): + if iniItems.groundwaterOptions["useMODFLOW"] == "True": self.limitAbstraction = True + + # includeIrrigation + self.includeIrrigation = False + if iniItems.landSurfaceOptions['includeIrrigation'] == "True": self.includeIrrigation = True + + # irrigation efficiency map (dimensionless) + self.irrigationEfficiency = irrigationEfficiency + + # interception module type + # - "Original" is principally the same as defined in van Beek et al., 2014 (default) + # - "Modified" is with a modification by Edwin Sutanudjaja: extending interception definition, using totalPotET for the available energy + self.interceptionModuleType = "Original" + if "interceptionModuleType" in self.iniItemsLC.keys(): + if self.iniItemsLC['interceptionModuleType'] == "Modified": + msg = 'Using the "Modified" version of the interception module (i.e. extending interception definition, using totalPotET for the available energy for the interception process).' + logger.info(msg) + self.interceptionModuleType = "Modified" + else: + if self.iniItemsLC['interceptionModuleType'] != "Original": + msg = 'The interceptionModuleType '+self.iniItemsLC['interceptionModuleType']+' is NOT known.' + logger.info(msg) + msg = 'The "Original" interceptionModuleType is used.' + logger.info(msg) + + # minimum interception capacity (only used if interceptionModuleType == "Modified", extended interception definition) + self.minInterceptCap = 0.0 + if self.interceptionModuleType == "Original" and "minInterceptCap" in self.iniItemsLC.keys(): + msg = 'As the "Original" interceptionModuleType is used, the "minInterceptCap" value is ignored. The interception scope is only "canopy".' + logger.warning(msg) + if self.interceptionModuleType == "Modified": + self.minInterceptCap = vos.readPCRmapClone(self.iniItemsLC['minInterceptCap'], self.cloneMap, + self.tmpDir, self.inputDir) + + # option to assume surface water as the first priority/alternative for water source (not used) + self.surfaceWaterPiority = False + + # option to activate water balance check + self.debugWaterBalance = True + if self.iniItemsLC['debugWaterBalance'] == "False": self.debugWaterBalance = False + + # Improved Arno Scheme's method: + # - In the "Original" work of van Beek et al., 2011 there is no "directRunoff reduction" + # - However, later (20 April 2011), Rens van Beek introduce this reduction, particularly to maintain soil saturation. This is currently the "Default" method. + self.improvedArnoSchemeMethod = "Default" + if "improvedArnoSchemeMethod" in iniItems.landSurfaceOptions.keys(): + self.improvedArnoSchemeMethod = iniItems.landSurfaceOptions['improvedArnoSchemeMethod'] + if self.improvedArnoSchemeMethod == "Original": logger.warning("Using the old/original approach of Improved Arno Scheme. No reduction for directRunoff.") + + # In the original oldcalc script of Rens (2 layer model), the percolation percUpp (P1) can be negative + # - To avoid this, Edwin changed few lines (see the method updateSoilStates) + self.allowNegativePercolation = False + if 'allowNegativePercolation' in self.iniItemsLC.keys() and self.iniItemsLC['allowNegativePercolation'] == "True": + msg = 'Allowing negative values of percolation percUpp (P1), as done in the oldcalc script of PCR-GLOBWB 1.0. \n' + msg += 'Note that this option is only relevant for the two layer soil model.' + logger.warning(msg) + self.allowNegativePercolation = True + + # In the original oldcalc script of Rens, there is a possibility that rootFraction/transpiration is only defined in the bottom layer, while no root in upper layer(s) + # - To avoid this, Edwin changed few lines (see the methods 'scaleRootFractionsFromTwoLayerSoilParameters' and 'estimateTranspirationAndBareSoilEvap') + self.usingOriginalOldCalcRootTranspirationPartitioningMethod = False + if 'usingOriginalOldCalcRootTranspirationPartitioningMethod' in self.iniItemsLC.keys() and self.iniItemsLC['usingOriginalOldCalcRootTranspirationPartitioningMethod'] == "True": + msg = 'Using the original rootFraction/transpiration as defined in the oldcalc script of PCR-GLOBWB 1.0. \n' + msg += 'There is a possibility that rootFraction/transpiration is only defined in the bottom layer, while no root in upper layer(s).' + logger.warning(msg) + self.usingOriginalOldCalcRootTranspirationPartitioningMethod = True # get snow module type and its parameters: self.snowModuleType = self.iniItemsLC['snowModuleType'] @@ -41,110 +137,102 @@ def __init__(self,iniItems,nameOfSectionInIniFile,parameters,landmask,usingAlloc input = self.iniItemsLC[str(var)] vars(self)[var] = vos.readPCRmapClone(input,self.cloneMap, self.tmpDir,self.inputDir) + vars(self)[var] = pcr.spatial(pcr.scalar(vars(self)[var])) + - # get landCovParams that are fixed for the entire simulation: - landCovParams = ['minSoilDepthFrac','maxSoilDepthFrac', - 'rootFraction1','rootFraction2', - 'maxRootDepth', - 'fracVegCover'] - if self.iniItemsLC['landCoverMapsNC'] == str(None): - for var in landCovParams: - input = self.iniItemsLC[str(var)] - vars(self)[var] = vos.readPCRmapClone(input,self.cloneMap, - self.tmpDir,self.inputDir) - if input != "None":\ - vars(self)[var] = pcr.cover(vars(self)[var],0.0) - else: - landCoverPropertiesNC = vos.getFullPath(\ - self.iniItemsLC['landCoverMapsNC'],\ - self.inputDir) - for var in landCovParams: - vars(self)[var] = vos.netcdf2PCRobjCloneWithoutTime(\ - landCoverPropertiesNC,var, \ - cloneMapFileName = self.cloneMap) - vars(self)[var] = pcr.cover(vars(self)[var], 0.0) - - # avoid small values (in order to avoid rounding error) - self.fracVegCover = pcr.cover(self.fracVegCover, 0.0) - self.fracVegCover = pcr.rounddown(self.fracVegCover * 1000.)/1000. + # initialization some variables + self.fractionArea = None # area (m2) of a certain land cover type ; will be assigned by the landSurface module + self.naturalFracVegCover = None # fraction (-) of natural area over (entire) cell ; will be assigned by the landSurface module + self.irrTypeFracOverIrr = None # fraction (m2) of a certain irrigation type over (only) total irrigation area ; will be assigned by the landSurface module - # limit 0.0 <= fracVegCover <= 1.0 - self.fracVegCover = pcr.max(0.0,self.fracVegCover) - self.fracVegCover = pcr.min(1.0,self.fracVegCover) + # previous fractions of land cover (needed for transfering states when land cover fraction (annualy) changes + self.previousFracVegCover = None - self.fractionArea = None # area (m2) of a certain land cover type ; will be assigned by the landSurface module - self.naturalFracVegCover = None # fraction (-) of natural area over (entire) cell ; will be assigned by the landSurface module - self.irrTypeFracOverIrr = None # fraction (m2) of a certain irrigation type over (only) total irrigation area ; will be assigned by the landSurface module + # number of soil layers (two or three) + self.numberOfLayers = self.parameters.numberOfLayers - # previous fractions of land cover (needed while land cover changes ; for transfering fluxes) - self.previousFracVegCover = None + # an option to introduce changes of land cover parameters (not only fracVegCover) + self.noAnnualChangesInLandCoverParameter = True + if 'annualChangesInLandCoverParameters' in iniItems.landSurfaceOptions.keys(): + if iniItems.landSurfaceOptions['annualChangesInLandCoverParameters'] == "True": self.noAnnualChangesInLandCoverParameter = False - cellArea = vos.readPCRmapClone(\ - iniItems.routingOptions['cellAreaMap'], - self.cloneMap,self.tmpDir,self.inputDir) - cellArea = pcr.ifthen(self.landmask, cellArea) # TODO: integrate this one with the one coming from the routing module + # get land cover parameters that are fixed for the entire simulation + if self.noAnnualChangesInLandCoverParameter: + if self.numberOfLayers == 2: + self.fracVegCover, self.arnoBeta, self.rootZoneWaterStorageMin, self.rootZoneWaterStorageRange, \ + self.maxRootDepth, self.adjRootFrUpp, self.adjRootFrLow = \ + self.get_land_cover_parameters() + if self.numberOfLayers == 3: + self.fracVegCover, self.arnoBeta, self.rootZoneWaterStorageMin, self.rootZoneWaterStorageRange, \ + self.maxRootDepth, self.adjRootFrUpp000005, self.adjRootFrUpp005030, self.adjRootFrLow030150 = \ + self.get_land_cover_parameters() + # estimate parameters while transpiration is being halved + self.calculateParametersAtHalfTranspiration() + # calculate TAW for estimating irrigation gross demand + if self.includeIrrigation: self.calculateTotAvlWaterCapacityInRootZone() + + # get additional land cover parameters (ALWAYS fixed for the entire simulation) + landCovParamsAdd = ['minTopWaterLayer', + 'minCropKC'] + for var in landCovParamsAdd: + input = self.iniItemsLC[str(var)] + vars(self)[var] = vos.readPCRmapClone(input,self.cloneMap, + self.tmpDir,self.inputDir) + if input != "None":\ + vars(self)[var] = pcr.cover(vars(self)[var],0.0) - # irrigation / water allocation zones: + # get additional parameter(s) for irrigation areas (ALWAYS fixed for the entire simulation) + if self.includeIrrigation: + # - cropDeplFactor (dimesionless, crop depletion factor while irrigation is being applied), needed for NON paddy irrigation areas + if self.iniItemsLC['name'].startswith('irr') and self.name != "irrPaddy": + self.cropDeplFactor = vos.readPCRmapClone(self.iniItemsLC['cropDeplFactor'], self.cloneMap, \ + self.tmpDir, self.inputDir) + # - infiltration/percolation losses for paddy fields + if self.name == 'irrPaddy' or self.name == 'irr_paddy':\ + self.design_percolation_loss = self.estimate_paddy_infiltration_loss(self.iniItemsLC) + + # water allocation zones: self.usingAllocSegments = usingAllocSegments # water allocation option: if self.usingAllocSegments: + + # cellArea (unit: m2) # TODO: If possible, integrate this one with the one coming from the routing module + cellArea = vos.readPCRmapClone(\ + iniItems.routingOptions['cellAreaMap'], + self.cloneMap, self.tmpDir, self.inputDir) + cellArea = pcr.ifthen(self.landmask, cellArea) self.allocSegments = vos.readPCRmapClone(\ iniItems.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'], self.cloneMap,self.tmpDir,self.inputDir,isLddMap=False,cover=None,isNomMap=True) self.allocSegments = pcr.ifthen(self.landmask, self.allocSegments) - + #~ self.allocSegments = pcr.clump(self.allocSegments) # According to Menno, "clump" is NOT recommended. - + self.segmentArea = pcr.areatotal(pcr.cover(cellArea, 0.0), self.allocSegments) self.segmentArea = pcr.ifthen(self.landmask, self.segmentArea) - landCovParamsAdd = ['arnoBeta', - 'minTopWaterLayer', - 'minCropKC', - 'minInterceptCap'] - for var in landCovParamsAdd: - input = self.iniItemsLC[str(var)] - vars(self)[var] = vos.readPCRmapClone(input,self.cloneMap, - self.tmpDir,self.inputDir) - if input != "None":\ - vars(self)[var] = pcr.cover(vars(self)[var],0.0) - # additional parameter(s) for irrigation Areas: - if self.iniItemsLC['name'].startswith('irr'): - input = self.iniItemsLC['cropDeplFactor'] - vars(self)['cropDeplFactor'] = \ - vos.readPCRmapClone(input,self.cloneMap, - self.tmpDir,self.inputDir) - - # Improved Arno's scheme parameters: - if self.iniItemsLC['arnoBeta'] == "None":\ - self.arnoBeta = pcr.max(0.001,\ - (self.maxSoilDepthFrac-1.)/(1.-self.minSoilDepthFrac)+\ - parameters.orographyBeta-0.01) # Rens's line: BCF[TYPE]= max(0.001,(MAXFRAC[TYPE]-1)/(1-MINFRAC[TYPE])+B_ORO-0.01) - self.arnoBeta = pcr.max(0.001,self.arnoBeta) - self.arnoBeta = pcr.cover(self.arnoBeta, 0.001) - - self.rootZoneWaterStorageMin = self.minSoilDepthFrac * \ - parameters.rootZoneWaterStorageCap - self.rootZoneWaterStorageRange = \ - parameters.rootZoneWaterStorageCap -\ - self.rootZoneWaterStorageMin - - self.numberOfLayers = parameters.numberOfLayers - - self.scaleRootFractions() - self.calculateTotAvlWaterCapacityInRootZone(parameters) - self.calculateParametersAtHalfTranspiration(parameters) - # get the names of cropCoefficient files: - self.cropCoefficientNC = vos.getFullPath(\ - self.iniItemsLC['cropCoefficientNC'],self.inputDir) - - # get the names of interceptCap and coverFraction files: - if not self.iniItemsLC['name'].startswith("irr"): + self.cropCoefficientNC = vos.getFullPath(self.iniItemsLC['cropCoefficientNC'], self.inputDir) + + #~ # get the names of interceptCap and coverFraction files: + #~ if not self.iniItemsLC['name'].startswith("irr"): + #~ self.interceptCapNC = vos.getFullPath(\ + #~ self.iniItemsLC['interceptCapNC'], self.inputDir) + #~ self.coverFractionNC = vos.getFullPath(\ + #~ self.iniItemsLC['coverFractionNC'], self.inputDir) + + # get the file names of interceptCap and coverFraction files: + if 'interceptCapNC' in self.iniItemsLC.keys() and 'coverFractionNC' in self.iniItemsLC.keys(): self.interceptCapNC = vos.getFullPath(\ - self.iniItemsLC['interceptCapNC'],self.inputDir) + self.iniItemsLC['interceptCapNC'], self.inputDir) self.coverFractionNC = vos.getFullPath(\ - self.iniItemsLC['coverFractionNC'],self.inputDir) + self.iniItemsLC['coverFractionNC'], self.inputDir) + else: + msg = 'The netcdf files for interceptCapNC (interception capacity) and/or coverFraction (canopy cover fraction) are NOT defined for the landCover type: ' + self.name + '\n' + msg = 'This run assumes zero canopy interception capacity for this run, UNLESS minInterceptCap (minimum interception capacity) is bigger than zero.' + '\n' + logger.warning(msg) + self.coverFractionNC = None + self.interceptCapNC = None # for reporting: output in netCDF files: self.report = True @@ -203,7 +291,276 @@ def __init__(self,iniItems,nameOfSectionInIniFile,parameters,landmask,usingAlloc var,"undefined") - def scaleRootFractions(self): + def get_land_cover_parameters(self, date_in_string = None, get_only_fracVegCover = False): + + # obtain the land cover parameters + + # list of model parameters that will be read + landCovParams = ['minSoilDepthFrac', 'maxSoilDepthFrac', + 'rootFraction1', 'rootFraction2', + 'maxRootDepth', + 'fracVegCover'] + # - and 'arnoBeta' + + # an option to return only fracVegCover + if get_only_fracVegCover: landCovParams = ['fracVegCover'] + + # set initial values to None + lc_parameters = {} + if get_only_fracVegCover == False: + for var in landCovParams+['arnoBeta']: lc_parameters[var] = None + + # get parameters that are fixed for the entire simulation: + if date_in_string == None: + + msg = 'Obtaining the land cover parameters that are fixed for the entire simulation.' + logger.debug(msg) + + if self.iniItemsLC['landCoverMapsNC'] == str(None): + # using pcraster maps + landCoverPropertiesNC = None + for var in landCovParams: + input = self.iniItemsLC[str(var)] + lc_parameters[var] = vos.readPCRmapClone(input, self.cloneMap, + self.tmpDir, self.inputDir) + if input != "None": + lc_parameters[var] = pcr.cover(lc_parameters[var], 0.0) + else: + # using netcdf file + landCoverPropertiesNC = vos.getFullPath(\ + self.iniItemsLC['landCoverMapsNC'], self.inputDir) + for var in landCovParams: + lc_parameters[var] = pcr.cover(vos.netcdf2PCRobjCloneWithoutTime(\ + landCoverPropertiesNC, var, \ + cloneMapFileName = self.cloneMap), 0.0) + + # The parameter arnoBeta for the Improved Arno's scheme: + # - There are three ways in defining arnoBeta. The ranks below indicate their priority: + # 1. defined as a pcraster map file or a uniform scalar value (i.e. self.iniItemsLC['arnoBeta']) + # 2. included in the netcdf file (i.e. self.iniItemsLC['landCoverMapsNC']) + # 3. approximated from the minSoilDepthFrac and maxSoilDepthFrac + + lc_parameters['arnoBeta'] = None + if 'arnoBeta' not in self.iniItemsLC.keys() and get_only_fracVegCover == False: self.iniItemsLC['arnoBeta'] = "None" + + # - option one (top priority): using a pcraster file + if self.iniItemsLC['arnoBeta'] != "None" and get_only_fracVegCover == False: + + logger.debug("The parameter arnoBeta: "+str(self.iniItemsLC['arnoBeta'])) + lc_parameters['arnoBeta'] = vos.readPCRmapClone(self.iniItemsLC['arnoBeta'], self.cloneMap,\ + self.tmpDir, self.inputDir) + + # - option two: included in the netcdf file + if isinstance(lc_parameters['arnoBeta'], types.NoneType) and landCoverPropertiesNC != None and get_only_fracVegCover == False: + + if vos.checkVariableInNC(landCoverPropertiesNC, "arnoBeta"): + + logger.debug("The parameter arnoBeta is defined in the netcdf file "+str(self.iniItemsLC['arnoBeta'])) + lc_parameters['arnoBeta'] = vos.netcdf2PCRobjCloneWithoutTime(landCoverPropertiesNC, 'arnoBeta', self.cloneMap) + + # - option three: approximated from the minSoilDepthFrac and maxSoilDepthFrac + if isinstance(lc_parameters['arnoBeta'], types.NoneType) and get_only_fracVegCover == False: + + logger.debug("The parameter arnoBeta is approximated from the minSoilDepthFrac and maxSoilDepthFrac values.") + + # make sure that maxSoilDepthFrac >= minSoilDepthFrac: + # - Note that maxSoilDepthFrac is needed only for calculating arnoBeta, + # while minSoilDepthFrac is needed not only for arnoBeta, but also for rootZoneWaterStorageMin + lc_parameters['maxSoilDepthFrac'] = pcr.max(lc_parameters['maxSoilDepthFrac'], lc_parameters['minSoilDepthFrac']) + + # estimating arnoBeta from the values of maxSoilDepthFrac and minSoilDepthFrac. + lc_parameters['arnoBeta'] = pcr.max(0.001,\ + (lc_parameters['maxSoilDepthFrac']-1.)/(1.-lc_parameters['minSoilDepthFrac'])+\ + self.parameters.orographyBeta-0.01) # Rens's line: BCF[TYPE]= max(0.001,(MAXFRAC[TYPE]-1)/(1-MINFRAC[TYPE])+B_ORO-0.01) + + + # get landCovParams that (annualy) changes + # - files provided in netcdf files + if date_in_string != None: + + msg = 'Obtaining the land cover parameters (from netcdf files) for the year/date: '+str(date_in_string) + logger.debug(msg) + + if get_only_fracVegCover: + landCovParams = ['fracVegCover'] + else: + landCovParams += ['arnoBeta'] + + for var in landCovParams: + + # read parameter values from the ncFile mentioned in the ini/configuration file + ini_option = self.iniItemsLC[var+'NC'] + + if ini_option.endswith(vos.netcdf_suffixes): + netcdf_file = vos.getFullPath(ini_option, self.inputDir) + lc_parameters[var] = pcr.cover( + vos.netcdf2PCRobjClone(netcdf_file,var, \ + date_in_string, useDoy = 'yearly',\ + cloneMapFileName = self.cloneMap), 0.0) + else: + # reading parameters from pcraster maps or scalar values + try: + lc_parameters[var] = pcr.cover( + pcr.spatial( + vos.readPCRmapClone(ini_option, self.cloneMap,\ + self.tmpDir, self.inputDir)), 0.0) + except: + lc_parameters[var] = vos.readPCRmapClone(ini_option, self.cloneMap,\ + self.tmpDir, self.inputDir) + + # if not defined, arnoBeta would be approximated from the minSoilDepthFrac and maxSoilDepthFrac + if get_only_fracVegCover == False and\ + isinstance(lc_parameters['arnoBeta'], types.NoneType): + + logger.debug("The parameter arnoBeta is approximated from the minSoilDepthFrac and maxSoilDepthFrac values.") + + # make sure that maxSoilDepthFrac >= minSoilDepthFrac: + # - Note that maxSoilDepthFrac is needed only for calculating arnoBeta, + # while minSoilDepthFrac is needed not only for arnoBeta, but also for rootZoneWaterStorageMin + lc_parameters['maxSoilDepthFrac'] = pcr.max(lc_parameters['maxSoilDepthFrac'], lc_parameters['minSoilDepthFrac']) + + # estimating arnoBeta from the values of maxSoilDepthFrac and minSoilDepthFrac + lc_parameters['arnoBeta'] = pcr.max(0.001,\ + (lc_parameters['maxSoilDepthFrac']-1.)/(1.-lc_parameters['minSoilDepthFrac'])+\ + self.parameters.orographyBeta-0.01) # Rens's line: BCF[TYPE]= max(0.001,(MAXFRAC[TYPE]-1)/(1-MINFRAC[TYPE])+B_ORO-0.01) + + # limit 0.0 <= fracVegCover <= 1.0 + fracVegCover = pcr.cover(lc_parameters['fracVegCover'], 0.0) + fracVegCover = pcr.max(0.0, fracVegCover) + fracVegCover = pcr.min(1.0, fracVegCover) + + if get_only_fracVegCover: + return pcr.ifthen(self.landmask, fracVegCover) + + + # WMIN (unit: m): minimum local soil water capacity within the grid-cell + rootZoneWaterStorageMin = lc_parameters['minSoilDepthFrac'] * \ + self.parameters.rootZoneWaterStorageCap # This is WMIN in the oldcalc script. + + # WMAX - WMIN (unit: m) + rootZoneWaterStorageRange = \ + self.parameters.rootZoneWaterStorageCap -\ + rootZoneWaterStorageMin + + # the parameter arnoBeta (dimensionless) + arnoBeta = pcr.max(0.001, lc_parameters['arnoBeta']) + arnoBeta = pcr.cover(arnoBeta, 0.001) + + # maxium root depth + maxRootDepth = lc_parameters['maxRootDepth'] + + # saving also minSoilDepthFrac and maxSoilDepthFrac (only for debugging purpose) + self.minSoilDepthFrac = lc_parameters['minSoilDepthFrac'] + self.maxSoilDepthFrac = lc_parameters['maxSoilDepthFrac'] + + # saving also rootFraction1 and rootFraction2 (only for debugging purpose) + self.rootFraction1 = lc_parameters['rootFraction1'] + self.rootFraction2 = lc_parameters['rootFraction2'] + + if self.numberOfLayers == 2 and get_only_fracVegCover == False: + + # scaling root fractions + adjRootFrUpp, adjRootFrLow = \ + self.scaleRootFractionsFromTwoLayerSoilParameters(lc_parameters['rootFraction1'], lc_parameters['rootFraction2']) + + # provide all land cover parameters + return pcr.ifthen(self.landmask, fracVegCover), \ + pcr.ifthen(self.landmask, arnoBeta), \ + pcr.ifthen(self.landmask, rootZoneWaterStorageMin), \ + pcr.ifthen(self.landmask, rootZoneWaterStorageRange), \ + pcr.ifthen(self.landmask, maxRootDepth), \ + pcr.ifthen(self.landmask, adjRootFrUpp), \ + pcr.ifthen(self.landmask, adjRootFrLow) \ + + if self.numberOfLayers == 3 and get_only_fracVegCover == False: + + # scaling root fractions + adjRootFrUpp000005, adjRootFrUpp005030, adjRootFrLow030150 = \ + self.scaleRootFractionsFromTwoLayerSoilParameters(lc_parameters['rootFraction1'], lc_parameters['rootFraction2']) + + # provide all land cover parameters + return pcr.ifthen(self.landmask, fracVegCover), \ + pcr.ifthen(self.landmask, arnoBeta), \ + pcr.ifthen(self.landmask, rootZoneWaterStorageMin), \ + pcr.ifthen(self.landmask, rootZoneWaterStorageRange), \ + pcr.ifthen(self.landmask, maxRootDepth), \ + pcr.ifthen(self.landmask, adjRootFrUpp000005), \ + pcr.ifthen(self.landmask, adjRootFrUpp005030), \ + pcr.ifthen(self.landmask, adjRootFrLow030150) \ + + + def estimate_paddy_infiltration_loss(self, iniPaddyOptions): + + # Due to compaction infiltration/percolation loss rate can be much smaller than original soil saturated conductivity + # - Wada et al. (2014) assume it will be 10 times smaller + if self.numberOfLayers == 2:\ + design_percolation_loss = self.parameters.kSatUpp/10. # unit: m/day + if self.numberOfLayers == 3:\ + design_percolation_loss = self.parameters.kSatUpp000005/10. # unit: m/day + + # However, it can also be much smaller especially in well-puddled paddy fields and should avoid salinization problems. + # - Default minimum and maximum percolation loss values based on FAO values Reference: http://www.fao.org/docrep/s2022e/s2022e08.htm + min_percolation_loss = 0.006 + max_percolation_loss = 0.008 + # - Minimum and maximum percolation loss values given in the ini or configuration file: + if 'minPercolationLoss' in iniPaddyOptions.keys() and iniPaddyOptions['minPercolationLoss'] != "None": + min_percolation_loss = vos.readPCRmapClone(iniPaddyOptions['minPercolationLoss'], self.cloneMap, + self.tmpDir, self.inputDir) + if 'maxPercolationLoss' in iniPaddyOptions.keys() and iniPaddyOptions['maxPercolationLoss'] != "None": + min_percolation_loss = vos.readPCRmapClone(iniPaddyOptions['maxPercolationLoss'], self.cloneMap, + self.tmpDir, self.inputDir) + # - percolation loss at paddy fields (m/day) + design_percolation_loss = pcr.max(min_percolation_loss, \ + pcr.min(max_percolation_loss, design_percolation_loss)) + # - if soil condition is already 'good', we will use its original infiltration/percolation rate + if self.numberOfLayers == 2:\ + design_percolation_loss = pcr.min(self.parameters.kSatUpp , design_percolation_loss) + if self.numberOfLayers == 3:\ + design_percolation_loss = pcr.min(self.parameters.kSatUpp000005, design_percolation_loss) + + # PS: The 'design_percolation_loss' is the maximum loss occuring in paddy fields. + return design_percolation_loss + + def scaleRootFractionsFromTwoLayerSoilParameters(self, rootFraction1, rootFraction2): + + # covering rootFraction1 and rootFraction2 + rootFraction1 = pcr.cover(rootFraction1, 0.0) + rootFraction2 = pcr.cover(rootFraction2, 0.0) + + if self.numberOfLayers == 2: + # root fractions + rootFracUpp = (0.30/0.30) * rootFraction1 + rootFracLow = (1.20/1.20) * rootFraction2 + adjRootFrUpp = vos.getValDivZero(rootFracUpp, (rootFracUpp + rootFracLow)) + adjRootFrLow = vos.getValDivZero(rootFracLow, (rootFracUpp + rootFracLow)) + # RFW1[TYPE]= RFRAC1[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE]); + # RFW2[TYPE]= RFRAC2[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE]); + # if not defined, put everything in the first layer: + if self.usingOriginalOldCalcRootTranspirationPartitioningMethod == False: + adjRootFrUpp = pcr.max(0.0, pcr.min(1.0, pcr.cover(adjRootFrUpp,1.0))) + adjRootFrLow = pcr.max(0.0, pcr.scalar(1.0) - adjRootFrUpp) + + return adjRootFrUpp, adjRootFrLow + + if self.numberOfLayers == 3: + # root fractions + rootFracUpp000005 = 0.05/0.30 * rootFraction1 + rootFracUpp005030 = 0.25/0.30 * rootFraction1 + rootFracLow030150 = 1.20/1.20 * rootFraction2 + adjRootFrUpp000005 = vos.getValDivZero(rootFracUpp000005, (rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150)) + adjRootFrUpp005030 = vos.getValDivZero(rootFracUpp005030, (rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150)) + adjRootFrLow030150 = vos.getValDivZero(rootFracLow030150, (rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150)) + # + # if not defined, put everything in the first layer: + if self.usingOriginalOldCalcRootTranspirationPartitioningMethod == False: + adjRootFrUpp000005 = pcr.max(0.0, pcr.min(1.0, pcr.cover(adjRootFrUpp000005, 1.0))) + adjRootFrUpp005030 = pcr.max(0.0, pcr.ifthenelse(adjRootFrUpp000005 < 1.0, pcr.min(adjRootFrUpp005030, pcr.scalar(1.0) - adjRootFrUpp000005), 0.0)) + adjRootFrLow030150 = pcr.max(0.0, pcr.scalar(1.0) - (adjRootFrUpp000005 + adjRootFrUpp005030)) + + return adjRootFrUpp000005, adjRootFrUpp005030, adjRootFrLow030150 + + + def scaleRootFractionsOLD(self): if self.numberOfLayers == 2: # root fractions @@ -213,8 +570,8 @@ def scaleRootFractions(self): self.adjRootFrLow = rootFracLow / (rootFracUpp + rootFracLow) # RFW1[TYPE]= RFRAC1[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE]); # # RFW2[TYPE]= RFRAC2[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE]); # if not defined, put everything in the first layer: - self.adjRootFrUpp = pcr.cover(self.adjRootFrUpp,1.0) - self.adjRootFrLow = 1.0 - self.adjRootFrUpp + self.adjRootFrUpp = pcr.min(1.0, pcr.cover(self.adjRootFrUpp,1.0)) + self.adjRootFrLow = pcr.scalar(1.0) - self.adjRootFrUpp if self.numberOfLayers == 3: # root fractions @@ -226,68 +583,174 @@ def scaleRootFractions(self): self.adjRootFrLow030150 = rootFracLow030150 / (rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150) # # if not defined, put everything in the first layer: - self.adjRootFrUpp000005 = pcr.cover(self.adjRootFrUpp000005,1.0) + self.adjRootFrUpp000005 = pcr.min(1.0, pcr.cover(self.adjRootFrUpp000005, 1.0)) self.adjRootFrUpp005030 = pcr.ifthenelse(self.adjRootFrUpp000005 < 1.0, self.adjRootFrUpp005030, 0.0) - self.adjRootFrLow030150 = 1.0 - (self.adjRootFrUpp000005 + self.adjRootFrUpp005030) + self.adjRootFrLow030150 = pcr.scalar(1.0) - (self.adjRootFrUpp000005 + self.adjRootFrUpp005030) + + def scaleRootFractionsAlternativeOLD(self): + + if self.numberOfLayers == 2: + # root fractions + rootFracUpp = (0.30/0.30) * self.rootFraction1 + rootFracLow = (1.20/1.20) * self.rootFraction2 + self.adjRootFrUpp = pcr.ifthenelse(rootFracUpp + rootFracLow > 0.0, pcr.min(1.0, rootFracUpp/(rootFracUpp + rootFracLow)), 0.0) + self.adjRootFrLow = pcr.ifthenelse(rootFracUpp + rootFracLow > 0.0, pcr.min(1.0, rootFracLow/(rootFracUpp + rootFracLow)), 0.0) + + # original Rens's line: # weighed root fractions + # RFW1[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0, + # min(1.0,RFRAC1[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + # RFW2[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0.0, + # min(1.0,RFRAC2[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + + if self.numberOfLayers == 3: + # root fractions + rootFracUpp000005 = 0.05/0.30 * self.rootFraction1 + rootFracUpp005030 = 0.25/0.30 * self.rootFraction1 + rootFracLow030150 = 1.20/1.20 * self.rootFraction2 + self.adjRootFrUpp000005 = pcr.ifthenelse(rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150 > 0.0, pcr.min(1.0, rootFracUpp000005/(rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150)), 0.0) + self.adjRootFrUpp005030 = pcr.ifthenelse(rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150 > 0.0, pcr.min(1.0, rootFracUpp005030/(rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150)), 0.0) + self.adjRootFrLow030150 = pcr.ifthenelse(rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150 > 0.0, pcr.min(1.0, rootFracLow030150/(rootFracUpp000005 + rootFracUpp005030 + rootFracLow030150)), 0.0) - def calculateParametersAtHalfTranspiration(self,parameters): + def calculateParametersAtHalfTranspiration(self): # average soil parameters at which actual transpiration is halved if self.numberOfLayers == 2: - self.effSatAt50 = \ - (parameters.storCapUpp * \ + #~ self.effSatAt50 = \ + #~ (self.parameters.storCapUpp * \ + #~ self.adjRootFrUpp * \ + #~ (self.parameters.matricSuction50/self.parameters.airEntryValueUpp)**\ + #~ (-1./self.parameters.poreSizeBetaUpp) +\ + #~ self.parameters.storCapLow * \ + #~ self.adjRootFrLow * \ + #~ (self.parameters.matricSuction50/self.parameters.airEntryValueLow)**\ + #~ (-1./self.parameters.poreSizeBetaLow)) /\ + #~ (self.parameters.storCapUpp*self.adjRootFrUpp +\ + #~ self.parameters.storCapLow*self.adjRootFrLow ) + + #~ self.effPoreSizeBetaAt50 = (\ + #~ self.parameters.storCapUpp*self.adjRootFrUpp*\ + #~ self.parameters.poreSizeBetaUpp +\ + #~ self.parameters.storCapLow*self.adjRootFrLow*\ + #~ self.parameters.poreSizeBetaLow) / (\ + #~ (self.parameters.storCapUpp*self.adjRootFrUpp +\ + #~ self.parameters.storCapLow*self.adjRootFrLow )) + + # Rens's original line (version 1.1): THEFF_50[TYPE]= (SC1[TYPE]*RFW1[TYPE]*(PSI_50/PSI_A1[TYPE])**(-1/BCH1[TYPE]) + + # SC2[TYPE]*RFW2[TYPE]*(PSI_50/PSI_A2[TYPE])**(-1/BCH2[TYPE])) / + # (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]); + # + # Rens's modified line (version 1.2): THEFF_50[TYPE]= if(RFW1[TYPE]+RFW2[TYPE] > 0, + # (SC1[TYPE]*RFW1[TYPE]*(PSI_50/PSI_A1[TYPE])**(-1/BCH1[TYPE])+ + # SC2[TYPE]*RFW2[TYPE]*(PSI_50/PSI_A2[TYPE])**(-1/BCH2[TYPE]))/ + # (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5); + + # Rens's original liner (version 1.1): BCH_50 = (SC1[TYPE]*RFW1[TYPE]*BCH1[TYPE]+SC2[TYPE]*RFW2[TYPE]*BCH2[TYPE])/ + # (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]); + # + # Rens's original lines (version 1.1): BCH_50= if(RFW1[TYPE]+RFW2[TYPE] > 0,(SC1[TYPE]*RFW1[TYPE]*BCH1[TYPE]+SC2[TYPE]*RFW2[TYPE]*BCH2[TYPE])/ + # (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5*(BCH1[TYPE]+BCH2[TYPE])); + + + denominator = (self.parameters.storCapUpp*self.adjRootFrUpp + + self.parameters.storCapLow*self.adjRootFrLow ) + + self.effSatAt50 = pcr.ifthenelse(denominator > 0.0,\ + (self.parameters.storCapUpp * \ self.adjRootFrUpp * \ - (parameters.matricSuction50/parameters.airEntryValueUpp)**\ - (-1./parameters.poreSizeBetaUpp) +\ - parameters.storCapLow * \ + (self.parameters.matricSuction50/self.parameters.airEntryValueUpp)**\ + (-1./self.parameters.poreSizeBetaUpp) +\ + self.parameters.storCapLow * \ self.adjRootFrLow * \ - (parameters.matricSuction50/parameters.airEntryValueLow)**\ - (-1./parameters.poreSizeBetaLow)) /\ - (parameters.storCapUpp*self.adjRootFrUpp +\ - parameters.storCapLow*self.adjRootFrLow ) # THEFF_50[TYPE]= (SC1[TYPE]*RFW1[TYPE]*(PSI_50/PSI_A1[TYPE])**(-1/BCH1[TYPE]) + - # SC2[TYPE]*RFW2[TYPE]*(PSI_50/PSI_A2[TYPE])**(-1/BCH2[TYPE])) / - # (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]); - self.effPoreSizeBetaAt50 = (\ - parameters.storCapUpp*self.adjRootFrUpp*\ - parameters.poreSizeBetaUpp +\ - parameters.storCapLow*self.adjRootFrLow*\ - parameters.poreSizeBetaLow) / (\ - (parameters.storCapUpp*self.adjRootFrUpp +\ - parameters.storCapLow*self.adjRootFrLow )) # BCH_50 = (SC1[TYPE]*RFW1[TYPE]*BCH1[TYPE]+SC2[TYPE]*RFW2[TYPE]*BCH2[TYPE])/ - # (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]); + (self.parameters.matricSuction50/self.parameters.airEntryValueLow)**\ + (-1./self.parameters.poreSizeBetaLow)) /\ + (self.parameters.storCapUpp*self.adjRootFrUpp +\ + self.parameters.storCapLow*self.adjRootFrLow ), 0.5) + + self.effPoreSizeBetaAt50 = pcr.ifthenelse(denominator > 0.0,\ + (self.parameters.storCapUpp*self.adjRootFrUpp*\ + self.parameters.poreSizeBetaUpp +\ + self.parameters.storCapLow*self.adjRootFrLow*\ + self.parameters.poreSizeBetaLow) / (\ + (self.parameters.storCapUpp*self.adjRootFrUpp +\ + self.parameters.storCapLow*self.adjRootFrLow )), 0.5*(self.parameters.poreSizeBetaUpp + self.parameters.poreSizeBetaLow)) + + if self.numberOfLayers == 3: - self.effSatAt50 = (parameters.storCapUpp000005 * \ + #~ self.effSatAt50 = (self.parameters.storCapUpp000005 * \ + #~ self.adjRootFrUpp000005 * \ + #~ (self.parameters.matricSuction50/self.parameters.airEntryValueUpp000005)**\ + #~ (-1./self.parameters.poreSizeBetaUpp000005) +\ + #~ self.parameters.storCapUpp005030 * \ + #~ self.adjRootFrUpp005030 * \ + #~ (self.parameters.matricSuction50/self.parameters.airEntryValueUpp000005)**\ + #~ (-1./self.parameters.poreSizeBetaUpp000005) +\ + #~ self.parameters.storCapLow030150 * \ + #~ self.adjRootFrLow030150 * \ + #~ (self.parameters.matricSuction50/self.parameters.airEntryValueLow030150)**\ + #~ (-1./self.parameters.poreSizeBetaLow030150) /\ + #~ (self.parameters.storCapUpp000005*self.adjRootFrUpp000005 +\ + #~ self.parameters.storCapUpp005030*self.adjRootFrUpp005030 +\ + #~ self.parameters.storCapLow030150*self.adjRootFrLow030150 )) + + #~ self.effPoreSizeBetaAt50 = (\ + #~ self.parameters.storCapUpp000005*self.adjRootFrUpp000005*\ + #~ self.parameters.poreSizeBetaUpp000005 +\ + #~ self.parameters.storCapUpp005030*self.adjRootFrUpp005030*\ + #~ self.parameters.poreSizeBetaUpp005030 +\ + #~ self.parameters.storCapLow030150*self.adjRootFrLow030150*\ + #~ self.parameters.poreSizeBetaLow030150) / \ + #~ (self.parameters.storCapUpp000005*self.adjRootFrUpp000005 +\ + #~ self.parameters.storCapUpp005030*self.adjRootFrUpp005030 +\ + #~ self.parameters.storCapLow030150*self.adjRootFrLow030150 ) + + denominator = (self.parameters.storCapUpp000005*self.adjRootFrUpp000005 + + self.parameters.storCapUpp005030*self.adjRootFrUpp005030 + + self.parameters.storCapLow030150*self.adjRootFrLow030150 ) + + self.effSatAt50 = pcr.ifthenelse(denominator > 0.0,\ + (self.parameters.storCapUpp000005 * \ self.adjRootFrUpp000005 * \ - (parameters.matricSuction50/parameters.airEntryValueUpp000005)**\ - (-1./parameters.poreSizeBetaUpp000005) +\ - parameters.storCapUpp005030 * \ + (self.parameters.matricSuction50/self.parameters.airEntryValueUpp000005)**\ + (-1./self.parameters.poreSizeBetaUpp000005) +\ + self.parameters.storCapUpp005030 * \ self.adjRootFrUpp005030 * \ - (parameters.matricSuction50/parameters.airEntryValueUpp000005)**\ - (-1./parameters.poreSizeBetaUpp000005) +\ - parameters.storCapLow030150 * \ + (self.parameters.matricSuction50/self.parameters.airEntryValueUpp000005)**\ + (-1./self.parameters.poreSizeBetaUpp000005) +\ + self.parameters.storCapLow030150 * \ self.adjRootFrLow030150 * \ - (parameters.matricSuction50/parameters.airEntryValueLow030150)**\ - (-1./parameters.poreSizeBetaLow030150) /\ - (parameters.storCapUpp000005*self.adjRootFrUpp000005 +\ - parameters.storCapUpp005030*self.adjRootFrUpp005030 +\ - parameters.storCapLow030150*self.adjRootFrLow030150 )) - - self.effPoreSizeBetaAt50 = (\ - parameters.storCapUpp000005*self.adjRootFrUpp000005*\ - parameters.poreSizeBetaUpp000005 +\ - parameters.storCapUpp005030*self.adjRootFrUpp005030*\ - parameters.poreSizeBetaUpp005030 +\ - parameters.storCapLow030150*self.adjRootFrLow030150*\ - parameters.poreSizeBetaLow030150) / \ - (parameters.storCapUpp000005*self.adjRootFrUpp000005 +\ - parameters.storCapUpp005030*self.adjRootFrUpp005030 +\ - parameters.storCapLow030150*self.adjRootFrLow030150 ) - - def calculateTotAvlWaterCapacityInRootZone(self,parameters): + (self.parameters.matricSuction50/self.parameters.airEntryValueLow030150)**\ + (-1./self.parameters.poreSizeBetaLow030150) /\ + (self.parameters.storCapUpp000005*self.adjRootFrUpp000005 +\ + self.parameters.storCapUpp005030*self.adjRootFrUpp005030 +\ + self.parameters.storCapLow030150*self.adjRootFrLow030150 )), 0.5) + + self.effPoreSizeBetaAt50 = pcr.ifthenelse(denominator > 0.0,\ + (self.parameters.storCapUpp000005*self.adjRootFrUpp000005*\ + self.parameters.poreSizeBetaUpp000005 +\ + self.parameters.storCapUpp005030*self.adjRootFrUpp005030*\ + self.parameters.poreSizeBetaUpp005030 +\ + self.parameters.storCapLow030150*self.adjRootFrLow030150*\ + self.parameters.poreSizeBetaLow030150) / \ + (self.parameters.storCapUpp000005*self.adjRootFrUpp000005 +\ + self.parameters.storCapUpp005030*self.adjRootFrUpp005030 +\ + self.parameters.storCapLow030150*self.adjRootFrLow030150 ), 0.5 * (0.5*(self.parameters.poreSizeBetaUpp000005 + \ + self.parameters.poreSizeBetaUpp005030) + self.parameters.poreSizeBetaLow030150)) + + # I don't think that we need the following items. + self.effSatAt50 = pcr.cover(self.effSatAt50, 0.5) + if self.numberOfLayers == 2: self.effPoreSizeBetaAt50 = pcr.cover(self.effPoreSizeBetaAt50, 0.5*(self.parameters.poreSizeBetaUpp + self.parameters.poreSizeBetaLow)) + if self.numberOfLayers == 3: self.effPoreSizeBetaAt50 = pcr.cover(self.effPoreSizeBetaAt50, 0.5 * (0.5*(self.parameters.poreSizeBetaUpp000005 + \ + self.parameters.poreSizeBetaUpp005030) + self.parameters.poreSizeBetaLow030150)) + + # crop only to the landmask region + self.effSatAt50 = pcr.ifthen(self.landmask, self.effSatAt50) + self.effPoreSizeBetaAt50 = pcr.ifthen(self.landmask, self.effPoreSizeBetaAt50) + + def calculateTotAvlWaterCapacityInRootZone(self): # total water capacity in the root zone (upper soil layers) # Note: This is dependent on the land cover type. @@ -296,40 +759,40 @@ def calculateTotAvlWaterCapacityInRootZone(self,parameters): self.totAvlWater = \ (pcr.max(0.,\ - parameters.effSatAtFieldCapUpp - parameters.effSatAtWiltPointUpp))*\ - (parameters.satVolMoistContUpp - parameters.resVolMoistContUpp )*\ - pcr.min(parameters.thickUpp,self.maxRootDepth) + \ + self.parameters.effSatAtFieldCapUpp - self.parameters.effSatAtWiltPointUpp))*\ + (self.parameters.satVolMoistContUpp - self.parameters.resVolMoistContUpp )*\ + pcr.min(self.parameters.thickUpp,self.maxRootDepth) + \ (pcr.max(0.,\ - parameters.effSatAtFieldCapLow - parameters.effSatAtWiltPointLow))*\ - (parameters.satVolMoistContLow - parameters.resVolMoistContLow )*\ - pcr.min(parameters.thickLow,\ - pcr.max(self.maxRootDepth-parameters.thickUpp,0.)) # Edwin modified this line. Edwin uses soil thickness thickUpp and thickLow (instead of storCapUpp and storCapLow). - # And Rens support this. + self.parameters.effSatAtFieldCapLow - self.parameters.effSatAtWiltPointLow))*\ + (self.parameters.satVolMoistContLow - self.parameters.resVolMoistContLow )*\ + pcr.min(self.parameters.thickLow,\ + pcr.max(self.maxRootDepth-self.parameters.thickUpp,0.)) # Edwin modified this line. Edwin uses soil thickness thickUpp and thickLow (instead of storCapUpp and storCapLow). + # And Rens support this. self.totAvlWater = pcr.min(self.totAvlWater, \ - parameters.storCapUpp + parameters.storCapLow) + self.parameters.storCapUpp + self.parameters.storCapLow) if self.numberOfLayers == 3: self.totAvlWater = \ (pcr.max(0.,\ - parameters.effSatAtFieldCapUpp000005 - parameters.effSatAtWiltPointUpp000005))*\ - (parameters.satVolMoistContUpp000005 - parameters.resVolMoistContUpp000005 )*\ - pcr.min(parameters.thickUpp000005,self.maxRootDepth) + \ + self.parameters.effSatAtFieldCapUpp000005 - self.parameters.effSatAtWiltPointUpp000005))*\ + (self.parameters.satVolMoistContUpp000005 - self.parameters.resVolMoistContUpp000005 )*\ + pcr.min(self.parameters.thickUpp000005,self.maxRootDepth) + \ (pcr.max(0.,\ - parameters.effSatAtFieldCapUpp005030 - parameters.effSatAtWiltPointUpp005030))*\ - (parameters.satVolMoistContUpp005030 - parameters.resVolMoistContUpp005030 )*\ - pcr.min(parameters.thickUpp005030,\ - pcr.max(self.maxRootDepth-parameters.thickUpp000005)) + \ + self.parameters.effSatAtFieldCapUpp005030 - self.parameters.effSatAtWiltPointUpp005030))*\ + (self.parameters.satVolMoistContUpp005030 - self.parameters.resVolMoistContUpp005030 )*\ + pcr.min(self.parameters.thickUpp005030,\ + pcr.max(self.maxRootDepth-self.parameters.thickUpp000005)) + \ (pcr.max(0.,\ - parameters.effSatAtFieldCapLow030150 - parameters.effSatAtWiltPointLow030150))*\ - (parameters.satVolMoistContLow030150 - parameters.resVolMoistContLow030150 )*\ - pcr.min(parameters.thickLow030150,\ - pcr.max(self.maxRootDepth-parameters.thickUpp005030,0.)) + self.parameters.effSatAtFieldCapLow030150 - self.parameters.effSatAtWiltPointLow030150))*\ + (self.parameters.satVolMoistContLow030150 - self.parameters.resVolMoistContLow030150 )*\ + pcr.min(self.parameters.thickLow030150,\ + pcr.max(self.maxRootDepth-self.parameters.thickUpp005030,0.)) # self.totAvlWater = pcr.min(self.totAvlWater, \ - parameters.storCapUpp000005 + \ - parameters.storCapUpp005030 + \ - parameters.storCapLow030150) + self.parameters.storCapUpp000005 + \ + self.parameters.storCapUpp005030 + \ + self.parameters.storCapLow030150) def getICsLC(self,iniItems,iniConditions = None): @@ -374,25 +837,88 @@ def getICsLC(self,iniItems,iniConditions = None): vars(self)[var] = pcr.ifthen(self.landmask,vars(self)[var]) def updateLC(self,meteo,groundwater,routing,\ - parameters,capRiseFrac,\ - nonIrrGrossDemand,swAbstractionFraction,\ - currTimeStep, - allocSegments): - - self.getPotET(meteo,currTimeStep) # calculate total PotET (based on meteo and cropKC) - self.interceptionUpdate(meteo,currTimeStep) # calculate interception and update storage + capRiseFrac,\ + nonIrrGrossDemandDict,swAbstractionFractionDict,\ + currTimeStep,\ + allocSegments,\ + desalinationWaterUse,\ + groundwater_pumping_region_ids,\ + regionalAnnualGroundwaterAbstractionLimit): + + # get land cover parameters at the first day of the year or the first day of the simulation + if self.noAnnualChangesInLandCoverParameter == False and\ + (currTimeStep.timeStepPCR == 1 or currTimeStep.doy == 1): + if self.numberOfLayers == 2: + self.fracVegCover, self.arnoBeta, self.rootZoneWaterStorageMin, self.rootZoneWaterStorageRange, \ + self.maxRootDepth, self.adjRootFrUpp, self.adjRootFrLow = \ + self.get_land_cover_parameters(currTimeStep.fulldate) + if self.numberOfLayers == 3: + self.fracVegCover, self.arnoBeta, self.rootZoneWaterStorageMin, self.rootZoneWaterStorageRange, \ + self.maxRootDepth, self.adjRootFrUpp000005, self.adjRootFrUpp005030, self.adjRootFrLow030150 = \ + self.get_land_cover_parameters(currTimeStep.fulldate) + # estimate parameters while transpiration is being halved + self.calculateParametersAtHalfTranspiration() + # calculate TAW for estimating irrigation gross demand + if self.includeIrrigation: self.calculateTotAvlWaterCapacityInRootZone() + + # calculate total PotET (based on meteo and cropKC) + self.getPotET(meteo,currTimeStep) + + # calculate interception evaporation flux (m/day) and update interception storage (m) + self.interceptionUpdate(meteo, currTimeStep) - # calculate snow melt (or refreezing) + # calculate snow melt (or refreezing) if self.snowModuleType == "Simple": self.snowMeltHBVSimple(meteo,currTimeStep) # TODO: Define other snow modules # calculate qDR & qSF & q23 (and update storages) - self.upperSoilUpdate(meteo,groundwater,routing,\ - parameters,capRiseFrac,\ - nonIrrGrossDemand,swAbstractionFraction,\ - currTimeStep,\ - allocSegments) - + self.upperSoilUpdate(meteo, \ + groundwater, \ + routing, \ + capRiseFrac, \ + nonIrrGrossDemandDict, + swAbstractionFractionDict,\ + currTimeStep, \ + allocSegments, \ + desalinationWaterUse, \ + groundwater_pumping_region_ids,regionalAnnualGroundwaterAbstractionLimit) + + # saturation degrees (needed only for reporting): + if self.numberOfSoilLayers == 2: + self.satDegUpp = vos.getValDivZero(\ + self.storUpp, self.parameters.storCapUpp,\ + vos.smallNumber,0.) + self.satDegUpp = pcr.ifthen(self.landmask, self.satDegUpp) + self.satDegLow = vos.getValDivZero(\ + self.storLow, self.parameters.storCapLow,\ + vos.smallNumber,0.) + self.satDegLow = pcr.ifthen(self.landmask, self.satDegLow) + + self.satDegUppTotal = self.satDegUpp + self.satDegLowTotal = self.satDegLow + + if self.numberOfSoilLayers == 3: + self.satDegUpp000005 = vos.getValDivZero(\ + self.storUpp000005, self.parameters.storCapUpp000005,\ + vos.smallNumber,0.) + self.satDegUpp000005 = pcr.ifthen(self.landmask, self.satDegUpp000005) + self.satDegUpp005030 = vos.getValDivZero(\ + self.storUpp005030, self.parameters.storCapUpp005030,\ + vos.smallNumber,0.) + self.satDegUpp005030 = pcr.ifthen(self.landmask, self.satDegUpp005030) + self.satDegLow030150 = vos.getValDivZero(\ + self.storLow030150, self.parameters.storCapLow030150,\ + vos.smallNumber,0.) + self.satDegLow030150 = pcr.ifthen(self.landmask, self.satDegLow030150) + + self.satDegUppTotal = vos.getValDivZero(\ + self.storUpp000005 + self.storUpp005030,\ + self.parameters.storCapUpp000005 + \ + self.parameters.storCapUpp005030,\ + vos.smallNumber,0.) + self.satDegUppTotal = pcr.ifthen(self.landmask, self.satDegUppTotal) + self.satDegLowTotal = self.satDegLow030150 + if self.report == True: # writing Output to netcdf files # - daily output: @@ -408,7 +934,7 @@ def updateLC(self,meteo,groundwater,routing,\ str(self.iniItemsLC['name']) + "_" + \ "dailyTot.nc",\ var,\ - pcr2numpy(self.__getattribute__(var),vos.MV),\ + pcr.pcr2numpy(self.__getattribute__(var),vos.MV),\ timeStamp,timestepPCR-1) # writing monthly output to netcdf files @@ -430,7 +956,7 @@ def updateLC(self,meteo,groundwater,routing,\ str(self.iniItemsLC['name']) + "_" + \ "monthTot.nc",\ var,\ - pcr2numpy(self.__getattribute__(var+'Tot'),vos.MV),\ + pcr.pcr2numpy(self.__getattribute__(var+'Tot'),vos.MV),\ timeStamp,currTimeStep.monthIdx-1) # -average if self.outMonthAvgNC[0] != "None": @@ -454,7 +980,7 @@ def updateLC(self,meteo,groundwater,routing,\ str(self.iniItemsLC['name']) + "_" + \ "monthAvg.nc",\ var,\ - pcr2numpy(self.__getattribute__(var+'Avg'),vos.MV),\ + pcr.pcr2numpy(self.__getattribute__(var+'Avg'),vos.MV),\ timeStamp,currTimeStep.monthIdx-1) # -last day of the month if self.outMonthEndNC[0] != "None": @@ -466,18 +992,19 @@ def updateLC(self,meteo,groundwater,routing,\ str(self.iniItemsLC['name']) + "_" + \ "monthEnd.nc",\ var,\ - pcr2numpy(self.__getattribute__(var),vos.MV),\ + pcr.pcr2numpy(self.__getattribute__(var),vos.MV),\ timeStamp,currTimeStep.monthIdx-1) - def getPotET(self,meteo,currTimeStep): + def getPotET(self, meteo, currTimeStep): # get crop coefficient: - cropKC = vos.netcdf2PCRobjClone(self.cropCoefficientNC,'kc', \ - currTimeStep.doy, useDoy = 'Yes',\ - cloneMapFileName = self.cloneMap) - cropKC = pcr.cover(cropKC, 0.0) - self.cropKC = pcr.max( cropKC, self.minCropKC) + cropKC = pcr.cover( + vos.netcdf2PCRobjClone(self.cropCoefficientNC,'kc', \ + currTimeStep.fulldate, useDoy = 'daily_seasonal',\ + cloneMapFileName = self.cloneMap), 0.0) + self.inputCropKC = cropKC # This line is needed for debugging. (Can we remove this?) + self.cropKC = pcr.max(cropKC, self.minCropKC) # calculate potential ET (unit: m/day) self.totalPotET = pcr.ifthen(self.landmask,\ @@ -486,128 +1013,250 @@ def getPotET(self,meteo,currTimeStep): # calculate potential bare soil evaporation and transpiration (unit: m/day) self.potBareSoilEvap = pcr.ifthen(self.landmask,\ self.minCropKC * meteo.referencePotET) - self.potTranspiration = pcr.ifthen(self.landmask,\ - self.cropKC * meteo.referencePotET - self.potBareSoilEvap) + self.potTranspiration = pcr.max(0.0, \ + pcr.ifthen(self.landmask,\ + self.totalPotET - self.potBareSoilEvap)) - - if self.debugWaterBalance == str('True'): + if self.debugWaterBalance: vos.waterBalanceCheck([self.totalPotET],\ - [self.potBareSoilEvap,self.potTranspiration],\ - [pcr.scalar(0.0)],\ - [pcr.scalar(0.0)],\ + [self.potBareSoilEvap, self.potTranspiration],\ + [],\ + [],\ 'partitioning potential evaporation',\ True,\ - currTimeStep.fulldate,threshold=1e-5) - - # fraction of potential bare soil evaporation and transpiration - self.fracPotBareSoilEvap = vos.getValDivZero(self.potBareSoilEvap , self.totalPotET, vos.smallNumber) - self.fracPotTranspiration = pcr.scalar(1.0 - self.fracPotBareSoilEvap) + currTimeStep.fulldate,threshold=5e-4) - def interceptionUpdate(self,meteo,currTimeStep): + def interceptionUpdate(self, meteo, currTimeStep): - if self.debugWaterBalance == str('True'): + if self.debugWaterBalance: prevStates = [self.interceptStor] # get interceptCap: interceptCap = pcr.scalar(self.minInterceptCap) coverFraction = pcr.scalar(1.0) - if not self.iniItemsLC['name'].startswith("irr"): + if self.interceptCapNC != None and self.coverFractionNC != None: interceptCap = \ + pcr.cover( vos.netcdf2PCRobjClone(self.interceptCapNC,\ 'interceptCapInput',\ - currTimeStep.doy, useDoy = 'Yes',\ - cloneMapFileName = self.cloneMap) + currTimeStep.fulldate, useDoy = 'daily_seasonal',\ + cloneMapFileName = self.cloneMap), 0.0) + self.interceptCapInput = interceptCap # This line is needed for debugging. coverFraction = \ + pcr.cover( vos.netcdf2PCRobjClone(self.coverFractionNC,\ 'coverFractionInput',\ - currTimeStep.doy, useDoy = 'Yes',\ - cloneMapFileName = self.cloneMap) + currTimeStep.fulldate, useDoy = 'daily_seasonal',\ + cloneMapFileName = self.cloneMap), 0.0) coverFraction = pcr.cover(coverFraction, 0.0) interceptCap = coverFraction * interceptCap # original Rens line: ICC[TYPE] = CFRAC[TYPE]*INTCMAX[TYPE]; - self.interceptCap = pcr.max(interceptCap, self.minInterceptCap) # Edwin added this line to extend the interception definition (not only canopy interception). - + # canopy/cover fraction over the entire cell area (unit: m2) self.coverFraction = coverFraction + + # Edwin added the following line to extend the interception definition. + self.interceptCap = pcr.max(interceptCap, self.minInterceptCap) # throughfall = surplus above the interception storage threshold - self.throughfall = pcr.max(0.0, self.interceptStor + \ - meteo.precipitation - \ - self.interceptCap) # original Rens line: PRP = (1-CFRAC[TYPE])*PRPTOT+max(CFRAC[TYPE]*PRPTOT+INTS_L[TYPE]-ICC[TYPE],0) + if self.interceptionModuleType == "Modified": + # extended interception definition/scope (not only canopy) + self.throughfall = pcr.max(0.0, self.interceptStor + \ + meteo.precipitation - \ + self.interceptCap) # original Rens line: PRP = (1-CFRAC[TYPE])*PRPTOT+max(CFRAC[TYPE]*PRPTOT+INTS_L[TYPE]-ICC[TYPE],0) # Edwin modified this line to extend the interception scope (not only canopy interception). + if self.interceptionModuleType == "Original": + # only canopy interception (not only canopy) + self.throughfall = (1.0 - coverFraction) * meteo.precipitation +\ + pcr.max(0.0, coverFraction * meteo.precipitation + self.interceptStor - self.interceptCap) + # update interception storage after throughfall self.interceptStor = pcr.max(0.0, self.interceptStor + \ - meteo.precipitation - \ - self.throughfall) # original Rens line: INTS_L[TYPE] = max(0,INTS_L[TYPE]+PRPTOT-PRP) + meteo.precipitation - \ + self.throughfall) # original Rens line: INTS_L[TYPE] = max(0,INTS_L[TYPE]+PRPTOT-PRP) # partitioning throughfall into snowfall and liquid Precipitation: estimSnowfall = pcr.ifthenelse(meteo.temperature < self.freezingT, \ - meteo.precipitation, 0.0) # original Rens line: SNOW = if(TA0,PRP/PRPTOT,0) - # + # - liquid precipitation (m/day) self.liquidPrecip = pcr.max(0.0,\ self.throughfall - self.snowfall) # original Rens line: PRP = PRP-SNOW # potential interception flux (m/day) - self.potInterceptionFlux = self.totalPotET # added by Edwin to extend the interception scope/definition + # - this is depending on 'interceptionModuleType' + if self.interceptionModuleType == 'Original': + # only canopy interception + self.potInterceptionFlux = self.potTranspiration + if self.interceptionModuleType == 'Modified': + # extended interception definition/scope (not only canopy) + self.potInterceptionFlux = self.totalPotET # added by Edwin to extend the interception scope/definition + # evaporation from intercepted water (based on potInterceptionFlux) + # - based on Van Beek et al. (2011) self.interceptEvap = pcr.min(self.interceptStor, \ self.potInterceptionFlux * \ (vos.getValDivZero(self.interceptStor, self.interceptCap, \ vos.smallNumber, 0.) ** (2.00/3.00))) # EACT_L[TYPE]= min(INTS_L[TYPE],(T_p[TYPE]*if(ICC[TYPE]>0,INTS_L[TYPE]/ICC[TYPE],0)**(2/3))) - self.interceptEvap = pcr.min(self.interceptEvap, \ - self.potInterceptionFlux) + #~ # - Edwin simplify it + #~ self.interceptEvap = pcr.min(self.interceptStor, self.potInterceptionFlux) # update interception storage - self.interceptStor = self.interceptStor - self.interceptEvap # INTS_L[TYPE]= INTS_L[TYPE]-EACT_L[TYPE] + self.interceptStor = pcr.max(0.0, \ + self.interceptStor - self.interceptEvap) # INTS_L[TYPE]= INTS_L[TYPE]-EACT_L[TYPE] + # update potBareSoilEvap and potTranspiration after interceptEvap + if self.interceptionModuleType == 'Modified': + # fraction of potential bare soil evaporation and transpiration + fracPotBareSoilEvap = pcr.max(0.0, pcr.min(1.0, \ + vos.getValDivZero(self.potBareSoilEvap, \ + self.potBareSoilEvap + self.potTranspiration, vos.smallNumber))) + fracPotTranspiration = pcr.scalar(1.0 - self.fracPotBareSoilEvap) + # substract interceptEvap from potBareSoilEvap and potTranspiration + self.potBareSoilEvap = pcr.max(0.0, self.potBareSoilEvap -\ + fracPotBareSoilEvap * self.interceptEvap) + self.potTranspiration = pcr.max(0.0, self.potTranspiration -\ + fracPotTranspiration * self.interceptEvap) + # original Rens line: T_p[TYPE] = max(0,T_p[TYPE]-EACT_L[TYPE]) + # Edwin modified this line to extend the interception scope/definition (not only canopy interception). + if self.interceptionModuleType == 'Original': + self.potTranspiration = pcr.max(0.0, self.potTranspiration - self.interceptEvap) - # update potBareSoilEvap and potTranspiration - self.potBareSoilEvap -= self.fracPotBareSoilEvap * self.interceptEvap - self.potTranspiration -= self.fracPotTranspiration * self.interceptEvap # original Rens line: T_p[TYPE]= max(0,T_p[TYPE]-EACT_L[TYPE]) - # Edwin modified this line to extend the interception scope/definition (not only canopy interception). - # update actual evaporation (after interceptEvap) - self.actualET = 0. # interceptEvap is the first flux in ET + self.actualET = 0. # interceptEvap is the first flux in ET self.actualET += self.interceptEvap - if self.debugWaterBalance == str('True'): + if self.debugWaterBalance: vos.waterBalanceCheck([self.throughfall],\ - [self.snowfall,self.liquidPrecip],\ + [self.snowfall, self.liquidPrecip],\ [],\ [],\ 'rain-snow-partitioning',\ True,\ - currTimeStep.fulldate,threshold=1e-5) + currTimeStep.fulldate, threshold=1e-5) vos.waterBalanceCheck([meteo.precipitation], - [self.throughfall,self.interceptEvap], + [self.throughfall, self.interceptEvap], prevStates,\ [self.interceptStor],\ 'interceptStor',\ True,\ - currTimeStep.fulldate,threshold=1e-5) + currTimeStep.fulldate,threshold=1e-4) - def snowMeltHBVSimple(self,meteo,currTimeStep): - - # output: self.snowCoverSWE, - # self.netLqWaterToSoil, - # self.actBareSoilEvap, - # self.snowFreeWater, - # self.potBareSoilEvap, - # self.actualET + def interceptionUpdateOriginalVersion(self,meteo,currTimeStep): + + # TODO: Rewrite this method as defined by Rens. + + #~ if self.debugWaterBalance: + #~ prevStates = [self.interceptStor] + #~ + #~ # get interceptCap: + #~ interceptCap = pcr.scalar(self.minInterceptCap) + #~ coverFraction = pcr.scalar(1.0) + #~ if self.coverFractionNC != None or + #~ + #~ + #~ not self.iniItemsLC['name'].startswith("irr"): # This line assumes that no interception capacity for paddy and non paddy types + #~ interceptCap = \ + #~ pcr.cover( + #~ vos.netcdf2PCRobjClone(self.interceptCapNC,\ + #~ 'interceptCapInput',\ + #~ currTimeStep.fulldate, useDoy = 'daily_seasonal',\ + #~ cloneMapFileName = self.cloneMap), 0.0) + #~ self.interceptCapInput = interceptCap # This line is needed for debugging. + #~ coverFraction = \ + #~ pcr.cover( + #~ vos.netcdf2PCRobjClone(self.coverFractionNC,\ + #~ 'coverFractionInput',\ + #~ currTimeStep.fulldate, useDoy = 'daily_seasonal',\ + #~ cloneMapFileName = self.cloneMap), 0.0) + #~ coverFraction = pcr.cover(coverFraction, 0.0) + #~ interceptCap = coverFraction * interceptCap # original Rens line: ICC[TYPE] = CFRAC[TYPE]*INTCMAX[TYPE]; + #~ self.interceptCap = interceptCap + #~ + #~ # Edwin added this line to extend the interception definition (not only canopy interception) + #~ self.interceptCap = pcr.max(self.interceptCap, self.minInterceptCap) + #~ + #~ # canopy/cover fraction over the entire cell area (unit: m2) + #~ self.coverFraction = coverFraction + #~ + #~ # throughfall (m/day) + #~ self.throughfall = (1.0 - coverFraction) * meteo.precipitation +\ + #~ pcr.max(0.0, coverFraction * meteo.precipitation + self.interceptStor - self.interceptCap) + #~ # original Rens line: PRP = (1-CFRAC[TYPE])*PRPTOT+max(CFRAC[TYPE]*PRPTOT+INTS_L[TYPE]-ICC[TYPE],0) + #~ + #~ # make sure that throughfall is never negative + #~ self.throughfall = pcr.max(0.0, self.throughfall) + #~ + #~ # update interception storage after throughfall + #~ self.interceptStor = pcr.max(0.0, self.interceptStor + \ + #~ meteo.precipitation - \ + #~ self.throughfall) # original Rens line: INTS_L[TYPE] = max(0,INTS_L[TYPE]+PRPTOT-PRP) + #~ + #~ # partitioning throughfall into snowfall and liquid Precipitation: + #~ estimSnowfall = pcr.ifthenelse(meteo.temperature < self.freezingT, \ + #~ meteo.precipitation, 0.0) # original Rens line: SNOW = if(TA 0.0, self.throughfall/totalPrec, 0.0)) + #~ # - liquid throughfall passing the canopy + #~ self.liquidPrecip = pcr.max(0.0,\ + #~ self.throughfall - self.snowfall) # original Rens line: PRP = PRP-SNOW +#~ + #~ # potential interception flux (m/day) + #~ self.potInterceptionFlux = self.potTranspiration # Rens only uses potTranspiration + #~ + #~ # evaporation from intercepted water (based on potInterceptionFlux) + #~ self.interceptEvap = pcr.min(self.interceptStor, \ + #~ self.potInterceptionFlux * \ + #~ pcr.ifthenelse(self.interceptCap > 0.0, (self.interceptStor/self.interceptCap), 0.0) ** (2.0/3.0)) + #~ # EACT_L[TYPE] = min(INTS_L[TYPE],(T_p[TYPE]*if(ICC[TYPE]>0,INTS_L[TYPE]/ICC[TYPE],0)**(2/3))) + #~ + #~ # make sure evaporation does not exceed available enerrgy + #~ self.interceptEvap = pcr.min(self.interceptEvap, self.potInterceptionFlux) + #~ + #~ # update interception storage + #~ self.interceptStor = pcr.max(0.0, \ + #~ self.interceptStor - self.interceptEvap) # INTS_L[TYPE] = INTS_L[TYPE]-EACT_L[TYPE] + #~ + #~ # update potTranspiration + #~ self.potTranspiration = pcr.max(0.0, self.potTranspiration - self.interceptEvap) # original Rens line: T_p[TYPE]= max(0,T_p[TYPE]-EACT_L[TYPE]) +#~ + #~ # update actual evaporation (after interceptEvap) + #~ self.actualET = 0. # interceptEvap is the first flux in ET + #~ self.actualET += self.interceptEvap +#~ + #~ if self.debugWaterBalance: + #~ vos.waterBalanceCheck([self.throughfall],\ + #~ [self.snowfall,self.liquidPrecip],\ + #~ [],\ + #~ [],\ + #~ 'rain-snow-partitioning',\ + #~ True,\ + #~ currTimeStep.fulldate,threshold=1e-5) + #~ vos.waterBalanceCheck([meteo.precipitation], + #~ [self.throughfall,self.interceptEvap], + #~ prevStates,\ + #~ [self.interceptStor],\ + #~ 'interceptStor',\ + #~ True,\ + #~ currTimeStep.fulldate,threshold=1e-4) + + pass - # parameters: self.freezingT, - # self.degreeDayFactor, - # self.snowWaterHoldingCap, - # self.refreezingCoeff + def snowMeltHBVSimple(self,meteo,currTimeStep): - if self.debugWaterBalance == str('True'): - prevStates = [self.snowCoverSWE,self.snowFreeWater] + if self.debugWaterBalance: + prevStates = [self.snowCoverSWE,self.snowFreeWater] + prevSnowCoverSWE = self.snowCoverSWE + prevSnowFreeWater = self.snowFreeWater # changes in snow cover: - melt ; + gain in snow or refreezing deltaSnowCover = \ @@ -615,34 +1264,40 @@ def snowMeltHBVSimple(self,meteo,currTimeStep): self.refreezingCoeff*self.snowFreeWater, \ -pcr.min(self.snowCoverSWE, \ pcr.max(meteo.temperature - self.freezingT, 0.0) * \ - self.degreeDayFactor)) # DSC[TYPE] = if(TA<=TT,CFR*SCF_L[TYPE],-min(SC_L[TYPE],max(TA-TT,0)*CFMAX*Duration*timeslice())) + self.degreeDayFactor)*1.0*1.0) # DSC[TYPE] = if(TA<=TT,CFR*SCF_L[TYPE], + # -min(SC_L[TYPE],max(TA-TT,0)*CFMAX*Duration*timeslice())) + #~ deltaSnowCover = \ + #~ pcr.ifthenelse(meteo.temperature > self.freezingT, -pcr.min(self.snowCoverSWE, \ + #~ pcr.max(meteo.temperature - self.freezingT, 0.0) * \ + #~ self.degreeDayFactor)*1.0*1.0, \ + #~ self.refreezingCoeff*self.snowFreeWater) + + # update snowCoverSWE + self.snowCoverSWE = pcr.max(0.0, self.snowfall + deltaSnowCover + self.snowCoverSWE) + # SC_L[TYPE] = max(0.0, SC_L[TYPE]+DSC[TYPE]+SNOW) # for reporting snow melt in m/day self.snowMelt = pcr.ifthenelse(deltaSnowCover < 0.0, deltaSnowCover * pcr.scalar(-1.0), pcr.scalar(0.0)) - - # update snowCoverSWE - self.snowCoverSWE = self.snowCoverSWE + deltaSnowCover + \ - self.snowfall # SC_L[TYPE] = SC_L[TYPE]+DSC[TYPE]+SNOW; - self.snowCoverSWE = pcr.max(self.snowCoverSWE, 0.0) # update snowFreeWater = liquid water stored above snowCoverSWE self.snowFreeWater = self.snowFreeWater - deltaSnowCover + \ self.liquidPrecip # SCF_L[TYPE] = SCF_L[TYPE]-DSC[TYPE]+PRP; # netLqWaterToSoil = net liquid transferred to soil - self.netLqWaterToSoil = pcr.max(0, self.snowFreeWater - \ - self.snowWaterHoldingCap * self.snowCoverSWE) # Pn = max(0,SCF_L[TYPE]-CWH*SC_L[TYPE]) + self.netLqWaterToSoil = pcr.max(0., self.snowFreeWater - \ + self.snowWaterHoldingCap * self.snowCoverSWE) # Pn = max(0,SCF_L[TYPE]-CWH*SC_L[TYPE]) - # update snowFreeWater (after netPfromSnowFreeWater) + # update snowFreeWater (after netLqWaterToSoil) self.snowFreeWater = pcr.max(0., self.snowFreeWater - \ - self.netLqWaterToSoil) # SCF_L[TYPE]= max(0,SCF_L[TYPE]-Pn) + self.netLqWaterToSoil) # SCF_L[TYPE] = max(0,SCF_L[TYPE]-Pn) # evaporation from snowFreeWater (based on potBareSoilEvap) self.actSnowFreeWaterEvap = pcr.min(self.snowFreeWater, \ self.potBareSoilEvap) # ES_a[TYPE] = min(SCF_L[TYPE],ES_p[TYPE]) # update snowFreeWater and potBareSoilEvap - self.snowFreeWater = self.snowFreeWater - self.actSnowFreeWaterEvap + self.snowFreeWater = pcr.max(0.0, \ + self.snowFreeWater - self.actSnowFreeWaterEvap) # SCF_L[TYPE]= SCF_L[TYPE]-ES_a[TYPE] self.potBareSoilEvap = pcr.max(0, \ self.potBareSoilEvap - self.actSnowFreeWaterEvap) @@ -651,17 +1306,31 @@ def snowMeltHBVSimple(self,meteo,currTimeStep): # update actual evaporation (after evaporation from snowFreeWater) self.actualET += self.actSnowFreeWaterEvap # EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]; - if self.debugWaterBalance == str('True'): - vos.waterBalanceCheck([self.snowfall,self.liquidPrecip], + if self.debugWaterBalance: + vos.waterBalanceCheck([self.snowfall, self.liquidPrecip], [self.netLqWaterToSoil,\ self.actSnowFreeWaterEvap], prevStates,\ - [self.snowCoverSWE,self.snowFreeWater],\ + [self.snowCoverSWE, self.snowFreeWater],\ 'snow module',\ True,\ currTimeStep.fulldate,threshold=1e-4) + vos.waterBalanceCheck([self.snowfall, deltaSnowCover],\ + [pcr.scalar(0.0)],\ + [prevSnowCoverSWE],\ + [self.snowCoverSWE],\ + 'snowCoverSWE',\ + True,\ + currTimeStep.fulldate,threshold=5e-4) + vos.waterBalanceCheck([self.liquidPrecip], + [deltaSnowCover, self.actSnowFreeWaterEvap, self.netLqWaterToSoil], + [prevSnowFreeWater],\ + [self.snowFreeWater],\ + 'snowFreeWater',\ + True,\ + currTimeStep.fulldate,threshold=5e-4) - def getSoilStates(self,parameters): + def getSoilStates(self): if self.numberOfLayers == 2: @@ -671,71 +1340,74 @@ def getSoilStates(self,parameters): self.storLow ) # effective degree of saturation (-) - self.effSatUpp = pcr.max(0., self.storUpp/ parameters.storCapUpp) # THEFF1= max(0,S1_L[TYPE]/SC1[TYPE]); - self.effSatLow = pcr.max(0., self.storLow/ parameters.storCapLow) # THEFF2= max(0,S2_L[TYPE]/SC2[TYPE]); + self.effSatUpp = pcr.max(0., self.storUpp/ self.parameters.storCapUpp) # THEFF1= max(0,S1_L[TYPE]/SC1[TYPE]); + self.effSatLow = pcr.max(0., self.storLow/ self.parameters.storCapLow) # THEFF2= max(0,S2_L[TYPE]/SC2[TYPE]); self.effSatUpp = pcr.min(1., self.effSatUpp) self.effSatLow = pcr.min(1., self.effSatLow) - + self.effSatUpp = pcr.cover(self.effSatUpp, 1.0) + self.effSatLow = pcr.cover(self.effSatLow, 1.0) + # matricSuction (m) - self.matricSuctionUpp = parameters.airEntryValueUpp*\ - (pcr.max(0.01,self.effSatUpp)**-parameters.poreSizeBetaUpp) - self.matricSuctionLow = parameters.airEntryValueLow*\ - (pcr.max(0.01,self.effSatLow)**-parameters.poreSizeBetaLow) # PSI1= PSI_A1[TYPE]*max(0.01,THEFF1)**-BCH1[TYPE]; - # PSI2= PSI_A2[TYPE]*max(0.01,THEFF2)**-BCH2[TYPE]; + self.matricSuctionUpp = self.parameters.airEntryValueUpp*\ + (pcr.max(0.01,self.effSatUpp)**-self.parameters.poreSizeBetaUpp) + self.matricSuctionLow = self.parameters.airEntryValueLow*\ + (pcr.max(0.01,self.effSatLow)**-self.parameters.poreSizeBetaLow) # PSI1= PSI_A1[TYPE]*max(0.01,THEFF1)**-BCH1[TYPE]; + # PSI2= PSI_A2[TYPE]*max(0.01,THEFF2)**-BCH2[TYPE]; # kUnsat (m.day-1): unsaturated hydraulic conductivity - #~ KUnSatUpp = pcr.max(0.,pcr.max(parameters.THEFF1_50,\ + #~ KUnSatUpp = pcr.max(0.,pcr.max(self.parameters.THEFF1_50,\ #~ effSatUpp)**\ - #~ parameters.campbellBeta1*parameters.KSat1) # DW's code + #~ self.parameters.campbellBeta1*self.parameters.KSat1) # DW's code #~ KUnSatLow = pcr.max(0.,pcr.max(parameters.THEFF2_50,\ #~ effSatLow)**\ - #~ parameters.campbellBeta2*parameters.KSat2) # DW's code + #~ self.parameters.campbellBeta2*self.parameters.KSat2) # DW's code # self.kUnsatUpp = pcr.max(0.,(self.effSatUpp**\ - parameters.campbellBetaUpp)*parameters.kSatUpp) # original Rens's code: KTHEFF1= max(0,THEFF1**BCB1[TYPE]*KS1[TYPE]) + self.parameters.campbellBetaUpp)*self.parameters.kSatUpp) # original Rens's code: KTHEFF1= max(0,THEFF1**BCB1[TYPE]*KS1[TYPE]) self.kUnsatLow = pcr.max(0.,(self.effSatLow**\ - parameters.campbellBetaLow)*parameters.kSatLow) # original Rens's code: KTHEFF2= max(0,THEFF2**BCB2[TYPE]*KS2[TYPE]) - self.kUnsatUpp = pcr.min(self.kUnsatUpp,parameters.kSatUpp) - self.kUnsatLow = pcr.min(self.kUnsatLow,parameters.kSatLow) + self.parameters.campbellBetaLow)*self.parameters.kSatLow) # original Rens's code: KTHEFF2= max(0,THEFF2**BCB2[TYPE]*KS2[TYPE]) + self.kUnsatUpp = pcr.min(self.kUnsatUpp,self.parameters.kSatUpp) + self.kUnsatLow = pcr.min(self.kUnsatLow,self.parameters.kSatLow) # kThVert (m.day-1) = unsaturated conductivity capped at field capacity # - exchange between layers capped at field capacity self.kThVertUppLow = pcr.min(\ pcr.sqrt(self.kUnsatUpp*self.kUnsatLow),\ (self.kUnsatUpp*self.kUnsatLow* \ - parameters.kUnsatAtFieldCapUpp*\ - parameters.kUnsatAtFieldCapLow)**0.25) # KTHVERT = min(sqrt(KTHEFF1*KTHEFF2),(KTHEFF1*KTHEFF2*KTHEFF1_FC*KTHEFF2_FC)**0.25) + self.parameters.kUnsatAtFieldCapUpp*\ + self.parameters.kUnsatAtFieldCapLow)**0.25) + # KTHVERT = min(sqrt(KTHEFF1*KTHEFF2),(KTHEFF1*KTHEFF2*KTHEFF1_FC*KTHEFF2_FC)**0.25) # gradient for capillary rise (index indicating target store to its underlying store) - self.gradientUppLow = pcr.max(0.,2.*\ - (self.matricSuctionUpp-self.matricSuctionLow)/\ - ( parameters.thickUpp+ parameters.thickLow)-1.) # GRAD = max(0,2*(PSI1-PSI2)/(Z1[TYPE]+Z2[TYPE])-1); - + self.gradientUppLow = pcr.max(0.0,\ + (self.matricSuctionUpp-self.matricSuctionLow)*2./\ + (self.parameters.thickUpp+self.parameters.thickLow)-pcr.scalar(1.0)) + self.gradientUppLow = pcr.cover(self.gradientUppLow, 0.0) + # GRAD = max(0,2*(PSI1-PSI2)/(Z1[TYPE]+Z2[TYPE])-1); # readily available water in the root zone (upper soil layers) #~ readAvlWater = \ #~ (pcr.max(0.,\ - #~ effSatUpp -parameters.THEFF1_WP))*\ + #~ effSatUpp -self.parameters.THEFF1_WP))*\ #~ (parameters.satVolWC1 -parameters.resVolWC1) *\ #~ pcr.min(parameters.storCapUpp,self.maxRootDepth) + \ #~ (pcr.max(0.,\ - #~ effSatLow -parameters.THEFF2_WP))*\ + #~ effSatLow -self.parameters.THEFF2_WP))*\ #~ (parameters.satVolWC2 -parameters.resVolWC2) *\ #~ pcr.min(parameters.storCapLow,\ - #~ pcr.max(self.maxRootDepth-parameters.storCapUpp,0.)) # DW's code (using storCapUpp and storCapLow). Edwin does not agree with this. + #~ pcr.max(self.maxRootDepth-self.parameters.storCapUpp,0.)) # DW's code (using storCapUpp and storCapLow). Edwin does not agree with this. + # self.readAvlWater = \ (pcr.max(0.,\ - self.effSatUpp - parameters.effSatAtWiltPointUpp))*\ - (parameters.satVolMoistContUpp - parameters.resVolMoistContUpp )*\ - pcr.min(parameters.thickUpp,self.maxRootDepth) + \ + self.effSatUpp - self.parameters.effSatAtWiltPointUpp))*\ + (self.parameters.satVolMoistContUpp - self.parameters.resVolMoistContUpp )*\ + pcr.min(self.parameters.thickUpp,self.maxRootDepth) + \ (pcr.max(0.,\ - self.effSatLow - parameters.effSatAtWiltPointLow))*\ - (parameters.satVolMoistContLow - parameters.resVolMoistContLow )*\ - pcr.min(parameters.thickLow,\ - pcr.max(self.maxRootDepth-parameters.thickUpp,0.)) # Edwin modified this line. Edwin uses soil thickness thickUpp and thickLow (instead of storCapUpp and storCapLow). - # And Rens support this. - self.readAvlWater = pcr.min(self.readAvlWater, \ - self.storUpp + self.storLow) + self.effSatLow - self.parameters.effSatAtWiltPointLow))*\ + (self.parameters.satVolMoistContLow - self.parameters.resVolMoistContLow )*\ + pcr.min(self.parameters.thickLow,\ + pcr.max(self.maxRootDepth-self.parameters.thickUpp,0.)) # Edwin modified this line. Edwin uses soil thickness thickUpp & thickLow (instead of storCapUpp & storCapLow). + # And Rens support this. if self.numberOfLayers == 3: @@ -746,26 +1418,26 @@ def getSoilStates(self,parameters): self.storLow030150 ) # effective degree of saturation (-) - self.effSatUpp000005 = pcr.max(0., self.storUpp000005/ parameters.storCapUpp000005) - self.effSatUpp005030 = pcr.max(0., self.storUpp005030/ parameters.storCapUpp005030) - self.effSatLow030150 = pcr.max(0., self.storLow030150/ parameters.storCapLow030150) + self.effSatUpp000005 = pcr.max(0., self.storUpp000005/ self.parameters.storCapUpp000005) + self.effSatUpp005030 = pcr.max(0., self.storUpp005030/ self.parameters.storCapUpp005030) + self.effSatLow030150 = pcr.max(0., self.storLow030150/ self.parameters.storCapLow030150) self.effSatUpp000005 = pcr.min(1., self.effSatUpp000005) self.effSatUpp005030 = pcr.min(1., self.effSatUpp005030) self.effSatLow030150 = pcr.min(1., self.effSatLow030150) # matricSuction (m) - self.matricSuctionUpp000005 = parameters.airEntryValueUpp000005*(pcr.max(0.01,self.effSatUpp000005)**-parameters.poreSizeBetaUpp000005) - self.matricSuctionUpp005030 = parameters.airEntryValueUpp005030*(pcr.max(0.01,self.effSatUpp005030)**-parameters.poreSizeBetaUpp005030) - self.matricSuctionLow030150 = parameters.airEntryValueLow030150*(pcr.max(0.01,self.effSatLow030150)**-parameters.poreSizeBetaLow030150) + self.matricSuctionUpp000005 = self.parameters.airEntryValueUpp000005*(pcr.max(0.01,self.effSatUpp000005)**-self.parameters.poreSizeBetaUpp000005) + self.matricSuctionUpp005030 = self.parameters.airEntryValueUpp005030*(pcr.max(0.01,self.effSatUpp005030)**-self.parameters.poreSizeBetaUpp005030) + self.matricSuctionLow030150 = self.parameters.airEntryValueLow030150*(pcr.max(0.01,self.effSatLow030150)**-self.parameters.poreSizeBetaLow030150) # kUnsat (m.day-1): unsaturated hydraulic conductivity - self.kUnsatUpp000005 = pcr.max(0.,(self.effSatUpp000005**parameters.campbellBetaUpp000005)*parameters.kSatUpp000005) - self.kUnsatUpp005030 = pcr.max(0.,(self.effSatUpp005030**parameters.campbellBetaUpp005030)*parameters.kSatUpp005030) - self.kUnsatLow030150 = pcr.max(0.,(self.effSatLow030150**parameters.campbellBetaLow030150)*parameters.kSatLow030150) + self.kUnsatUpp000005 = pcr.max(0.,(self.effSatUpp000005**self.parameters.campbellBetaUpp000005)*self.parameters.kSatUpp000005) + self.kUnsatUpp005030 = pcr.max(0.,(self.effSatUpp005030**self.parameters.campbellBetaUpp005030)*self.parameters.kSatUpp005030) + self.kUnsatLow030150 = pcr.max(0.,(self.effSatLow030150**self.parameters.campbellBetaLow030150)*self.parameters.kSatLow030150) - self.kUnsatUpp000005 = pcr.min(self.kUnsatUpp000005,parameters.kSatUpp000005) - self.kUnsatUpp005030 = pcr.min(self.kUnsatUpp005030,parameters.kSatUpp005030) - self.kUnsatLow030150 = pcr.min(self.kUnsatLow030150,parameters.kSatLow030150) + self.kUnsatUpp000005 = pcr.min(self.kUnsatUpp000005,self.parameters.kSatUpp000005) + self.kUnsatUpp005030 = pcr.min(self.kUnsatUpp005030,self.parameters.kSatUpp005030) + self.kUnsatLow030150 = pcr.min(self.kUnsatLow030150,self.parameters.kSatLow030150) # kThVert (m.day-1) = unsaturated conductivity capped at field capacity # - exchange between layers capped at field capacity @@ -773,63 +1445,62 @@ def getSoilStates(self,parameters): self.kThVertUpp000005Upp005030 = pcr.min(\ pcr.sqrt(self.kUnsatUpp000005*self.kUnsatUpp005030),\ (self.kUnsatUpp000005*self.kUnsatUpp005030* \ - parameters.kUnsatAtFieldCapUpp000005*\ - parameters.kUnsatAtFieldCapUpp005030)**0.25) + self.parameters.kUnsatAtFieldCapUpp000005*\ + self.parameters.kUnsatAtFieldCapUpp005030)**0.25) # between Upp005030Low030150 self.kThVertUpp005030Low030150 = pcr.min(\ pcr.sqrt(self.kUnsatUpp005030*self.kUnsatLow030150),\ (self.kUnsatUpp005030*self.kUnsatLow030150* \ - parameters.kUnsatAtFieldCapUpp005030*\ - parameters.kUnsatAtFieldCapLow030150)**0.25) + self.parameters.kUnsatAtFieldCapUpp005030*\ + self.parameters.kUnsatAtFieldCapLow030150)**0.25) # gradient for capillary rise (index indicating target store to its underlying store) # between Upp000005Upp005030 self.gradientUpp000005Upp005030 = pcr.max(0.,2.*\ (self.matricSuctionUpp000005-self.matricSuctionUpp005030)/\ - ( parameters.thickUpp000005+ parameters.thickUpp005030)-1.) + (self.parameters.thickUpp000005+ self.parameters.thickUpp005030)-1.) # between Upp005030Low030150 self.gradientUpp005030Low030150 = pcr.max(0.,2.*\ (self.matricSuctionUpp005030-self.matricSuctionLow030150)/\ - ( parameters.thickUpp005030+ parameters.thickLow030150)-1.) + (self.parameters.thickUpp005030+ self.parameters.thickLow030150)-1.) # readily available water in the root zone (upper soil layers) self.readAvlWater = \ (pcr.max(0.,\ - self.effSatUpp000005 - parameters.effSatAtWiltPointUpp000005))*\ - (parameters.satVolMoistContUpp000005 - parameters.resVolMoistContUpp000005 )*\ - pcr.min(parameters.thickUpp000005,self.maxRootDepth) + \ + self.effSatUpp000005 - self.parameters.effSatAtWiltPointUpp000005))*\ + (self.parameters.satVolMoistContUpp000005 - self.parameters.resVolMoistContUpp000005 )*\ + pcr.min(self.parameters.thickUpp000005,self.maxRootDepth) + \ (pcr.max(0.,\ - self.effSatUpp005030 - parameters.effSatAtWiltPointUpp005030))*\ - (parameters.satVolMoistContUpp005030 - parameters.resVolMoistContUpp005030 )*\ - pcr.min(parameters.thickUpp005030,\ - pcr.max(self.maxRootDepth-parameters.thickUpp000005)) + \ + self.effSatUpp005030 - self.parameters.effSatAtWiltPointUpp005030))*\ + (self.parameters.satVolMoistContUpp005030 - self.parameters.resVolMoistContUpp005030 )*\ + pcr.min(self.parameters.thickUpp005030,\ + pcr.max(self.maxRootDepth-self.parameters.thickUpp000005)) + \ (pcr.max(0.,\ - self.effSatLow030150 - parameters.effSatAtWiltPointLow030150))*\ - (parameters.satVolMoistContLow030150 - parameters.resVolMoistContLow030150 )*\ - pcr.min(parameters.thickLow030150,\ - pcr.max(self.maxRootDepth-parameters.thickUpp005030,0.)) - # - self.readAvlWater = pcr.min(self.readAvlWater, \ - self.storUpp000005 + \ - self.storUpp005030 + \ - self.storLow030150) - - def calculateWaterDemand(self, parameters, nonIrrGrossDemand, swAbstractionFraction, groundwater, routing, allocSegments, currTimeStep): - - # non irrigation water demand - self.nonIrrGrossDemand = pcr.cover(nonIrrGrossDemand, 0.0) # TODO: Please check! Do we really have to cover? - self.nonIrrGrossDemand = pcr.ifthen(self.landmask, self.nonIrrGrossDemand) - - # irrigation water demand for paddy and non-paddy (m) + self.effSatLow030150 - self.parameters.effSatAtWiltPointLow030150))*\ + (self.parameters.satVolMoistContLow030150 - self.parameters.resVolMoistContLow030150 )*\ + pcr.min(self.parameters.thickLow030150,\ + pcr.max(self.maxRootDepth-self.parameters.thickUpp005030,0.)) + + def calculateWaterDemand(self, nonIrrGrossDemandDict, \ + swAbstractionFractionDict, \ + groundwater, \ + routing, \ + allocSegments, \ + currTimeStep, \ + desalinationWaterUse,\ + groundwater_pumping_region_ids,regionalAnnualGroundwaterAbstractionLimit): + + # irrigation water demand (unit: m/day) for paddy and non-paddy self.irrGrossDemand = pcr.scalar(0.) - if self.name == 'irrPaddy': + if (self.name == 'irrPaddy' or self.name == 'irr_paddy') and self.includeIrrigation: self.irrGrossDemand = \ - pcr.ifthenelse( self.cropKC > 0.75, \ + pcr.ifthenelse(self.cropKC > 0.75, \ pcr.max(0.0,self.minTopWaterLayer - \ - (self.topWaterLayer )), 0.) # a function of cropKC (evaporation and transpiration), - # topWaterLayer (water available in the irrigation field) + (self.topWaterLayer )), 0.) # a function of cropKC (evaporation and transpiration), + # topWaterLayer (water available in the irrigation field) + + if (self.name == 'irrNonPaddy' or self.name == 'irr_non_paddy' or self.name == "irr_non_paddy_crops") and self.includeIrrigation: - if self.name == 'irrNonPaddy': #~ adjDeplFactor = \ #~ pcr.max(0.1,\ #~ pcr.min(0.8,(self.cropDeplFactor + \ @@ -838,282 +1509,783 @@ def calculateWaterDemand(self, parameters, nonIrrGrossDemand, swAbstractionFract pcr.max(0.1,\ pcr.min(0.8,(self.cropDeplFactor + \ 0.04*(5.-self.totalPotET*1000.)))) # original formula based on Allen et al. (1998) - # see: http://www.fao.org/docrep/x0490e/x0490e0e.htm#total available water (taw) - # maximum irrigation demand (to fill the entire totAvlWater) - maxIrrGrossDemand = \ + # see: http://www.fao.org/docrep/x0490e/x0490e0e.htm# + # + #~ # alternative 1: irrigation demand (to fill the entire totAvlWater, maintaining the field capacity) - NOT USED + #~ self.irrGrossDemand = \ + #~ pcr.ifthenelse( self.cropKC > 0.20, \ + #~ pcr.ifthenelse( self.readAvlWater < \ + #~ adjDeplFactor*self.totAvlWater, \ + #~ pcr.max(0.0, self.totAvlWater-self.readAvlWater),0.),0.) # a function of cropKC and totalPotET (evaporation and transpiration), + #~ # readAvlWater (available water in the root zone) + + # alternative 2: irrigation demand (to fill the entire totAvlWater, maintaining the field capacity, + # but with the correction of totAvlWater based on the rooting depth) + # - as the proxy of rooting depth, we use crop coefficient + self.irrigation_factor = pcr.ifthenelse(self.cropKC > 0.0,\ + pcr.min(1.0, self.cropKC / 1.0), 0.0) + self.irrGrossDemand = \ pcr.ifthenelse( self.cropKC > 0.20, \ pcr.ifthenelse( self.readAvlWater < \ - adjDeplFactor*self.totAvlWater, \ - pcr.max(0.0, self.totAvlWater-self.readAvlWater),0.),0.) # a function of cropKC and totalPotET (evaporation and transpiration), - # readAvlWater (available water in the root zone) - self.irrGrossDemand = maxIrrGrossDemand + adjDeplFactor*self.irrigation_factor*self.totAvlWater, \ + pcr.max(0.0, self.totAvlWater*self.irrigation_factor-self.readAvlWater),0.),0.) + + # irrigation demand is implemented only if there is deficit in transpiration and/or evaporation + deficit_factor = 1.00 + evaporationDeficit = pcr.max(0.0, (self.potBareSoilEvap + self.potTranspiration)*deficit_factor -\ + self.estimateTranspirationAndBareSoilEvap(returnTotalEstimation = True)) + transpirationDeficit = pcr.max(0.0, + self.potTranspiration*deficit_factor -\ + self.estimateTranspirationAndBareSoilEvap(returnTotalEstimation = True, returnTotalTranspirationOnly = True)) + deficit = pcr.max(evaporationDeficit, transpirationDeficit) # - #~ # estimate of deficit in ET (principle: try to optimize ET) - This is based on de Graaf et al., 2013. - #~ deficitET = pcr.max(0.0, self.potBareSoilEvap +\ - #~ self.potTranspiration -\ - #~ self.estimateTranspirationAndBareSoilEvap(parameters, returnTotalEstimation = True)) - #~ # irrigation demand for non paddy - #~ self.irrGrossDemand = pcr.min(maxIrrGrossDemand, \ - #~ deficitET) - - self.irrGrossDemand = pcr.cover(self.irrGrossDemand, 0.0) - self.irrGrossDemand = pcr.ifthen(self.landmask, self.irrGrossDemand) + # treshold to initiate irrigation + deficit_treshold = 0.20 * self.totalPotET + need_irrigation = pcr.ifthenelse(deficit > deficit_treshold, pcr.boolean(1),\ + pcr.ifthenelse(self.soilWaterStorage == 0.000, pcr.boolean(1), pcr.boolean(0))) + need_irrigation = pcr.cover(need_irrigation, pcr.boolean(0.0)) + # + self.irrGrossDemand = pcr.ifthenelse(need_irrigation, self.irrGrossDemand, 0.0) + + # demand is limited by potential evaporation for the next coming days + # - objective: to avoid too high and unrealistic demand + max_irrigation_interval = 15.0 + min_irrigation_interval = 7.0 + irrigation_interval = pcr.min(max_irrigation_interval, \ + pcr.max(min_irrigation_interval, \ + pcr.ifthenelse(self.totalPotET > 0.0, \ + pcr.roundup((self.irrGrossDemand + pcr.max(self.readAvlWater, self.soilWaterStorage))/ self.totalPotET), 1.0))) + # - irrigation demand - limited by potential evaporation for the next coming days + self.irrGrossDemand = pcr.min(pcr.max(0.0,\ + self.totalPotET * irrigation_interval - pcr.max(self.readAvlWater, self.soilWaterStorage)),\ + self.irrGrossDemand) + + # assume that smart farmers do not irrigate higher than infiltration capacities + if self.numberOfLayers == 2: self.irrGrossDemand = pcr.min(self.irrGrossDemand, self.parameters.kSatUpp) + if self.numberOfLayers == 3: self.irrGrossDemand = pcr.min(self.irrGrossDemand, self.parameters.kSatUpp000005) + + # irrigation efficiency, minimum demand for start irrigating and maximum value to cap excessive demand + if self.includeIrrigation: + + # irrigation efficiency # TODO: Improve the concept of irrigation efficiency + self.irrigationEfficiencyUsed = pcr.min(1.0, pcr.max(0.10, self.irrigationEfficiency)) + # demand, including its inefficiency + self.irrGrossDemand = pcr.cover(self.irrGrossDemand / pcr.min(1.0, self.irrigationEfficiencyUsed), 0.0) + + # the following irrigation demand is not limited to available water + self.irrGrossDemand = pcr.ifthen(self.landmask, self.irrGrossDemand) + + # reduce irrGrossDemand by netLqWaterToSoil + self.irrGrossDemand = pcr.max(0.0, self.irrGrossDemand - self.netLqWaterToSoil) + + # minimum demand for start irrigating + minimum_demand = 0.005 # unit: m/day # TODO: set the minimum demand in the ini/configuration file. + if self.name == 'irrPaddy' or\ + self.name == 'irr_paddy': minimum_demand = pcr.min(self.minTopWaterLayer, 0.025) # TODO: set the minimum demand in the ini/configuration file. + self.irrGrossDemand = pcr.ifthenelse(self.irrGrossDemand > minimum_demand, \ + self.irrGrossDemand , 0.0) + + maximum_demand = 0.025 # unit: m/day # TODO: set the maximum demand in the ini/configuration file. + if self.name == 'irrPaddy' or\ + self.name == 'irr_paddy': maximum_demand = pcr.min(self.minTopWaterLayer, 0.025) # TODO: set the minimum demand in the ini/configuration file. + self.irrGrossDemand = pcr.min(maximum_demand, self.irrGrossDemand) + + # ignore small irrigation demand (less than 1 mm) + self.irrGrossDemand = pcr.rounddown( self.irrGrossDemand *1000.)/1000. + + # irrigation demand is only calculated for areas with fracVegCover > 0 # DO WE NEED THIS ? + self.irrGrossDemand = pcr.ifthenelse(self.fracVegCover > 0.0, self.irrGrossDemand, 0.0) + + # total irrigation gross demand (m) per cover types (not limited by available water) + self.totalPotentialMaximumIrrGrossDemandPaddy = 0.0 + self.totalPotentialMaximumIrrGrossDemandNonPaddy = 0.0 + if self.name == 'irrPaddy' or self.name == 'irr_paddy': self.totalPotentialMaximumIrrGrossDemandPaddy = self.irrGrossDemand + if self.name == 'irrNonPaddy' or self.name == 'irr_non_paddy' or self.name == 'irr_non_paddy_crops': self.totalPotentialMaximumIrrGrossDemandNonPaddy = self.irrGrossDemand + + # non irrigation demand is only calculated for areas with fracVegCover > 0 # DO WE NEED THIS ? + nonIrrGrossDemandDict['potential_demand']['domestic'] = pcr.ifthenelse(self.fracVegCover > 0.0, nonIrrGrossDemandDict['potential_demand']['domestic'] , 0.0) + nonIrrGrossDemandDict['potential_demand']['industry'] = pcr.ifthenelse(self.fracVegCover > 0.0, nonIrrGrossDemandDict['potential_demand']['industry'] , 0.0) + nonIrrGrossDemandDict['potential_demand']['livestock'] = pcr.ifthenelse(self.fracVegCover > 0.0, nonIrrGrossDemandDict['potential_demand']['livestock'], 0.0) + + # non irrigation water demand, including the livestock (not limited by available water) + self.nonIrrGrossDemand = nonIrrGrossDemandDict['potential_demand']['domestic'] +\ + nonIrrGrossDemandDict['potential_demand']['industry'] +\ + nonIrrGrossDemandDict['potential_demand']['livestock'] + + # total irrigation and livestock demand (not limited by available water) + totalIrrigationLivestockDemand = self.irrGrossDemand + nonIrrGrossDemandDict['potential_demand']['livestock'] + + # totalGrossDemand (m): irrigation and non irrigation (not limited by available water) - these values will not be reduced + self.totalPotentialMaximumGrossDemand = self.irrGrossDemand + self.nonIrrGrossDemand + # - irrigation (excluding livestock) + self.totalPotentialMaximumIrrGrossDemand = self.irrGrossDemand + # - non irrigation (including livestock) + self.totalPotentialMaximumNonIrrGrossDemand = self.nonIrrGrossDemand + + # the following value will be reduced by available/accesible water + self.totalPotentialGrossDemand = self.totalPotentialMaximumGrossDemand + + # Abstraction and Allocation of DESALINATED WATER + # ################################################################################################################## + # - desalination water to satisfy water demand + if self.usingAllocSegments: # using zone/segments at which networks are defined (as defined in the landSurface options) + # + logger.debug("Allocation of supply from desalination water.") + # + volDesalinationAbstraction, volDesalinationAllocation = \ + vos.waterAbstractionAndAllocation( + water_demand_volume = self.totalPotentialGrossDemand*routing.cellArea,\ + available_water_volume = pcr.max(0.00, desalinationWaterUse*routing.cellArea),\ + allocation_zones = allocSegments,\ + zone_area = self.segmentArea,\ + high_volume_treshold = 1000000.,\ + debug_water_balance = True,\ + extra_info_for_water_balance_reporting = str(currTimeStep.fulldate)) + # + self.desalinationAbstraction = volDesalinationAbstraction / routing.cellArea + self.desalinationAllocation = volDesalinationAllocation / routing.cellArea + # + else: + # + logger.debug("Supply from desalination water is only for satisfying local demand (no network).") + self.desalinationAbstraction = pcr.min(desalinationWaterUse, self.totalPotentialGrossDemand) + self.desalinationAllocation = self.desalinationAbstraction + # + self.desalinationAbstraction = pcr.ifthen(self.landmask, self.desalinationAbstraction) + self.desalinationAllocation = pcr.ifthen(self.landmask, self.desalinationAllocation) + # ################################################################################################################## + # - end of Abstraction and Allocation of DESALINATED WATER + + + # water demand that have been satisfied (unit: m/day) - after desalination + ################################################################################################################################ + # - for irrigation (excluding livestock) + satisfiedIrrigationDemand = vos.getValDivZero(self.irrGrossDemand, self.totalPotentialGrossDemand) * self.desalinationAllocation + # - for domestic, industry and livestock + satisfiedNonIrrDemand = pcr.max(0.00, self.desalinationAllocation - satisfiedIrrigationDemand) + # - for domestic + satisfiedDomesticDemand = satisfiedNonIrrDemand * vos.getValDivZero(nonIrrGrossDemandDict['potential_demand']['domestic'], + self.totalPotentialMaximumNonIrrGrossDemand) + # - for industry + satisfiedIndustryDemand = satisfiedNonIrrDemand * vos.getValDivZero(nonIrrGrossDemandDict['potential_demand']['industry'], + self.totalPotentialMaximumNonIrrGrossDemand) + # - for livestock + satisfiedLivestockDemand = pcr.max(0.0, satisfiedNonIrrDemand - satisfiedDomesticDemand - satisfiedIndustryDemand) + + + # total remaining gross demand (m/day) after desalination + ################################################################################################################################ + self.totalGrossDemandAfterDesalination = pcr.max(0.0, self.totalPotentialGrossDemand - self.desalinationAllocation) + # the remaining water demand per sector + # - for domestic + remainingDomestic = pcr.max(0.0, nonIrrGrossDemandDict['potential_demand']['domestic'] - satisfiedDomesticDemand) + # - for industry + remainingIndustry = pcr.max(0.0, nonIrrGrossDemandDict['potential_demand']['industry'] - satisfiedIndustryDemand) + # - for livestock + remainingLivestock = pcr.max(0.0, nonIrrGrossDemandDict['potential_demand']['livestock'] - satisfiedLivestockDemand) + # - for irrigation (excluding livestock) + remainingIrrigation = pcr.max(0.0, self.irrGrossDemand - satisfiedIrrigationDemand) + # - total for livestock and irrigation + remainingIrrigationLivestock = remainingIrrigation + remainingLivestock + # - total for industrial and domestic (excluding livestock) + remainingIndustrialDomestic = pcr.max(0.0, self.totalGrossDemandAfterDesalination - remainingIrrigationLivestock) + + + # Abstraction and Allocation of SURFACE WATER + ############################################################################################################################## + # calculate the estimate of surface water demand (considering by swAbstractionFractionDict) + # - for industrial and domestic + swAbstractionFraction_industrial_domestic = pcr.min(swAbstractionFractionDict['max_for_non_irrigation'],\ + swAbstractionFractionDict['estimate']) + surface_water_demand_estimate = swAbstractionFraction_industrial_domestic * remainingIndustrialDomestic + # - for irrigation and livestock + surface_water_irrigation_demand_estimate = swAbstractionFractionDict['irrigation'] * remainingIrrigationLivestock + # - surface water source as priority if groundwater irrigation fraction is relatively low + surface_water_irrigation_demand_estimate = \ + pcr.ifthenelse(swAbstractionFractionDict['irrigation'] >= swAbstractionFractionDict['treshold_to_maximize_irrigation_surface_water'],\ + remainingIrrigationLivestock, surface_water_irrigation_demand_estimate) + # - update estimate of surface water demand withdrawal (unit: m/day) + surface_water_demand_estimate += surface_water_irrigation_demand_estimate + # - prioritize surface water use in non productive aquifers that have limited groundwater supply + surface_water_demand_estimate = pcr.ifthenelse(groundwater.productive_aquifer, surface_water_demand_estimate,\ + pcr.max(0.0, remainingIrrigationLivestock - \ + pcr.min(groundwater.avgAllocationShort, groundwater.avgAllocation))) + # - maximize/optimize surface water use in areas with the overestimation of groundwater supply + surface_water_demand_estimate += pcr.max(0.0, pcr.max(groundwater.avgAllocationShort, groundwater.avgAllocation) -\ + (1.0 - swAbstractionFractionDict['irrigation']) * totalIrrigationLivestockDemand -\ + (1.0 - swAbstractionFraction_industrial_domestic) * (self.totalPotentialMaximumGrossDemand - totalIrrigationLivestockDemand)) + # + # total demand (unit: m/day) that should be allocated from surface water + # (corrected/limited by swAbstractionFractionDict and limited by the remaining demand) + surface_water_demand_estimate = pcr.min(self.totalGrossDemandAfterDesalination, surface_water_demand_estimate) + correctedRemainingIrrigationLivestock = pcr.min(surface_water_demand_estimate, remainingIrrigationLivestock) + correctedRemainingIndustrialDomestic = pcr.min(remainingIndustrialDomestic,\ + pcr.max(0.0, surface_water_demand_estimate - remainingIrrigationLivestock)) + correctedSurfaceWaterDemandEstimate = correctedRemainingIrrigationLivestock + correctedRemainingIndustrialDomestic + surface_water_demand = correctedSurfaceWaterDemandEstimate + # + # if surface water abstraction as the first priority + if self.surfaceWaterPiority: surface_water_demand = self.totalGrossDemandAfterDesalination + # + if self.usingAllocSegments: # using zone/segment at which supply network is defined + # + logger.debug("Allocation of surface water abstraction.") + # + volActSurfaceWaterAbstract, volAllocSurfaceWaterAbstract = \ + vos.waterAbstractionAndAllocation( + water_demand_volume = surface_water_demand*routing.cellArea,\ + available_water_volume = pcr.max(0.00, routing.readAvlChannelStorage),\ + allocation_zones = allocSegments,\ + zone_area = self.segmentArea,\ + high_volume_treshold = 1000000.,\ + debug_water_balance = True,\ + extra_info_for_water_balance_reporting = str(currTimeStep.fulldate)) + # + self.actSurfaceWaterAbstract = volActSurfaceWaterAbstract / routing.cellArea + self.allocSurfaceWaterAbstract = volAllocSurfaceWaterAbstract / routing.cellArea + # + else: + logger.debug("Surface water abstraction is only to satisfy local demand (no surface water network).") + self.actSurfaceWaterAbstract = pcr.min(routing.readAvlChannelStorage/routing.cellArea,\ + surface_water_demand) # unit: m + self.allocSurfaceWaterAbstract = self.actSurfaceWaterAbstract # unit: m + # + self.actSurfaceWaterAbstract = pcr.ifthen(self.landmask, self.actSurfaceWaterAbstract) + self.allocSurfaceWaterAbstract = pcr.ifthen(self.landmask, self.allocSurfaceWaterAbstract) + ################################################################################################################################ + # - end of Abstraction and Allocation of SURFACE WATER - # reduced irrGrossDemand by netLqWaterToSoil - self.irrGrossDemand = pcr.max(0.0, self.irrGrossDemand - self.netLqWaterToSoil) - # ignore small demand < 0.1 mm - self.irrGrossDemand = pcr.rounddown(self.irrGrossDemand*10000.)/10000. + # water demand that have been satisfied (unit: m/day) - after desalination and surface water supply + ################################################################################################################################ + # - for irrigation and livestock water demand + satisfiedIrrigationLivestockDemandFromSurfaceWater = self.allocSurfaceWaterAbstract * \ + vos.getValDivZero(correctedRemainingIrrigationLivestock, correctedSurfaceWaterDemandEstimate) + # - for irrigation water demand, but not including livestock + satisfiedIrrigationDemandFromSurfaceWater = satisfiedIrrigationLivestockDemandFromSurfaceWater * \ + vos.getValDivZero(remainingIrrigation, remainingIrrigationLivestock) + satisfiedIrrigationDemand += satisfiedIrrigationDemandFromSurfaceWater + # - for non irrigation water demand: livestock, domestic and industry + satisfiedNonIrrDemandFromSurfaceWater = pcr.max(0.0, self.allocSurfaceWaterAbstract - satisfiedIrrigationDemandFromSurfaceWater) + satisfiedNonIrrDemand += satisfiedNonIrrDemandFromSurfaceWater + # - for livestock + satisfiedLivestockDemand += pcr.max(0.0, satisfiedIrrigationLivestockDemandFromSurfaceWater - \ + satisfiedIrrigationDemandFromSurfaceWater) + # - for industrial and domestic demand (excluding livestock) + satisfiedIndustrialDomesticDemandFromSurfaceWater = pcr.max(0.0, self.allocSurfaceWaterAbstract -\ + satisfiedIrrigationLivestockDemandFromSurfaceWater) + # - for domestic + satisfiedDomesticDemand += satisfiedIndustrialDomesticDemandFromSurfaceWater * vos.getValDivZero(remainingDomestic, \ + remainingIndustrialDomestic) + # - for industry + satisfiedIndustryDemand += satisfiedIndustrialDomesticDemandFromSurfaceWater * vos.getValDivZero(remainingIndustry, \ + remainingIndustrialDomestic) + + + + ###################################################################################################################### + # water demand (unit: m) that must be satisfied by groundwater abstraction (not limited to available water) + self.potGroundwaterAbstract = pcr.max(0.0, self.totalGrossDemandAfterDesalination - self.allocSurfaceWaterAbstract) + ###################################################################################################################### + # water demand per sector + # - for domestic + remainingDomestic = pcr.max(0.0, nonIrrGrossDemandDict['potential_demand']['domestic'] - satisfiedDomesticDemand) + # - for industry + remainingIndustry = pcr.max(0.0, nonIrrGrossDemandDict['potential_demand']['industry'] - satisfiedIndustryDemand) + # - for livestock + remainingLivestock = pcr.max(0.0, nonIrrGrossDemandDict['potential_demand']['livestock'] - satisfiedLivestockDemand) + # - for irrigation (excluding livestock) + remainingIrrigation = pcr.max(0.0, self.irrGrossDemand - satisfiedIrrigationDemand) + # - total for livestock and irrigation + remainingIrrigationLivestock = remainingIrrigation + remainingLivestock + # - total for industrial and domestic (excluding livestock) + remainingIndustrialDomestic = remainingIndustry + remainingDomestic + - # totalPotentialGrossDemand (m): total maximum (potential) water demand: irrigation and non irrigation - self.totalPotentialGrossDemand = pcr.cover(self.nonIrrGrossDemand + self.irrGrossDemand, 0.0) - # surface water demand (m): water demand that should be satisfied by surface water abstraction - surface_water_demand = self.totalPotentialGrossDemand * swAbstractionFraction + # Abstraction and Allocation of GROUNDWATER (fossil and non fossil) + ######################################################################################################################### + # estimating groundwater water demand: + # - demand for industrial and domestic sectors + # (all remaining demand for these sectors should be satisfied) + groundwater_demand_estimate = remainingIndustrialDomestic + # - demand for irrigation and livestock sectors + # (only part of them will be satisfied, as they may be too high due to the uncertainty in the irrigation scheme) + irrigationLivestockGroundwaterDemand = pcr.min(remainingIrrigationLivestock, \ + pcr.max(0.0, \ + (1.0 - swAbstractionFractionDict['irrigation'])*totalIrrigationLivestockDemand)) + groundwater_demand_estimate += irrigationLivestockGroundwaterDemand + + + ##################################################################################################### + # water demand that must be satisfied by groundwater abstraction (not limited to available water) + self.potGroundwaterAbstract = pcr.min(self.potGroundwaterAbstract, groundwater_demand_estimate) + ##################################################################################################### - # surface water abstraction that can be extracted to satisfy totalPotentialGrossDemand - # - based on readAvlChannelStorage - # and swAbstractionFraction * totalPotGrossDemand - # - if self.usingAllocSegments: # using zone/segment at which supply network is defined + # constraining groundwater abstraction with the regional annual pumping capacity + if groundwater.limitRegionalAnnualGroundwaterAbstraction: - logger.info("Allocation of surface water abstraction in progress.") - - allocSegments = pcr.ifthen(self.landmask, allocSegments) - - # gross demand volume in each cell (unit: m3) - ignore small values (less than 1 m3) - cellVolGrossDemand = pcr.rounddown(surface_water_demand*routing.cellArea) - - # total gross demand volume in each segment/zone (unit: m3) - segTtlGrossDemand = pcr.areatotal(cellVolGrossDemand, allocSegments) - - # total available surface water volume in each cell - ignore small values (less than 1 m3) - cellAvlSurfaceWater = pcr.max(0.00, routing.readAvlChannelStorage) - cellAvlSurfaceWater = pcr.rounddown(cellAvlSurfaceWater) - - # total available surface water volume in each segment/zone (unit: m3) - segAvlSurfaceWater = pcr.areatotal(cellAvlSurfaceWater, allocSegments) - segAvlSurfaceWater = pcr.max(0.00, segAvlSurfaceWater) - - # total actual surface water abstraction volume in each segment/zone (unit: m3) - # - # - not limited to available water - segActSurWaterAbs = segTtlGrossDemand - # - # - limited to available water - segActSurWaterAbs = pcr.min(segAvlSurfaceWater, segActSurWaterAbs) - - # actual surface water abstraction volume in each cell (unit: m3) - volActSurfaceWaterAbstract = vos.getValDivZero(\ - cellAvlSurfaceWater, segAvlSurfaceWater, vos.smallNumber) * \ - segActSurWaterAbs - volActSurfaceWaterAbstract = pcr.min(cellAvlSurfaceWater, volActSurfaceWaterAbstract) # unit: m3 - - # actual surface water abstraction volume in meter (unit: m) - self.actSurfaceWaterAbstract = pcr.ifthen(self.landmask, volActSurfaceWaterAbstract) /\ - routing.cellArea # unit: m - - # allocation surface water abstraction volume to each cell (unit: m3) - volAllocSurfaceWaterAbstract = vos.getValDivZero(\ - cellVolGrossDemand, segTtlGrossDemand, vos.smallNumber) *\ - segActSurWaterAbs # unit: m3 - - # allocation surface water abstraction in meter (unit: m) - self.allocSurfaceWaterAbstract = pcr.ifthen(self.landmask, volAllocSurfaceWaterAbstract) /\ - routing.cellArea # unit: m + logger.debug('Total groundwater abstraction is limited by regional annual pumping capacity.') - if self.debugWaterBalance == str('True'): - - abstraction = pcr.cover(pcr.areatotal(self.actSurfaceWaterAbstract *routing.cellArea, self.allocSegments)/self.segmentArea, 0.0) - allocation = pcr.cover(pcr.areatotal(self.allocSurfaceWaterAbstract*routing.cellArea, self.allocSegments)/self.segmentArea, 0.0) - - vos.waterBalanceCheck([abstraction],\ - [allocation],\ - [pcr.scalar(0.0)],\ - [pcr.scalar(0.0)],\ - 'surface water abstraction - allocation per zone/segment in land cover level (PS: Error here may be caused by rounding error.)' ,\ - True,\ - "",threshold=5e-4) + # estimate of total groundwater abstraction (m3) from the last 365 days: + tolerating_days = 0. + annualGroundwaterAbstraction = groundwater.avgAbstraction * routing.cellArea *\ + pcr.min(pcr.max(0.0, 365.0 - tolerating_days), routing.timestepsToAvgDischarge) + # total groundwater abstraction (m3) from the last 365 days at the regional scale + regionalAnnualGroundwaterAbstraction = pcr.areatotal(pcr.cover(annualGroundwaterAbstraction, 0.0), groundwater_pumping_region_ids) - else: - - logger.info("Surface water abstraction is only to satisfy local demand (no surface water network).") + #~ # reduction factor to reduce groundwater abstraction/demand + #~ reductionFactorForPotGroundwaterAbstract = pcr.cover(\ + #~ pcr.ifthenelse(regionalAnnualGroundwaterAbstractionLimit > 0.0, + #~ pcr.max(0.000, regionalAnnualGroundwaterAbstractionLimit -\ + #~ regionalAnnualGroundwaterAbstraction) / + #~ regionalAnnualGroundwaterAbstractionLimit , 0.0), 0.0) - # only local surface water abstraction is allowed (network is only within a cell) - self.actSurfaceWaterAbstract = pcr.min(routing.readAvlChannelStorage/routing.cellArea,\ - surface_water_demand) # unit: m - self.allocSurfaceWaterAbstract = self.actSurfaceWaterAbstract # unit: m + #~ # reduced potential groundwater abstraction (after pumping capacity) + #~ self.potGroundwaterAbstract = pcr.min(1.00, reductionFactorForPotGroundwaterAbstract) * self.potGroundwaterAbstract - self.actSurfaceWaterAbstract = pcr.ifthen(self.landmask, self.actSurfaceWaterAbstract) - self.allocSurfaceWaterAbstract = pcr.ifthen(self.landmask, self.allocSurfaceWaterAbstract) - - self.potGroundwaterAbstract = pcr.max(0.0, self.totalPotentialGrossDemand - self.allocSurfaceWaterAbstract) # unit: m - - # if limitAbstraction == 'True' - # - no fossil gwAbstraction. - # - limitting abstraction with avlWater in channelStorage (m3) and storGroundwater (m) - # - water demand may be reduced - # - self.reducedCapRise = 0.0 # variable to reduce/limit groundwater abstraction (> 0 if limitAbstraction = True) - # - if self.limitAbstraction: + #~ # alternative: reduced potential groundwater abstraction (after pumping capacity) and considering the average recharge (baseflow) + #~ potGroundwaterAbstract = pcr.min(1.00, reductionFactorForPotGroundwaterAbstract) * self.potGroundwaterAbstract + #~ self.potGroundwaterAbstract = pcr.min(self.potGroundwaterAbstract, + #~ potGroundwaterAbstract + pcr.max(0.0, routing.avgBaseflow / routing.cellArea)) - logger.info('Fossil groundwater abstractions are NOT allowed.') - # calculate renewableAvlWater (non-fossil groundwater and channel) + + ################## NEW METHOD ################################################################################################################# + # the remaining pumping capacity (unit: m3) at the regional scale + remainingRegionalAnnualGroundwaterAbstractionLimit = pcr.max(0.0, regionalAnnualGroundwaterAbstractionLimit - \ + regionalAnnualGroundwaterAbstraction) + # considering safety factor (residence time in day-1) + remainingRegionalAnnualGroundwaterAbstractionLimit *= 0.33 - # - from storGroundwater - # -- avoid small values - readAvlStorGroundwater = pcr.rounddown(groundwater.storGroundwater*10000.)/10000. - readAvlStorGroundwater = pcr.cover(readAvlStorGroundwater, 0.0) + # the remaining pumping capacity (unit: m3) limited by self.potGroundwaterAbstract (at the regional scale) + remainingRegionalAnnualGroundwaterAbstractionLimit = pcr.min(remainingRegionalAnnualGroundwaterAbstractionLimit,\ + pcr.areatotal(self.potGroundwaterAbstract * routing.cellArea, groundwater_pumping_region_ids)) - # - from non-fossil groundwater and surface water bodies - renewableAvlWater = readAvlStorGroundwater + self.allocSurfaceWaterAbstract + # the remaining pumping capacity (unit: m3) at the pixel scale - downscaled using self.potGroundwaterAbstract + remainingPixelAnnualGroundwaterAbstractionLimit = remainingRegionalAnnualGroundwaterAbstractionLimit * \ + vos.getValDivZero(self.potGroundwaterAbstract * routing.cellArea, pcr.areatotal(self.potGroundwaterAbstract * routing.cellArea, groundwater_pumping_region_ids)) + + # reduced (after pumping capacity) potential groundwater abstraction/demand (unit: m) and considering the average recharge (baseflow) + self.potGroundwaterAbstract = pcr.min(self.potGroundwaterAbstract, \ + remainingPixelAnnualGroundwaterAbstractionLimit/routing.cellArea + pcr.max(0.0, routing.avgBaseflow / routing.cellArea)) + ################## end of NEW METHOD (but still under development) ########################################################################################################## - # reducing nonIrrGrossDemand < renewableAvlWater - # - self.nonIrrGrossDemand = \ - pcr.ifthenelse(self.totalPotentialGrossDemand > 0.0, \ - pcr.min(1.0,pcr.max(0.0, \ - vos.getValDivZero(renewableAvlWater, self.totalPotentialGrossDemand, vos.smallNumber)))*self.nonIrrGrossDemand, 0.0) - # reducing irrGrossWaterDemand < renewableAvlWater - # - self.irrGrossDemand = \ - pcr.ifthenelse(self.totalPotentialGrossDemand > 0.0, \ - pcr.min(1.0,pcr.max(0.0, \ - vos.getValDivZero(renewableAvlWater, self.totalPotentialGrossDemand, vos.smallNumber)))* self.irrGrossDemand, 0.0) - # correcting total demand - self.totalPotentialGrossDemand = self.nonIrrGrossDemand + self.irrGrossDemand - - # potential groundwater abstraction (must be equal to actual no fossil groundwater abstraction) - self.potGroundwaterAbstract = self.nonIrrGrossDemand + self.irrGrossDemand - self.allocSurfaceWaterAbstract + #~ # Shall we will always try to fulfil the industrial and domestic demand? + #~ self.potGroundwaterAbstract = pcr.max(remainingIndustrialDomestic, self.potGroundwaterAbstract) + - # variable to reduce/limit capillary rise (to ensure that there are enough water for supplying nonIrrGrossDemand + irrGrossDemand) - self.reducedCapRise = self.potGroundwaterAbstract - else: - logger.info('Fossil groundwater abstraction is allowed.') + logger.debug('NO LIMIT for regional groundwater (annual) pumping. It may result too high groundwater abstraction.') + - if self.limitAbstraction == False and\ - groundwater.limitFossilGroundwaterAbstraction and groundwater.usingAllocSegments == False: + # Abstraction and Allocation of NON-FOSSIL GROUNDWATER + # ############################################################################################################################# + # available storGroundwater (non fossil groundwater) that can be accessed (unit: m) + readAvlStorGroundwater = pcr.cover(pcr.max(0.00, groundwater.storGroundwater), 0.0) + # - considering maximum daily groundwater abstraction + readAvlStorGroundwater = pcr.min(readAvlStorGroundwater, groundwater.maximumDailyGroundwaterAbstraction) + # - ignore groundwater storage in non-productive aquifer + readAvlStorGroundwater = pcr.ifthenelse(groundwater.productive_aquifer, readAvlStorGroundwater, 0.0) + + # for non-productive aquifer, reduce readAvlStorGroundwater to the current recharge/baseflow rate + readAvlStorGroundwater = pcr.ifthenelse(groundwater.productive_aquifer, \ + readAvlStorGroundwater, pcr.min(readAvlStorGroundwater, pcr.max(routing.avgBaseflow, 0.0))) + + # avoid the condition that the entire groundwater volume abstracted instantaneously + readAvlStorGroundwater *= 0.75 - # Note: For simplicity, limitFossilGroundwaterAbstraction can only be combined with local (groundwater) source assumption + if groundwater.usingAllocSegments: - logger.info('Fossil groundwater abstraction is allowed with LIMIT.') + logger.debug('Allocation of non fossil groundwater abstraction.') - # calculate renewableAvlWater (non-fossil groundwater and channel) + # TODO: considering aquifer productivity while doing the allocation (e.g. using aquifer transmissivity/conductivity) - # - from storGroundwater - # -- avoid small values - readAvlStorGroundwater = pcr.rounddown(groundwater.storGroundwater*10000.)/10000. - readAvlStorGroundwater = pcr.cover(readAvlStorGroundwater, 0.0) + # non fossil groundwater abstraction and allocation in volume (unit: m3) + volActGroundwaterAbstract, volAllocGroundwaterAbstract = \ + vos.waterAbstractionAndAllocation( + water_demand_volume = self.potGroundwaterAbstract*routing.cellArea,\ + available_water_volume = pcr.max(0.00, readAvlStorGroundwater*routing.cellArea),\ + allocation_zones = groundwater.allocSegments,\ + zone_area = groundwater.segmentArea,\ + high_volume_treshold = 1000000.,\ + debug_water_balance = True,\ + extra_info_for_water_balance_reporting = str(currTimeStep.fulldate)) - # - from non-fossil groundwater and surface water bodies - renewableAvlWater = readAvlStorGroundwater + self.allocSurfaceWaterAbstract - - # estimate of demand that will be satisfied by renewableAvlWater - allocRenewableAvlWater = pcr.min(renewableAvlWater, self.totalPotentialGrossDemand) + # non fossil groundwater abstraction and allocation in meter + self.nonFossilGroundwaterAbs = volActGroundwaterAbstract / routing.cellArea + self.allocNonFossilGroundwater = volAllocGroundwaterAbstract/ routing.cellArea - # variable to reduce/limit capillary rise (to ensure that there are enough water for supplying nonIrrGrossDemand + irrGrossDemand) - self.reducedCapRise = allocRenewableAvlWater - self.allocSurfaceWaterAbstract + else: + + logger.debug('Non fossil groundwater abstraction is only for satisfying local demand.') + self.nonFossilGroundwaterAbs = pcr.min(readAvlStorGroundwater, self.potGroundwaterAbstract) + self.allocNonFossilGroundwater = self.nonFossilGroundwaterAbs + ################################################################################################################################ + # - end of Abstraction and Allocation of NON FOSSIL GROUNDWATER - # calculate accessibleWater (unit: m) - accessibleWater = pcr.max(0.0,\ - self.allocSurfaceWaterAbstract +\ - groundwater.storGroundwater +\ - groundwater.storGroundwaterFossil) - # total nonIrrGrossDemand < accessibleWater - self.nonIrrGrossDemand = \ - pcr.ifthenelse(self.totalPotentialGrossDemand > 0.0, \ - pcr.min(1.0,pcr.max(0.0, \ - vos.getValDivZero(accessibleWater, self.totalPotentialGrossDemand, vos.smallNumber)))*self.nonIrrGrossDemand, 0.0) + ################################################################################################################################ + # variable to reduce capillary rise in order to ensure there is always enough water to supply non fossil groundwater abstraction + self.reducedCapRise = self.nonFossilGroundwaterAbs + # TODO: Check do we need this for runs with MODFLOW ??? + ################################################################################################################################ - # total irrGrossWaterDemand < accessibleWater - self.irrGrossDemand = \ - pcr.ifthenelse(self.totalPotentialGrossDemand > 0.0, \ - pcr.min(1.0,pcr.max(0.0, \ - vos.getValDivZero(accessibleWater, self.totalPotentialGrossDemand, vos.smallNumber)))* self.irrGrossDemand, 0.0) - # correcting total demand - self.totalPotentialGrossDemand = self.nonIrrGrossDemand + self.irrGrossDemand + + # water demand that have been satisfied (unit: m/day) - after desalination, surface water and non-fossil groundwater supply + ################################################################################################################################ + # - for irrigation and livestock water demand + satisfiedIrrigationLivestockDemandFromNonFossilGroundwater = self.allocNonFossilGroundwater * \ + vos.getValDivZero(irrigationLivestockGroundwaterDemand, groundwater_demand_estimate) + # - for irrigation water demand, but not including livestock + satisfiedIrrigationDemandFromNonFossilGroundwater = satisfiedIrrigationLivestockDemandFromNonFossilGroundwater * \ + vos.getValDivZero(remainingIrrigation, remainingIrrigationLivestock) + satisfiedIrrigationDemand += satisfiedIrrigationDemandFromNonFossilGroundwater + # - for non irrigation water demand: livestock, domestic and industry + satisfiedNonIrrDemandFromNonFossilGroundwater = pcr.max(0.0, self.allocNonFossilGroundwater - satisfiedIrrigationLivestockDemandFromNonFossilGroundwater) + satisfiedNonIrrDemand += satisfiedNonIrrDemandFromNonFossilGroundwater + # - for livestock + satisfiedLivestockDemand += pcr.max(0.0, satisfiedIrrigationLivestockDemandFromNonFossilGroundwater - \ + satisfiedIrrigationDemandFromNonFossilGroundwater) + # - for industrial and domestic demand (excluding livestock) + satisfiedIndustrialDomesticDemandFromNonFossilGroundwater = pcr.max(0.0, self.allocNonFossilGroundwater -\ + satisfiedIrrigationLivestockDemandFromNonFossilGroundwater) + # - for domestic + satisfiedDomesticDemand += satisfiedIndustrialDomesticDemandFromNonFossilGroundwater * vos.getValDivZero(remainingDomestic, remainingIndustrialDomestic) + # - for industry + satisfiedIndustryDemand += satisfiedIndustrialDomesticDemandFromNonFossilGroundwater * vos.getValDivZero(remainingIndustry, remainingIndustrialDomestic) + + + + ###################################################################################################################### + ###################################################################################################################### + # water demand that must be satisfied by fossil groundwater abstraction (unit: m, not limited to available water) + self.potFossilGroundwaterAbstract = pcr.max(0.0, self.potGroundwaterAbstract - \ + self.allocNonFossilGroundwater) + ###################################################################################################################### + ###################################################################################################################### + + + # For a run using MODFLOW, the concept of fossil groundwater abstraction is abandoned (self.limitAbstraction == True): + if groundwater.useMODFLOW or self.limitAbstraction: + logger.debug('Fossil groundwater abstractions are NOT allowed') + self.fossilGroundwaterAbstr = pcr.scalar(0.0) + self.fossilGroundwaterAlloc = pcr.scalar(0.0) + + + # Abstraction and Allocation of FOSSIL GROUNDWATER + # ##################################################################################################################################### + + if self.limitAbstraction == False: # TODO: For runs without any water use, we can exclude this. - # potential groundwater abstraction (m/day) - self.potGroundwaterAbstract = self.totalPotentialGrossDemand - self.allocSurfaceWaterAbstract + logger.debug('Fossil groundwater abstractions are allowed.') - if groundwater.limitRegionalAnnualGroundwaterAbstraction: - - logger.info('Total groundwater abstraction is limited by regional annual pumping capacity.') + # the remaining water demand (m/day) for all sectors - NOT limited to self.potFossilGroundwaterAbstract + ##################################################################################################################### + # - for domestic + remainingDomestic = pcr.max(0.0, nonIrrGrossDemandDict['potential_demand']['domestic'] - satisfiedDomesticDemand) + # - for industry + remainingIndustry = pcr.max(0.0, nonIrrGrossDemandDict['potential_demand']['industry'] - satisfiedIndustryDemand) + # - for livestock + remainingLivestock = pcr.max(0.0, nonIrrGrossDemandDict['potential_demand']['livestock'] - satisfiedLivestockDemand) + # - for irrigation (excluding livestock) + remainingIrrigation = pcr.max(0.0, self.irrGrossDemand - satisfiedIrrigationDemand) + # - total for livestock and irrigation + remainingIrrigationLivestock = remainingIrrigation + remainingLivestock + # - total for industrial and domestic (excluding livestock) + remainingIndustrialDomestic = remainingIndustry + remainingDomestic + # - remaining total demand + remainingTotalDemand = remainingIrrigationLivestock + remainingIndustrialDomestic + + + # constraining fossil groundwater abstraction with regional pumping capacity + if groundwater.limitRegionalAnnualGroundwaterAbstraction and self.limitAbstraction == False: + + logger.debug('Fossil groundwater abstraction is allowed, BUT limited by the regional annual pumping capacity.') # estimate of total groundwater abstraction (m3) from the last 365 days: - annualGroundwaterAbstraction = groundwater.avgAbstraction * routing.cellArea *\ - pcr.min(365., routing.timestepsToAvgDischarge) - # at regional scale - regionalAnnualGroundwaterAbstraction = pcr.areatotal(pcr.cover(annualGroundwaterAbstraction, 0.0),\ - groundwater.region_ids) - - # reduction factor to reduce groundwater abstraction - reductionFactorForPotGroundwaterAbstract = pcr.ifthenelse(regionalAnnualGroundwaterAbstraction > 0.0, - pcr.max(0.00, groundwater.regionalAnnualGroundwaterAbstractionLimit -\ - regionalAnnualGroundwaterAbstraction) / - regionalAnnualGroundwaterAbstraction, 1.0) - reductionFactorForPotGroundwaterAbstract = pcr.rounddown(reductionFactorForPotGroundwaterAbstract*100.)/100. - reductionFactorForPotGroundwaterAbstract = pcr.min(1.00, reductionFactorForPotGroundwaterAbstract) + # - considering abstraction from non fossil groundwater + annualGroundwaterAbstraction += self.nonFossilGroundwaterAbs*routing.cellArea + # at the regional scale + regionalAnnualGroundwaterAbstraction = pcr.areatotal(pcr.cover(annualGroundwaterAbstraction, 0.0), groundwater_pumping_region_ids) - # potential groundwater abstraction (m/day) after reduction - self.potGroundwaterAbstract *= reductionFactorForPotGroundwaterAbstract + # fossil groundwater demand/asbtraction reduced by pumping capacity (unit: m/day) + # - safety factor to avoid the remaining limit abstracted at once (due to overestimation of groundwater demand) + safety_factor_for_fossil_abstraction = 1.00 + self.potFossilGroundwaterAbstract *= pcr.min(1.00,\ + pcr.cover(\ + pcr.ifthenelse(regionalAnnualGroundwaterAbstractionLimit > 0.0, + pcr.max(0.000, regionalAnnualGroundwaterAbstractionLimit * safety_factor_for_fossil_abstraction-\ + regionalAnnualGroundwaterAbstraction) / + regionalAnnualGroundwaterAbstractionLimit , 0.0), 0.0)) - # calculate accessibleWater (unit: m) - accessibleWater = self.allocSurfaceWaterAbstract + self.potGroundwaterAbstract + #~ # Shall we will always try to fulfil the remaining industrial and domestic demand? + #~ self.potFossilGroundwaterAbstract = pcr.max(remainingIndustrialDomestic, self.potFossilGroundwaterAbstract) - # total nonIrrGrossDemand < accessibleWater - self.nonIrrGrossDemand = \ - pcr.ifthenelse(self.totalPotentialGrossDemand > 0.0, \ - pcr.min(1.0,pcr.max(0.0, \ - vos.getValDivZero(accessibleWater, self.totalPotentialGrossDemand, vos.smallNumber)))*self.nonIrrGrossDemand, 0.0) - # total irrGrossWaterDemand < accessibleWater - # - self.irrGrossDemand = \ - pcr.ifthenelse(self.totalPotentialGrossDemand > 0.0, \ - pcr.min(1.0,pcr.max(0.0, \ - vos.getValDivZero(accessibleWater, self.totalPotentialGrossDemand, vos.smallNumber)))* self.irrGrossDemand, 0.0) - - # correcting total demand - self.totalPotentialGrossDemand = self.nonIrrGrossDemand + self.irrGrossDemand - #~ # - should be the same as the following: - #~ self.totalPotentialGrossDemand = self.potGroundwaterAbstract + self.allocSurfaceWaterAbstract - - if self.debugWaterBalance:\ - vos.waterBalanceCheck([accessibleWater],\ - [self.totalPotentialGrossDemand],\ - [pcr.scalar(0.0)],\ - [pcr.scalar(0.0)],\ - 'totalPotentialGrossDemand (limitRegionalAnnualGroundwaterAbstraction)',\ - True,\ - currTimeStep.fulldate,threshold=1e-4) - def calculateDirectRunoff(self, parameters): + if self.limitAbstraction == False: # TODO: For runs without any water use, we can exclude this. + + + ############################################################################################################################### + # estimate the remaining total demand (unit: m/day) LIMITED to self.potFossilGroundwaterAbstract + ############################################################################################################################### + + correctedRemainingTotalDemand = pcr.min(self.potFossilGroundwaterAbstract, remainingTotalDemand) + + # the remaining industrial and domestic demand and livestock (unit: m/day) limited to self.potFossilGroundwaterAbstract + # - no correction, we will always try to fulfil these demands + correctedRemainingIndustrialDomesticLivestock = pcr.min(remainingIndustrialDomestic + remainingLivestock, correctedRemainingTotalDemand) + + # the remaining irrigation demand limited to self.potFossilGroundwaterAbstract + correctedRemainingIrrigation = pcr.min(remainingIrrigation, \ + pcr.max(0.0, correctedRemainingTotalDemand - correctedRemainingIndustrialDomesticLivestock)) + # - ignore small irrigation demand (less than 1 mm) + correctedRemainingIrrigation = pcr.rounddown(correctedRemainingIrrigation*1000.)/1000. + + # the (corrected) remaining total demand (limited to self.potFossilGroundwaterAbstract) + correctedRemainingTotalDemand = correctedRemainingIndustrialDomesticLivestock + correctedRemainingIrrigation + + # the (corrected) remaining industrial and domestic demand (excluding livestock) + correctedRemainingIndustrialDomestic = pcr.min(remainingIndustrialDomestic, correctedRemainingTotalDemand) + + # the remaining irrigation and livestock water demand limited to self.potFossilGroundwaterAbstract + correctedRemainingIrrigationLivestock = pcr.min(remainingIrrigationLivestock, \ + pcr.max(0.0, correctedRemainingTotalDemand - correctedRemainingIndustrialDomestic)) + + # the (corrected) remaining total demand (unit: m/day) limited to self.potFossilGroundwaterAbstract + correctedRemainingTotalDemand = correctedRemainingIrrigationLivestock + correctedRemainingIndustrialDomestic + + # TODO: Do the water balance check: correctedRemainingIrrigationLivestock + correctedRemainingIndustrialDomestic <= self.potFossilGroundwaterAbstract + + # constrain the irrigation groundwater demand with groundwater source fraction + correctedRemainingIrrigationLivestock = pcr.min((1.0 - swAbstractionFractionDict['irrigation']) * remainingIrrigationLivestock,\ + correctedRemainingIrrigationLivestock) + correctedRemainingIrrigationLivestock = pcr.max(0.0,\ + pcr.min(correctedRemainingIrrigationLivestock,\ + pcr.max(0.0, totalIrrigationLivestockDemand) * (1.0 - swAbstractionFractionDict['irrigation']) - satisfiedIrrigationDemandFromNonFossilGroundwater)) + + # ignore fossil groundwater abstraction in irrigation areas dominated by swAbstractionFractionDict['irrigation'] + correctedRemainingIrrigationLivestock = pcr.ifthenelse(\ + swAbstractionFractionDict['irrigation'] >= swAbstractionFractionDict['treshold_to_minimize_fossil_groundwater_irrigation'], 0.0,\ + correctedRemainingIrrigationLivestock) + + # reduce the fossil irrigation and livestock demands with enough supply of non fossil groundwater (in order to minimize unrealistic areas of fossil groundwater abstraction) + # - supply from the average recharge (baseflow) and non fossil groundwater allocation + nonFossilGroundwaterSupply = pcr.max(pcr.max(0.0, routing.avgBaseflow) / routing.cellArea, \ + groundwater.avgNonFossilAllocationShort, groundwater.avgNonFossilAllocation) + # - irrigation supply from the non fossil groundwater + nonFossilIrrigationGroundwaterSupply = nonFossilGroundwaterSupply * vos.getValDivZero(remainingIrrigationLivestock, remainingTotalDemand) + # - the corrected/reduced irrigation and livestock demand + correctedRemainingIrrigationLivestock = pcr.max(0.0, correctedRemainingIrrigationLivestock - nonFossilIrrigationGroundwaterSupply) + + # the corrected remaining total demand (unit: m/day) + correctedRemainingTotalDemand = correctedRemainingIndustrialDomestic + correctedRemainingIrrigationLivestock + + ############################################################################################################################### + + # water demand that must be satisfied by fossil groundwater abstraction + self.potFossilGroundwaterAbstract = pcr.min(self.potFossilGroundwaterAbstract, correctedRemainingTotalDemand) + + if groundwater.limitFossilGroundwaterAbstraction == False and self.limitAbstraction == False: + + # Note: If limitFossilGroundwaterAbstraction == False, + # allocation of fossil groundwater abstraction is not needed. + msg = 'Fossil groundwater abstractions are without limit for satisfying local demand. ' + msg = 'Allocation for fossil groundwater abstraction is NOT needed/implemented. ' + msg += 'However, the fossil groundwater abstraction rate still consider the maximumDailyGroundwaterAbstraction.' + logger.debug(msg) + + # fossil groundwater abstraction (unit: m/day) + self.fossilGroundwaterAbstr = self.potFossilGroundwaterAbstract + self.fossilGroundwaterAbstr = \ + pcr.min(\ + pcr.max(0.0, groundwater.maximumDailyGroundwaterAbstraction - self.nonFossilGroundwaterAbs), self.fossilGroundwaterAbstr) + + # fossil groundwater allocation (unit: m/day) + self.fossilGroundwaterAlloc = self.fossilGroundwaterAbstr + + if groundwater.limitFossilGroundwaterAbstraction and self.limitAbstraction == False: + + logger.debug('Fossil groundwater abstractions are allowed, but with limit.') + + # accesible fossil groundwater (unit: m/day) + readAvlFossilGroundwater = pcr.ifthenelse(groundwater.productive_aquifer, groundwater.storGroundwaterFossil, 0.0) + # - residence time (day-1) or safety factor (to avoid 'unrealistic' zero fossil groundwater) + readAvlFossilGroundwater *= 0.10 + # - considering maximum daily groundwater abstraction + readAvlFossilGroundwater = pcr.min(readAvlFossilGroundwater, groundwater.maximumDailyFossilGroundwaterAbstraction, \ + pcr.max(0.0, groundwater.maximumDailyGroundwaterAbstraction - self.nonFossilGroundwaterAbs)) + readAvlFossilGroundwater = pcr.max(pcr.cover(readAvlFossilGroundwater, 0.0), 0.0) + + if groundwater.usingAllocSegments: + + logger.debug('Allocation of fossil groundwater abstraction.') + + # TODO: considering aquifer productivity while doing the allocation. + + # fossil groundwater abstraction and allocation in volume (unit: m3) + volActGroundwaterAbstract, volAllocGroundwaterAbstract = \ + vos.waterAbstractionAndAllocation( + water_demand_volume = self.potFossilGroundwaterAbstract*routing.cellArea,\ + available_water_volume = pcr.max(0.00, readAvlFossilGroundwater*routing.cellArea),\ + allocation_zones = groundwater.allocSegments,\ + zone_area = groundwater.segmentArea,\ + high_volume_treshold = 1000000.,\ + debug_water_balance = True,\ + extra_info_for_water_balance_reporting = str(currTimeStep.fulldate)) + + # fossil groundwater abstraction and allocation in meter + self.fossilGroundwaterAbstr = volActGroundwaterAbstract /routing.cellArea + self.fossilGroundwaterAlloc = volAllocGroundwaterAbstract/routing.cellArea + + else: + + logger.debug('Fossil groundwater abstraction is only for satisfying local demand. NO Allocation for fossil groundwater abstraction.') + + self.fossilGroundwaterAbstr = pcr.min(pcr.max(0.0, readAvlFossilGroundwater), self.potFossilGroundwaterAbstract) + self.fossilGroundwaterAlloc = self.fossilGroundwaterAbstr + + + # water demand that have been satisfied (m/day) - after desalination, surface water, non fossil groundwater & fossil groundwater + ################################################################################################################################ + + # from fossil groundwater, we should prioritize domestic and industrial water demand + prioritizeFossilGroundwaterForDomesticIndutrial = False # TODO: Define this in the configuration file. + + if prioritizeFossilGroundwaterForDomesticIndutrial: + + # - first priority: for industrial and domestic demand (excluding livestock) + satisfiedIndustrialDomesticDemandFromFossilGroundwater = pcr.min(self.fossilGroundwaterAlloc, \ + remainingIndustrialDomestic) + # - for domestic + satisfiedDomesticDemand += satisfiedIndustrialDomesticDemandFromFossilGroundwater * vos.getValDivZero(remainingDomestic, \ + remainingIndustrialDomestic) + # - for industry + satisfiedIndustryDemand += satisfiedIndustrialDomesticDemandFromFossilGroundwater * vos.getValDivZero(remainingIndustry, \ + remainingIndustrialDomestic) + # - for irrigation and livestock demand + satisfiedIrrigationLivestockDemandFromFossilGroundwater = pcr.max(0.0, self.fossilGroundwaterAlloc - \ + satisfiedIndustrialDomesticDemandFromFossilGroundwater) + # - for irrigation + satisfiedIrrigationDemand += satisfiedIrrigationLivestockDemandFromFossilGroundwater * vos.getValDivZero(remainingIrrigation, \ + remainingIrrigationLivestock) + # - for livestock + satisfiedLivestockDemand += satisfiedIrrigationLivestockDemandFromFossilGroundwater * vos.getValDivZero(remainingLivestock, \ + remainingIrrigationLivestock) + + else: + + # Distribute fossil water proportionaly based on the amount of each sector + + # - for irrigation and livestock water demand + satisfiedIrrigationLivestockDemandFromFossilGroundwater = self.fossilGroundwaterAlloc * \ + vos.getValDivZero(correctedRemainingIrrigationLivestock, correctedRemainingTotalDemand) + # - for irrigation water demand, but not including livestock + satisfiedIrrigationDemandFromFossilGroundwater = satisfiedIrrigationLivestockDemandFromFossilGroundwater * \ + vos.getValDivZero(remainingIrrigation, remainingIrrigationLivestock) + satisfiedIrrigationDemand += satisfiedIrrigationDemandFromFossilGroundwater + # - for non irrigation water demand: livestock, domestic and industry + satisfiedNonIrrDemandFromFossilGroundwater = pcr.max(0.0, self.fossilGroundwaterAlloc - satisfiedIrrigationDemandFromFossilGroundwater) + satisfiedNonIrrDemand += satisfiedNonIrrDemandFromFossilGroundwater + # - for livestock + satisfiedLivestockDemand += pcr.max(0.0, satisfiedIrrigationLivestockDemandFromFossilGroundwater - \ + satisfiedIrrigationDemandFromFossilGroundwater) + # - for industrial and domestic demand (excluding livestock) + satisfiedIndustrialDomesticDemandFromFossilGroundwater = pcr.max(0.0, self.fossilGroundwaterAlloc - \ + satisfiedIrrigationLivestockDemandFromFossilGroundwater) + # - for domestic + satisfiedDomesticDemand += satisfiedIndustrialDomesticDemandFromFossilGroundwater * vos.getValDivZero(remainingDomestic, \ + remainingIndustrialDomestic) + # - for industry + satisfiedIndustryDemand += satisfiedIndustrialDomesticDemandFromFossilGroundwater * vos.getValDivZero(remainingIndustry, \ + remainingIndustrialDomestic) + + # water demand limited to available/allocated water + self.totalPotentialGrossDemand = self.fossilGroundwaterAlloc +\ + self.allocNonFossilGroundwater +\ + self.allocSurfaceWaterAbstract +\ + self.desalinationAllocation + + # total groundwater abstraction and allocation (unit: m/day) + self.totalGroundwaterAllocation = self.allocNonFossilGroundwater + self.fossilGroundwaterAlloc + self.totalGroundwaterAbstraction = self.fossilGroundwaterAbstr + self.nonFossilGroundwaterAbs + + # irrigation water demand (excluding livestock) limited to available/allocated water (unit: m/day) + self.irrGrossDemand = satisfiedIrrigationDemand # not including livestock + + # irrigation gross demand (m) per cover type (limited by available water) + self.irrGrossDemandPaddy = 0.0 + self.irrGrossDemandNonPaddy = 0.0 + if self.name == 'irrPaddy' or self.name == "irr_paddy": self.irrGrossDemandPaddy = self.irrGrossDemand + if self.name == 'irrNonPaddy' or self.name == "irr_non_paddy" or self.name == "irr_non_paddy_crops": self.irrGrossDemandNonPaddy = self.irrGrossDemand + + # non irrigation water demand (including livestock) limited to available/allocated water (unit: m/day) + self.nonIrrGrossDemand = pcr.max(0.0, \ + self.totalPotentialGrossDemand - self.irrGrossDemand) # livestock, domestic and industry + self.domesticWaterWithdrawal = satisfiedDomesticDemand + self.industryWaterWithdrawal = satisfiedIndustryDemand + self.livestockWaterWithdrawal = satisfiedLivestockDemand + + # return flow (unit: m/day) from non irrigation withdrawal (from domestic, industry and livestock) + self.nonIrrReturnFlow = nonIrrGrossDemandDict['return_flow_fraction']['domestic'] * self.domesticWaterWithdrawal +\ + nonIrrGrossDemandDict['return_flow_fraction']['industry'] * self.industryWaterWithdrawal +\ + nonIrrGrossDemandDict['return_flow_fraction']['livestock']* self.livestockWaterWithdrawal + # - ignore very small return flow (less than 0.1 mm) + self.nonIrrReturnFlow = pcr.rounddown(self.nonIrrReturnFlow * 10000.)/10000. + self.nonIrrReturnFlow = pcr.min(self.nonIrrReturnFlow, self.nonIrrGrossDemand) + + if self.debugWaterBalance: + vos.waterBalanceCheck([self.irrGrossDemand,\ + self.nonIrrGrossDemand],\ + [self.totalPotentialGrossDemand],\ + [pcr.scalar(0.0)],\ + [pcr.scalar(0.0)] ,\ + 'waterAllocationForAllSectors',True,\ + currTimeStep.fulldate,threshold=1e-4) + vos.waterBalanceCheck([self.domesticWaterWithdrawal,\ + self.industryWaterWithdrawal,\ + self.livestockWaterWithdrawal],\ + [self.nonIrrGrossDemand],\ + [pcr.scalar(0.0)],\ + [pcr.scalar(0.0)] ,\ + 'waterAllocationForNonIrrigationSectors',True,\ + currTimeStep.fulldate,threshold=1e-4) + vos.waterBalanceCheck([self.irrGrossDemand,\ + self.domesticWaterWithdrawal,\ + self.industryWaterWithdrawal,\ + self.livestockWaterWithdrawal],\ + [self.totalPotentialGrossDemand],\ + [pcr.scalar(0.0)],\ + [pcr.scalar(0.0)] ,\ + 'waterAllocationPerSector',True,\ + currTimeStep.fulldate,threshold=1e-4) + + # TODO: Perform water balance checks for all sources: desalination, surface water, non-fossil groundwater and fossil groundwater + + + + + + def calculateDirectRunoff(self): - # update topWaterLayer (above soil) - # with netLqWaterToSoil and irrGrossDemand - self.topWaterLayer += pcr.max(0.,self.netLqWaterToSoil + self.irrGrossDemand) - # topWaterLater is partitioned into directRunoff (and infiltration) self.directRunoff = self.improvedArnoScheme(\ - iniWaterStorage = self.soilWaterStorage,\ - inputNetLqWaterToSoil = self.topWaterLayer, - parameters = parameters) + iniWaterStorage = self.soilWaterStorage, \ + inputNetLqWaterToSoil = self.topWaterLayer, \ + directRunoffReductionMethod = self.improvedArnoSchemeMethod) self.directRunoff = pcr.min(self.topWaterLayer, self.directRunoff) - # Yet, no directRunoff in the paddy field. - if self.name == 'irrPaddy': self.directRunoff = 0. + + # Yet, we minimize directRunoff in the irrigation areas: + if self.name.startswith('irr') and self.includeIrrigation: self.directRunoff = pcr.scalar(0.0) # update topWaterLayer (above soil) after directRunoff - self.topWaterLayer = self.topWaterLayer - self.directRunoff + self.topWaterLayer = pcr.max(0.0, self.topWaterLayer - self.directRunoff) - def improvedArnoScheme(self,iniWaterStorage,inputNetLqWaterToSoil,parameters,directRunoffReduction = "Default"): + def improvedArnoScheme(self, iniWaterStorage, inputNetLqWaterToSoil, directRunoffReductionMethod = "Default"): # arnoBeta = BCF = b coefficient of soil water storage capacity distribution # @@ -1129,48 +2301,64 @@ def improvedArnoScheme(self,iniWaterStorage,inputNetLqWaterToSoil,parameters,dir Pn = iniWaterStorage + \ inputNetLqWaterToSoil # Pn = W[TYPE]+Pn; - Pn = Pn - pcr.max(self.rootZoneWaterStorageMin,\ + Pn = Pn - pcr.max(self.rootZoneWaterStorageMin, \ iniWaterStorage) # Pn = Pn-max(WMIN[TYPE],W[TYPE]); soilWaterStorage = pcr.ifthenelse(Pn < 0.,\ - self.rootZoneWaterStorageMin+Pn,\ + self.rootZoneWaterStorageMin+Pn, \ pcr.max(iniWaterStorage,self.rootZoneWaterStorageMin)) # W[TYPE]= if(Pn<0,WMIN[TYPE]+Pn,max(W[TYPE],WMIN[TYPE])); Pn = pcr.max(0.,Pn) # Pn = max(0,Pn); # - DW = pcr.max(0.0,parameters.rootZoneWaterStorageCap - \ - soilWaterStorage) # DW = max(0,WMAX[TYPE]-W[TYPE]); + DW = pcr.max(0.0,self.parameters.rootZoneWaterStorageCap - \ + soilWaterStorage) # DW = max(0,WMAX[TYPE]-W[TYPE]); - WFRAC = pcr.min(1.0,DW/self.rootZoneWaterStorageRange) # WFRAC = min(1,DW/WRANGE[TYPE]); + #~ WFRAC = pcr.min(1.0,DW/self.rootZoneWaterStorageRange) # WFRAC = min(1,DW/WRANGE[TYPE]); + # modified by Edwin ; to solve problems with rootZoneWaterStorageRange = 0.0 + WFRAC = pcr.ifthenelse(self.rootZoneWaterStorageRange > 0.0, pcr.min(1.0,DW/self.rootZoneWaterStorageRange), 1.0) + self.WFRACB = WFRAC**(1./(1.+self.arnoBeta)) # WFRACB = WFRAC**(1/(1+BCF[TYPE])); # self.satAreaFrac = pcr.ifthenelse(self.WFRACB > 0.,\ 1.-self.WFRACB**self.arnoBeta,\ - 0.) # SATFRAC_L = if(WFRACB>0,1-WFRACB**BCF[TYPE],0); + 1.) # SATFRAC_L = if(WFRACB>0,1-WFRACB**BCF[TYPE],1); + # make sure that 0.0 <= satAreaFrac <= 1.0 self.satAreaFrac = pcr.min(self.satAreaFrac, 1.0) self.satAreaFrac = pcr.max(self.satAreaFrac, 0.0) - actualW = (self.arnoBeta+1)*parameters.rootZoneWaterStorageCap - \ - self.arnoBeta *self.rootZoneWaterStorageMin - \ - (self.arnoBeta+1)*self.rootZoneWaterStorageRange*self.WFRACB + + actualW = (self.arnoBeta+1.0)*self.parameters.rootZoneWaterStorageCap - \ + self.arnoBeta*self.rootZoneWaterStorageMin - \ + (self.arnoBeta+1.0)*self.rootZoneWaterStorageRange*self.WFRACB # WACT_L = (BCF[TYPE]+1)*WMAX[TYPE]- BCF[TYPE]*WMIN[TYPE]- (BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB; - if directRunoffReduction == "Default": + directRunoffReduction = pcr.scalar(0.0) # as in the "Original" work of van Beek et al. (2011) + if directRunoffReductionMethod == "Default": if self.numberOfLayers == 2: directRunoffReduction = pcr.min(self.kUnsatLow,\ - pcr.sqrt(parameters.kUnsatAtFieldCapLow*\ - self.kUnsatLow)) + pcr.sqrt(self.kUnsatLow*self.parameters.kUnsatAtFieldCapLow)) if self.numberOfLayers == 3: directRunoffReduction = pcr.min(self.kUnsatLow030150,\ - pcr.sqrt(parameters.kUnsatAtFieldCapLow030150*\ - self.kUnsatLow030150)) # Rens: # In order to maintain full saturation and + pcr.sqrt(self.kUnsatLow030150*self.parameters.kUnsatAtFieldCapLow030150)) + # Rens: # In order to maintain full saturation and # continuous groundwater recharge/percolation, # the amount of directRunoff may be reduced. # In this case, this reduction is estimated # based on (for two layer case) percLow = pcr.min(KUnSatLow,\ - # pcr.sqrt(parameters.KUnSatFC2*KUnSatLow)) + # pcr.sqrt(self.parameters.KUnSatFC2*KUnSatLow)) + + if directRunoffReductionMethod == "Modified": + if self.numberOfLayers == 2: directRunoffReduction = pcr.min(self.kUnsatLow,\ + pcr.sqrt(self.kUnsatLow*self.parameters.kUnsatAtFieldCapLow)) + if self.numberOfLayers == 3: directRunoffReduction = pcr.min(self.kUnsatLow030150,\ + pcr.sqrt(self.kUnsatLow030150*self.parameters.kUnsatAtFieldCapLow030150)) + # the reduction of directRunoff (preferential flow groundwater) + # is only introduced if the soilWaterStorage near its saturation + # - this is in order to maintain the saturation + saturation_treshold = 0.999 + directRunoffReduction = pcr.ifthenelse(vos.getValDivZero(soilWaterStorage,self.parameters.rootZoneWaterStorageCap) > saturation_treshold, directRunoffReduction, 0.0) # directRunoff condition = (self.arnoBeta+pcr.scalar(1.))*self.rootZoneWaterStorageRange* self.WFRACB directRunoff = pcr.max(0.0, \ Pn -\ - (parameters.rootZoneWaterStorageCap+directRunoffReduction-soilWaterStorage) + \ + (self.parameters.rootZoneWaterStorageCap+directRunoffReduction-soilWaterStorage) + \ pcr.ifthenelse(Pn >= condition, pcr.scalar(0.0), \ self.rootZoneWaterStorageRange*(self.WFRACB-\ @@ -1179,50 +2367,73 @@ def improvedArnoScheme(self,iniWaterStorage,inputNetLqWaterToSoil,parameters,dir # Q1_L[TYPE]= max(0,Pn-(WMAX[TYPE]+P2_L[TYPE]-W[TYPE])+ # if(Pn>=(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB, 0, # WRANGE[TYPE]*(WFRACB-Pn/((BCF[TYPE]+1)*WRANGE[TYPE]))**(BCF[TYPE]+1))); #* + # make sure that there is always value + directRunoff = pcr.cover(directRunoff, 0.0) + return directRunoff def calculateOpenWaterEvap(self): - self.openWaterEvap = pcr.spatial(pcr.scalar(0.)) + # update topWaterLayer (above soil) + # - with netLqWaterToSoil and irrGrossDemand + self.topWaterLayer += pcr.max(0.,self.netLqWaterToSoil + self.irrGrossDemand) + + # potential evaporation for openWaterEvap remainingPotETP = self.potBareSoilEvap + self.potTranspiration # Edwin's principle: LIMIT = self.potBareSoilEvap +self.potTranspiration # remainingPotETP = self.totalPotET # DW, RvB, and YW use self.totalPotETP + + # openWaterEvap is ONLY for evaporation from paddy field areas + self.openWaterEvap = pcr.spatial(pcr.scalar(0.)) - # open water evaporation from the paddy field - if self.name == 'irrPaddy': - self.openWaterEvap = \ + if self.name == 'irrPaddy' or self.name == "irr_paddy": # only open water evaporation from the paddy field + self.openWaterEvap = \ pcr.min(\ pcr.max(0.,self.topWaterLayer), remainingPotETP) - # PS: self.potBareSoilEvap +self.potTranspiration = LIMIT - # - DW, RvB, and YW use self.totalPotETP as the LIMIT. EHS does not agree (24 April 2013). - # + # update potBareSoilEvap & potTranspiration (after openWaterEvap) - self.potBareSoilEvap = pcr.cover( self.potBareSoilEvap -\ - (self.potBareSoilEvap/remainingPotETP)* - self.openWaterEvap, 0.0) - self.potTranspiration = pcr.cover( self.potTranspiration-\ - (self.potTranspiration/remainingPotETP)* - self.openWaterEvap, 0.0) + # - CHECK; WHY DO WE USE COVER ABOVE? Edwin replaced them using the following lines: + self.potBareSoilEvap = pcr.cover(\ + pcr.max(0.0, self.potBareSoilEvap -\ + vos.getValDivZero(self.potBareSoilEvap, remainingPotETP)*self.openWaterEvap ), 0.0) + self.potTranspiration = pcr.cover(\ + pcr.max(0.0, self.potTranspiration -\ + vos.getValDivZero(self.potTranspiration, remainingPotETP)*self.openWaterEvap), 0.0) # update top water layer after openWaterEvap self.topWaterLayer = pcr.max(0.,self.topWaterLayer - self.openWaterEvap) - - def calculateInfiltration(self, parameters): + + def calculateInfiltration(self): # infiltration, limited with KSat1 and available water in topWaterLayer if self.numberOfLayers == 2: - self.infiltration = pcr.min(self.topWaterLayer,parameters.kSatUpp) # P0_L = min(P0_L,KS1*Duration*timeslice()); + self.infiltration = pcr.min(self.topWaterLayer,self.parameters.kSatUpp) # P0_L = min(P0_L,KS1*Duration*timeslice()); if self.numberOfLayers == 3: - self.infiltration = pcr.min(self.topWaterLayer,parameters.kSatUpp000005) # P0_L = min(P0_L,KS1*Duration*timeslice()); + self.infiltration = pcr.min(self.topWaterLayer,self.parameters.kSatUpp000005) # P0_L = min(P0_L,KS1*Duration*timeslice()); + + # for paddy, infiltration should consider percolation losses + if (self.name == 'irrPaddy' or self.name == "irr_paddy") and self.includeIrrigation: + infiltration_loss = pcr.max(self.design_percolation_loss, + ((1./self.irrigationEfficiencyUsed) - 1.) * self.topWaterLayer) + self.infiltration = pcr.min(infiltration_loss, self.infiltration) # update top water layer after infiltration - self.topWaterLayer = self.topWaterLayer - self.infiltration + self.topWaterLayer = pcr.max(0.0,\ + self.topWaterLayer - self.infiltration) + + # release excess topWaterLayer above minTopWaterLayer as additional direct runoff + self.directRunoff += pcr.max(0.0,\ + self.topWaterLayer - self.minTopWaterLayer) - def estimateTranspirationAndBareSoilEvap(self, parameters, returnTotalEstimation = False): + # update topWaterLayer after additional direct runoff + self.topWaterLayer = pcr.min( self.topWaterLayer , \ + self.minTopWaterLayer) + + def estimateTranspirationAndBareSoilEvap(self, returnTotalEstimation = False, returnTotalTranspirationOnly = False): # TRANSPIRATION # - # - partitioning transpiration (based on actual each layer storage) + # - fractions for distributing transpiration (based on rott fraction and actual layer storages) # if self.numberOfLayers == 2: dividerTranspFracs = pcr.max( 1e-9, self.adjRootFrUpp*self.storUpp +\ @@ -1266,10 +2477,10 @@ def estimateTranspirationAndBareSoilEvap(self, parameters, returnTotalEstimation # reduction factor for transpiration # # - relActTranspiration = fraction actual transpiration over potential transpiration - relActTranspiration = (parameters.rootZoneWaterStorageCap + \ + relActTranspiration = (self.parameters.rootZoneWaterStorageCap + \ self.arnoBeta*self.rootZoneWaterStorageRange*(1.- \ (1.+self.arnoBeta)/self.arnoBeta*self.WFRACB)) / \ - (parameters.rootZoneWaterStorageCap + \ + (self.parameters.rootZoneWaterStorageCap + \ self.arnoBeta*self.rootZoneWaterStorageRange*(1.- self.WFRACB)) # original Rens's line: # FRACTA[TYPE] = (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-(1+BCF[TYPE])/BCF[TYPE]*WFRACB))/ # (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-WFRACB)); @@ -1280,57 +2491,91 @@ def estimateTranspirationAndBareSoilEvap(self, parameters, returnTotalEstimation relActTranspiration = pcr.max(0.0, relActTranspiration) relActTranspiration = pcr.min(1.0, relActTranspiration) - # estimates of actual transpiration fluxes: + # an idea by Edwin - 23 March 2015: no transpiration reduction in irrigated areas: + if self.name.startswith('irr') and self.includeIrrigation: relActTranspiration = pcr.scalar(1.0) + + + #~ ####################################################################################################################################### + #~ # estimates of actual transpiration fluxes - OLD METHOD (not used anymore, after Rens provided his original script, 30 July 2015) + #~ if self.numberOfLayers == 2: + #~ actTranspiUpp = \ + #~ relActTranspiration*transpFracUpp*self.potTranspiration + #~ actTranspiLow = \ + #~ relActTranspiration*transpFracLow*self.potTranspiration + #~ if self.numberOfLayers == 3: + #~ actTranspiUpp000005 = \ + #~ relActTranspiration*transpFracUpp000005*self.potTranspiration + #~ actTranspiUpp005030 = \ + #~ relActTranspiration*transpFracUpp005030*self.potTranspiration + #~ actTranspiLow030150 = \ + #~ relActTranspiration*transpFracLow030150*self.potTranspiration + #~ ####################################################################################################################################### + + + # partitioning potential tranpiration (based on Rens's oldcalc script provided 30 July 2015) if self.numberOfLayers == 2: - actTranspiUpp = \ - relActTranspiration*transpFracUpp*self.potTranspiration - actTranspiLow = \ - relActTranspiration*transpFracLow*self.potTranspiration + potTranspirationUpp = pcr.min(transpFracUpp*self.potTranspiration, self.potTranspiration) + potTranspirationLow = pcr.max(0.0, self.potTranspiration - potTranspirationUpp) if self.numberOfLayers == 3: - actTranspiUpp000005 = \ - relActTranspiration*transpFracUpp000005*self.potTranspiration - actTranspiUpp005030 = \ - relActTranspiration*transpFracUpp005030*self.potTranspiration - actTranspiLow030150 = \ - relActTranspiration*transpFracLow030150*self.potTranspiration - + potTranspirationUpp000005 = pcr.min(transpFracUpp000005*self.potTranspiration, self.potTranspiration) + potTranspirationUpp005030 = pcr.min(transpFracUpp005030*self.potTranspiration, pcr.max(0.0, self.potTranspiration - potTranspirationUpp000005)) + potTranspirationLow030150 = pcr.max(0.0, self.potTranspiration - potTranspirationUpp000005 - potTranspirationUpp005030) + + # estimate actual transpiration fluxes + if self.numberOfLayers == 2: + actTranspiUpp = pcr.cover(relActTranspiration*potTranspirationUpp, 0.0) + actTranspiLow = pcr.cover(relActTranspiration*potTranspirationLow, 0.0) + if self.numberOfLayers == 3: + actTranspiUpp000005 = pcr.cover(relActTranspiration*potTranspirationUpp000005, 0.0) + actTranspiUpp005030 = pcr.cover(relActTranspiration*potTranspirationUpp005030, 0.0) + actTranspiLow030150 = pcr.cover(relActTranspiration*potTranspirationLow030150, 0.0) + + # BARE SOIL EVAPORATION # # actual bare soil evaporation (potential) # no reduction in case of returnTotalEstimation actBareSoilEvap = self.potBareSoilEvap if self.numberOfLayers == 2 and returnTotalEstimation == False: actBareSoilEvap = self.satAreaFrac * pcr.min(\ - self.potBareSoilEvap,parameters.kSatUpp) + \ + self.potBareSoilEvap,self.parameters.kSatUpp) + \ (1.-self.satAreaFrac)* pcr.min(\ self.potBareSoilEvap,self.kUnsatUpp) # ES_a[TYPE] = SATFRAC_L *min(ES_p[TYPE],KS1[TYPE]*Duration*timeslice())+ # (1-SATFRAC_L)*min(ES_p[TYPE],KTHEFF1*Duration*timeslice()); if self.numberOfLayers == 3 and returnTotalEstimation == False: actBareSoilEvap = self.satAreaFrac * pcr.min(\ - self.potBareSoilEvap,parameters.kSatUpp000005) + \ + self.potBareSoilEvap,self.parameters.kSatUpp000005) + \ (1.-self.satAreaFrac)* pcr.min(\ self.potBareSoilEvap,self.kUnsatUpp000005) actBareSoilEvap = pcr.max(0.0, actBareSoilEvap) - actBareSoilEvap = pcr.min(actBareSoilEvap,self.potBareSoilEvap) + actBareSoilEvap = pcr.min(actBareSoilEvap,self.potBareSoilEvap) + actBareSoilEvap = pcr.cover(actBareSoilEvap, 0.0) # no bare soil evaporation in the inundated paddy field - if self.name == 'irrPaddy': - treshold = 0.0005 # unit: m ; no bare soil evaporation if topWaterLayer is above treshold + if self.name == 'irrPaddy' or self.name == "irr_paddy": + # no bare soil evaporation if topWaterLayer is above treshold + #~ treshold = 0.0005 # unit: m ; + treshold = self.potBareSoilEvap + self.potTranspiration # an idea by Edwin on 23 march 2015 actBareSoilEvap = pcr.ifthenelse(self.topWaterLayer > treshold, 0.0, actBareSoilEvap) # return the calculated variables: if self.numberOfLayers == 2: if returnTotalEstimation: - return actBareSoilEvap+ actTranspiUpp+ actTranspiLow + if returnTotalTranspirationOnly: + return actTranspiUpp+ actTranspiLow + else: + return actBareSoilEvap+ actTranspiUpp+ actTranspiLow else: return actBareSoilEvap, actTranspiUpp, actTranspiLow if self.numberOfLayers == 3: if returnTotalEstimation: - return actBareSoilEvap+ actTranspiUpp000005+ actTranspiUpp005030+ actTranspiLow030150 + if returnTotalTranspirationOnly: + return actTranspiUpp000005+ actTranspiUpp005030+ actTranspiLow030150 + else: + return actBareSoilEvap+ actTranspiUpp000005+ actTranspiUpp005030+ actTranspiLow030150 else: return actBareSoilEvap, actTranspiUpp000005, actTranspiUpp005030, actTranspiLow030150 - - def estimateSoilFluxes(self,parameters,capRiseFrac): + def estimateSoilFluxes(self,capRiseFrac,groundwater): # Given states, we estimate all fluxes. ################################################################ @@ -1340,102 +2585,112 @@ def estimateSoilFluxes(self,parameters,capRiseFrac): # - percolation from storUpp to storLow self.percUpp = self.kThVertUppLow * 1. self.percUpp = \ - pcr.ifthenelse( self.effSatUpp > parameters.effSatAtFieldCapUpp, \ - pcr.min(pcr.max(0., self.effSatUpp - parameters.effSatAtFieldCapUpp)*parameters.storCapUpp, self.percUpp), self.percUpp) + \ + pcr.ifthenelse( self.effSatUpp > self.parameters.effSatAtFieldCapUpp, \ + pcr.min(pcr.max(0., self.effSatUpp - self.parameters.effSatAtFieldCapUpp)*self.parameters.storCapUpp, self.percUpp), self.percUpp) + \ pcr.max(0.,self.infiltration - \ - (parameters.storCapUpp-self.storUpp)) # original Rens's line: + (self.parameters.storCapUpp-self.storUpp)) # original Rens's line: # P1_L[TYPE] = KTHVERT*Duration*timeslice(); # P1_L[TYPE] = if(THEFF1 > THEFF1_FC[TYPE],min(max(0,THEFF1-THEFF1_FC[TYPE])*SC1[TYPE], # P1_L[TYPE]),P1_L[TYPE])+max(0,P0_L[TYPE]-(SC1[TYPE]-S1_L[TYPE])); # - percolation from storLow to storGroundwater - self.percLow = pcr.min(self.kUnsatLow,pcr.sqrt(\ - parameters.kUnsatAtFieldCapLow*\ - self.kUnsatLow)) # original Rens's line: + self.percLow = pcr.min(self.kUnsatLow, pcr.sqrt(\ + self.kUnsatLow*self.parameters.kUnsatAtFieldCapLow)) + # original Rens's line: # P2_L[TYPE] = min(KTHEFF2,sqrt(KTHEFF2*KTHEFF2_FC[TYPE]))*Duration*timeslice() + # - capillary rise to storUpp from storLow self.capRiseUpp = \ pcr.min(pcr.max(0.,\ - parameters.effSatAtFieldCapUpp - \ - self.effSatUpp)*parameters.storCapUpp,\ + self.parameters.effSatAtFieldCapUpp - \ + self.effSatUpp)*self.parameters.storCapUpp,\ self.kThVertUppLow * self.gradientUppLow) # original Rens's line: # CR1_L[TYPE] = min(max(0,THEFF1_FC[TYPE]-THEFF1)*SC1[TYPE],KTHVERT*GRAD*Duration*timeslice()); # - capillary rise to storLow from storGroundwater (m) self.capRiseLow = 0.5*(self.satAreaFrac + capRiseFrac)*\ pcr.min((1.-self.effSatLow)*\ - pcr.sqrt(parameters.kSatLow* \ + pcr.sqrt(self.parameters.kSatLow* \ self.kUnsatLow),\ - pcr.max(0.0,parameters.effSatAtFieldCapLow- \ + pcr.max(0.0,self.parameters.effSatAtFieldCapLow- \ self.effSatLow)*\ - parameters.storCapLow) # original Rens's line: + self.parameters.storCapLow) # original Rens's line: # CR2_L[TYPE] = 0.5*(SATFRAC_L+CRFRAC)*min((1-THEFF2)*sqrt(KS2[TYPE]*KTHEFF2)*Duration*timeslice(), # max(0,THEFF2_FC[TYPE]-THEFF2)*SC2[TYPE]); + # - no capillary rise from non productive aquifer + self.capRiseLow = pcr.ifthenelse(groundwater.productive_aquifer,\ + self.capRiseLow, 0.0) + # - interflow (m) - percToInterflow = parameters.percolationImp*(\ + percToInterflow = self.parameters.percolationImp*(\ self.percUpp+self.capRiseLow-\ (self.percLow+self.capRiseUpp)) self.interflow = pcr.max(\ - parameters.interflowConcTime*percToInterflow +\ - (pcr.scalar(1.)-parameters.interflowConcTime)*self.interflow, 0.0) + self.parameters.interflowConcTime*percToInterflow +\ + (pcr.scalar(1.)-self.parameters.interflowConcTime)*self.interflow, 0.0) if self.numberOfLayers == 3: # - percolation from storUpp000005 to storUpp005030 (m) self.percUpp000005 = self.kThVertUpp000005Upp005030 * 1. self.percUpp000005 = \ - pcr.ifthenelse( self.effSatUpp000005 > parameters.effSatAtFieldCapUpp000005, \ - pcr.min(pcr.max(0., self.effSatUpp000005 - parameters.effSatAtFieldCapUpp000005)*parameters.storCapUpp000005, self.percUpp000005), self.percUpp000005) + \ + pcr.ifthenelse( self.effSatUpp000005 > self.parameters.effSatAtFieldCapUpp000005, \ + pcr.min(pcr.max(0., self.effSatUpp000005 - self.parameters.effSatAtFieldCapUpp000005)*self.parameters.storCapUpp000005, self.percUpp000005), self.percUpp000005) + \ pcr.max(0.,self.infiltration - \ - (parameters.storCapUpp000005-self.storUpp000005)) + (self.parameters.storCapUpp000005-self.storUpp000005)) # - percolation from storUpp005030 to storLow030150 (m) self.percUpp005030 = self.kThVertUpp005030Low030150 * 1. self.percUpp005030 = \ - pcr.ifthenelse( self.effSatUpp005030 > parameters.effSatAtFieldCapUpp005030, \ - pcr.min(pcr.max(0., self.effSatUpp005030 - parameters.effSatAtFieldCapUpp005030)*parameters.storCapUpp005030, self.percUpp005030), self.percUpp005030) + \ + pcr.ifthenelse( self.effSatUpp005030 > self.parameters.effSatAtFieldCapUpp005030, \ + pcr.min(pcr.max(0., self.effSatUpp005030 - self.parameters.effSatAtFieldCapUpp005030)*self.parameters.storCapUpp005030, self.percUpp005030), self.percUpp005030) + \ pcr.max(0.,self.percUpp000005 - \ - (parameters.storCapUpp005030-self.storUpp005030)) + (self.parameters.storCapUpp005030-self.storUpp005030)) # - percolation from storLow030150 to storGroundwater (m) self.percLow030150 = pcr.min(self.kUnsatLow030150,pcr.sqrt(\ - parameters.kUnsatAtFieldCapLow030150*\ + self.parameters.kUnsatAtFieldCapLow030150*\ self.kUnsatLow030150)) # - capillary rise to storUpp000005 from storUpp005030 (m) self.capRiseUpp000005 = pcr.min(pcr.max(0.,\ - parameters.effSatAtFieldCapUpp000005 - \ + self.parameters.effSatAtFieldCapUpp000005 - \ self.effSatUpp000005)* \ - parameters.storCapUpp000005, \ + self.parameters.storCapUpp000005, \ self.kThVertUpp000005Upp005030* \ self.gradientUpp000005Upp005030) # - capillary rise to storUpp005030 from storLow030150 (m) self.capRiseUpp005030 = pcr.min(pcr.max(0.,\ - parameters.effSatAtFieldCapUpp005030 - \ + self.parameters.effSatAtFieldCapUpp005030 - \ self.effSatUpp005030)* \ - parameters.storCapUpp005030, \ + self.parameters.storCapUpp005030, \ self.kThVertUpp005030Low030150* \ self.gradientUpp005030Low030150) # - capillary rise to storLow030150 from storGroundwater (m) self.capRiseLow030150 = 0.5*(self.satAreaFrac + capRiseFrac)*\ pcr.min((1.-self.effSatLow030150)*\ - pcr.sqrt(parameters.kSatLow030150* \ + pcr.sqrt(self.parameters.kSatLow030150* \ self.kUnsatLow030150),\ - pcr.max(0.0,parameters.effSatAtFieldCapLow030150- \ + pcr.max(0.0,self.parameters.effSatAtFieldCapLow030150- \ self.effSatLow030150)*\ - parameters.storCapLow030150) + self.parameters.storCapLow030150) + + # - no capillary rise from non productive aquifer + self.capRiseLow030150 = pcr.ifthenelse(groundwater.productive_aquifer,\ + self.capRiseLow030150, 0.0) # - interflow (m) - percToInterflow = parameters.percolationImp*(\ + percToInterflow = self.parameters.percolationImp*(\ self.percUpp005030+self.capRiseLow030150-\ (self.percLow030150+self.capRiseUpp005030)) self.interflow = pcr.max(\ - parameters.interflowConcTime*percToInterflow +\ - (pcr.scalar(1.)-parameters.interflowConcTime)*self.interflow, 0.0) + self.parameters.interflowConcTime*percToInterflow +\ + (pcr.scalar(1.)-self.parameters.interflowConcTime)*self.interflow, 0.0) + - def scaleAllFluxes(self, parameters, groundwater): + def scaleAllFluxes(self, groundwater): # We re-scale all fluxes (based on available water). ######################################################################################################################################## @@ -1448,9 +2703,11 @@ def scaleAllFluxes(self, parameters, groundwater): ADJUST = pcr.ifthenelse(ADJUST>0.0, \ pcr.min(1.0,pcr.max(0.0, self.storUpp + \ self.infiltration) / ADJUST),0.) + ADJUST = pcr.cover(ADJUST, 0.0) self.actBareSoilEvap = ADJUST*self.actBareSoilEvap - self.actTranspiUpp = ADJUST*self.actTranspiUpp - self.percUpp = ADJUST*self.percUpp # original Rens's line: + self.percUpp = ADJUST*self.percUpp + self.actTranspiUpp = ADJUST*self.actTranspiUpp + # original Rens's line: # ADJUST = ES_a[TYPE]+T_a1[TYPE]+P1_L[TYPE]; # ADJUST = if(ADJUST>0,min(1,(max(0,S1_L[TYPE]+P0_L[TYPE]))/ADJUST),0); # ES_a[TYPE] = ADJUST*ES_a[TYPE]; @@ -1462,9 +2719,11 @@ def scaleAllFluxes(self, parameters, groundwater): ADJUST = pcr.ifthenelse(ADJUST>0.0, \ pcr.min(1.0,pcr.max(0.0, self.storLow + \ self.percUpp)/ADJUST),0.) - self.actTranspiLow = ADJUST*self.actTranspiLow + ADJUST = pcr.cover(ADJUST, 0.0) self.percLow = ADJUST*self.percLow - self.interflow = ADJUST*self.interflow # original Rens's line: + self.actTranspiLow = ADJUST*self.actTranspiLow + self.interflow = ADJUST*self.interflow + # original Rens's line: # ADJUST = T_a2[TYPE]+P2_L[TYPE]+Q2_L[TYPE]; # ADJUST = if(ADJUST>0,min(1,max(S2_L[TYPE]+P1_L[TYPE],0)/ADJUST),0); # T_a2[TYPE] = ADJUST*T_a2[TYPE]; @@ -1480,10 +2739,10 @@ def scaleAllFluxes(self, parameters, groundwater): #~ groundwater.storGroundwater,\ #~ self.capRiseLow) # CR2_L[TYPE]= min(VEGFRAC[TYPE]*S3,CR2_L[TYPE]) # - # - without fracVegCover (without safetyFactor) + #~ # - without fracVegCover (without safetyFactor) #~ self.capRiseLow = pcr.max(0.,\ #~ pcr.min(\ - #~ groundwater.storGroundwater,self.capRiseLow)) + #~ groundwater.storGroundwater,self.capRiseLow)) # This line is not necessary. # # also limited with reducedCapRise # @@ -1508,24 +2767,24 @@ def scaleAllFluxes(self, parameters, groundwater): pcr.min(1.0,pcr.max(0.0, self.storUpp000005 + \ self.infiltration) / ADJUST),0.) self.actBareSoilEvap = ADJUST*self.actBareSoilEvap - self.actTranspiUpp000005 = ADJUST*self.actTranspiUpp000005 self.percUpp000005 = ADJUST*self.percUpp000005 + self.actTranspiUpp000005 = ADJUST*self.actTranspiUpp000005 - # scale fluxes (for Upp000005) + # scale fluxes (for Upp005030) ADJUST = self.actTranspiUpp005030 + self.percUpp005030 ADJUST = pcr.ifthenelse(ADJUST>0.0, \ pcr.min(1.0,pcr.max(0.0, self.storUpp005030 + \ self.percUpp000005)/ ADJUST),0.) - self.actTranspiUpp005030 = ADJUST*self.actTranspiUpp005030 self.percUpp005030 = ADJUST*self.percUpp005030 + self.actTranspiUpp005030 = ADJUST*self.actTranspiUpp005030 # scale fluxes (for Low030150) ADJUST = self.actTranspiLow030150 + self.percLow030150 + self.interflow ADJUST = pcr.ifthenelse(ADJUST>0.0, \ pcr.min(1.0,pcr.max(0.0, self.storLow030150 + \ self.percUpp005030)/ADJUST),0.) - self.actTranspiLow030150 = ADJUST*self.actTranspiLow030150 self.percLow030150 = ADJUST*self.percLow030150 + self.actTranspiLow030150 = ADJUST*self.actTranspiLow030150 self.interflow = ADJUST*self.interflow # capillary rise to storLow is limited to available storGroundwater @@ -1552,7 +2811,467 @@ def scaleAllFluxes(self, parameters, groundwater): self.capRiseUpp000005 = pcr.min(\ estimateStorUpp005030BeforeCapRise,self.capRiseUpp000005) - def updateSoilStates(self, parameters): + + def scaleAllFluxesForIrrigatedAreas(self, groundwater): + + # for irrigation areas: interflow will be minimized + if self.name.startswith('irr'): self.interflow = 0. + + #~ # deep percolation should consider losses during application in non paddy areas + #~ if self.name == 'irrNonPaddy': + #~ startingCropKC = 0.00 + #~ maxADJUST = 100. + #~ if self.numberOfLayers == 2: + #~ minimum_deep_percolation = pcr.min(self.potential_irrigation_loss, self.storLow) + #~ deep_percolation = pcr.max(minimum_deep_percolation, \ + #~ self.percLow + self.interflow) + #~ ADJUST = self.percLow + self.interflow + #~ ADJUST = pcr.ifthenelse(ADJUST > 0., \ + #~ pcr.min(maxADJUST,pcr.max(0.0, deep_percolation)/ADJUST),0.) + #~ ADJUST = pcr.ifthenelse(self.cropKC > startingCropKC, ADJUST, 1.) + #~ self.percLow = ADJUST*self.percLow + #~ self.interflow = ADJUST*self.interflow + #~ if self.numberOfLayers == 3: + #~ minimum_deep_percolation = pcr.min(self.potential_irrigation_loss, self.storLow030150) + #~ deep_percolation = pcr.max(minimum_deep_percolation, \ + #~ self.percLow030150 + self.interflow) + #~ ADJUST = self.percLow030150 + self.interflow + #~ ADJUST = pcr.ifthenelse(ADJUST > 0., \ + #~ pcr.min(maxADJUST,pcr.max(0.0, deep_percolation)/ADJUST),0.) + #~ ADJUST = pcr.ifthenelse(self.cropKC > startingCropKC, ADJUST, 1.) + #~ self.percLow030150 = ADJUST*self.percLow030150 + #~ self.interflow = ADJUST*self.interflow + + #~ # idea on 9 May 2015 + #~ # deep percolation should consider losses during application in non paddy areas + #~ if self.name == "irrNonPaddy": + #~ startingKC = 0.20 # starting crop coefficient indicate the growing season + #~ if self.numberOfLayers == 2: + #~ deep_percolation_loss = self.percLow + #~ deep_percolation_loss = pcr.max(deep_percolation_loss, \ + #~ pcr.min(self.readAvlWater, self.storLow) * ((1./self.irrigationEfficiencyUsed) - 1.)) + #~ self.percLow = pcr.ifthenelse(self.cropKC > startingKC, deep_percolation_loss, \ + #~ pcr.ifthenelse(self.cropKC < self.prevCropKC, self.percLow, deep_percolation_loss)) + #~ if self.numberOfLayers == 3: + #~ deep_percolation_loss = self.percLow030150 + #~ deep_percolation_loss = pcr.max(deep_percolation_loss, \ + #~ pcr.min(self.readAvlWater, self.storLow030150) * ((1./self.irrigationEfficiencyUsed) - 1.)) + #~ self.percLow030150 = pcr.ifthenelse(self.cropKC > startingKC, deep_percolation_loss, \ + #~ pcr.ifthenelse(self.cropKC < self.prevCropKC, self.percLow030150, deep_percolation_loss)) + + # idea on 16 June 2015 + # deep percolation should consider irrigation application losses + if self.name.startswith('irr'): + + startingKC = 0.20 # starting crop coefficient indicate the growing season + + if self.numberOfLayers == 2: + deep_percolation_loss = self.percLow + deep_percolation_loss = pcr.max(deep_percolation_loss, \ + pcr.max(0.0, self.storLow) * ((1./self.irrigationEfficiencyUsed) - 1.)) + self.percLow = pcr.ifthenelse(self.cropKC > startingKC, deep_percolation_loss, self.percLow) + + if self.numberOfLayers == 3: + deep_percolation_loss = self.percLow030150 + deep_percolation_loss = pcr.max(deep_percolation_loss, \ + pcr.max(0.0, self.storLow030150) * ((1./self.irrigationEfficiencyUsed) - 1.)) + self.percLow030150 = pcr.ifthenelse(self.cropKC > startingKC, deep_percolation_loss, self.percLow030150) + + + # idea on 24 June 2015 + # the total bare soil evaporation and deep percolation losses should be limited by irrigation efficiency and total transpiration + #~ if self.name.startswith('irr'): + #~ + #~ # starting crop coefficient indicate the growing season + #~ startingKC = 0.20 +#~ + #~ # estimate of total transpiration (unit: m) + #~ if self.numberOfLayers == 2: total_transpiration = self.actTranspiUpp + self.actTranspiLow + #~ if self.numberOfLayers == 3: total_transpiration = self.actTranspiUpp000005 +\ + #~ self.actTranspiUpp005030 +\ + #~ self.actTranspiLow030150 + #~ + #~ # potential/maximum irrigation loss (unit: m) + #~ potential_irrigation_loss_from_soil = total_transpiration * ((1./self.irrigationEfficiencyUsed) - 1.) + #~ # - some has evaporated through openWaterEvap (from paddy fields) + #~ potential_irrigation_loss_from_soil = pcr.max(0.0, potential_irrigation_loss_from_soil - self.openWaterEvap) + #~ + #~ # deep percolation loss as it is estimated (no reduction/changes) + #~ if self.numberOfLayers == 2: deep_percolation_loss = self.percLow + #~ if self.numberOfLayers == 3: deep_percolation_loss = self.percLow030150 +#~ + #~ # bare soil evaporation (unit: m), limited by the (remaining) potential_irrigation_loss_from_soil and the estimate of deep percolation + #~ self.actBareSoilEvap = pcr.ifthenelse(self.cropKC > startingKC, \ + #~ pcr.min(self.actBareSoilEvap, \ + #~ pcr.max(0.0, potential_irrigation_loss_from_soil - deep_percolation_loss)), self.actBareSoilEvap) + + + #~ # idea on 25 June 2015 + #~ # the minimum deep percolation losses is determined by irrigation efficiency and total transpiration + #~ if self.name.startswith('irr'): + #~ + #~ # starting crop coefficient indicate the growing season + #~ startingKC = 0.20 +#~ + #~ # estimate of total transpiration (unit: m) + #~ if self.numberOfLayers == 2: total_transpiration = self.actTranspiUpp + self.actTranspiLow + #~ if self.numberOfLayers == 3: total_transpiration = self.actTranspiUpp000005 +\ + #~ self.actTranspiUpp005030 +\ + #~ self.actTranspiLow030150 + #~ + #~ # potential/maximum irrigation loss (unit: m) + #~ potential_irrigation_loss_from_soil = total_transpiration * ((1./self.irrigationEfficiencyUsed) - 1.) + #~ # - some has evaporated through openWaterEvap (from paddy fields) + #~ potential_irrigation_loss_from_soil = pcr.max(0.0, potential_irrigation_loss_from_soil - self.openWaterEvap) + #~ + #~ # bare soil evaporation (unit: m), limited by the potential_irrigation_loss_from_soil + #~ self.actBareSoilEvap = pcr.ifthenelse(self.cropKC > startingKC, \ + #~ pcr.min(self.actBareSoilEvap, potential_irrigation_loss_from_soil), self.actBareSoilEvap) +#~ + #~ # minimum deep percolation loss is the (remaining) potential_irrigation_loss_from_soil + #~ deep_percolation_loss = pcr.max(potential_irrigation_loss_from_soil - self.actBareSoilEvap) + #~ if self.numberOfLayers == 2: + #~ deep_percolation_loss = pcr.min(deep_percolation_loss, \ + #~ pcr.max(0.0, self.storLow) * ((1./self.irrigationEfficiencyUsed) - 1.)) + #~ self.percLow = pcr.ifthenelse(self.cropKC > startingKC, pcr.max(deep_percolation_loss, self.percLow), self.percLow) + #~ if self.numberOfLayers == 3: + #~ deep_percolation_loss = pcr.min(deep_percolation_loss, \ + #~ pcr.max(0.0, self.storLow030150) * ((1./self.irrigationEfficiencyUsed) - 1.)) + #~ self.percLow030150 = pcr.ifthenelse(self.cropKC > startingKC, pcr.max(deep_percolation_loss, self.percLow030150), self.percLow030150) + + + # scale all fluxes based on available water + # - alternative 1: + self.scaleAllFluxes(groundwater) + #~ # - alternative 2: + #~ self.scaleAllFluxesOptimizeEvaporationTranspiration(groundwater) + + def scaleAllFluxesOptimizeEvaporationTranspiration(self, groundwater): + + # We re-scale all fluxes (based on available water). + # - in irrigated areas, evaporation fluxes are priority + # - percolation and interfflow losses depend on the remaining water + ######################################################################################################################################## + + # remaining total energy for evaporation fluxes: + remainingPotET = self.potBareSoilEvap + self.potTranspiration + + # scaling all fluxes based on available water + + if self.numberOfLayers == 2: + + # scale fluxes (for Upp) + # - potential transpiration will be used to boost the transpiration process + ADJUST = self.actBareSoilEvap + self.potTranspiration + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storUpp + \ + self.infiltration) / ADJUST),0.) + self.actBareSoilEvap = ADJUST*self.actBareSoilEvap + self.actTranspiUpp = ADJUST*self.potTranspiration + # + # - allowing more transpiration + remainingPotET = pcr.max(0.0, remainingPotET -\ + (self.actBareSoilEvap + self.actTranspiUpp)) + extraTranspiration = pcr.min(remainingPotET,\ + pcr.max(0.0, self.storUpp + self.infiltration - \ + self.actBareSoilEvap - \ + self.actTranspiUpp)) + self.actTranspiUpp += extraTranspiration + remainingPotET = pcr.max(0.0, remainingPotET - extraTranspiration) + # + # - percolation fluxes depend on the remaining water + self.percUpp = pcr.min(self.percUpp,\ + pcr.max(0.0, self.storUpp + self.infiltration - \ + self.actBareSoilEvap - \ + self.actTranspiUpp)) + + # scale fluxes (for Low) + # - remaining potential evaporation will be used to boost the transpiration process + ADJUST = remainingPotET + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storLow + \ + self.percUpp)/ADJUST),0.) + self.actTranspiLow = ADJUST*remainingPotET + # - percolation and interflow fluxes depend on the remaining water + ADJUST = self.percLow + self.interflow + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storLow + \ + self.percUpp - self.actTranspiLow)/ADJUST),0.) + self.percLow = ADJUST*self.percLow + self.interflow = ADJUST*self.interflow + + # capillary rise to storLow is limited to available storGroundwater + # - also limited with reducedCapRise + self.capRiseLow = pcr.max(0.,\ + pcr.min(\ + pcr.max(0.,\ + groundwater.storGroundwater-self.reducedCapRise),self.capRiseLow)) + + # capillary rise to storUpp is limited to available storLow + estimateStorLowBeforeCapRise = pcr.max(0,self.storLow + self.percUpp - \ + (self.actTranspiLow + self.percLow + self.interflow )) + self.capRiseUpp = pcr.min(\ + estimateStorLowBeforeCapRise,self.capRiseUpp) # original Rens's line: + # CR1_L[TYPE] = min(max(0,S2_L[TYPE]+P1_L[TYPE]-(T_a2[TYPE]+P2_L[TYPE]+Q2_L[TYPE])),CR1_L[TYPE]) + + if self.numberOfLayers == 3: + + # scale fluxes (for Upp000005) + # - potential transpiration will be used to boost the transpiration process + ADJUST = self.actBareSoilEvap + self.potTranspiration + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storUpp000005 + \ + self.infiltration) / ADJUST),0.) + self.actBareSoilEvap = ADJUST*self.actBareSoilEvap + self.actTranspiUpp000005 = ADJUST*self.potTranspiration + # + # - allowing more transpiration + remainingPotET = pcr.max(0.0, remainingPotET -\ + (self.actBareSoilEvap + self.actTranspiUpp000005)) + extraTranspiration = pcr.min(remainingPotET,\ + pcr.max(0.0, self.storUpp000005 + self.infiltration - \ + self.actBareSoilEvap - \ + self.actTranspiUpp000005)) + self.actTranspiUpp000005 += extraTranspiration + remainingPotET = pcr.max(0.0, remainingPotET - extraTranspiration) + # + # - percolation fluxes depend on the remaining water + self.percUpp000005 = pcr.min(self.percUpp000005,\ + pcr.max(0.0, self.storUpp000005 + self.infiltration - \ + self.actBareSoilEvap - \ + self.actTranspiUpp000005)) + + # scale fluxes (for Upp005030) + # - remaining potential evaporation will be used to boost the transpiration process + ADJUST = remainingPotET + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storUpp005030 + \ + self.percUpp000005)/ADJUST),0.) + self.actTranspiUpp005030 = ADJUST*remainingPotET + # - percolation fluxes depend on the remaining water + self.percUpp005030 = pcr.min(self.percUpp005030,\ + pcr.max(0.0, self.storUpp005030 + self.percUpp000005 - \ + self.actTranspiUpp005030)) + + # scale fluxes (for Low030150) + # - remaining potential evaporation will be used to boost the transpiration process + remainingPotET = pcr.max(0.0, remainingPotET - self.actTranspiUpp005030) + ADJUST = remainingPotET + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storLow030150 + \ + self.percUpp005030)/ADJUST),0.) + self.actTranspiLow030150 = ADJUST*remainingPotET + # - percolation and interflow fluxes depend on the remaining water + ADJUST = self.percLow030150 + self.interflow + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storLow030150 + \ + self.percUpp005030 - self.actTranspiLow030150)/ADJUST),0.) + self.percLow030150 = ADJUST*self.percLow030150 + self.interflow = ADJUST*self.interflow + + # capillary rise to storLow is limited to available storGroundwater + # - also limited with reducedCapRise + # + self.capRiseLow030150 = pcr.max(0.,\ + pcr.min(\ + pcr.max(0.,\ + groundwater.storGroundwater-\ + self.reducedCapRise),\ + self.capRiseLow030150)) + + # capillary rise to storUpp005030 is limited to available storLow030150 + # + estimateStorLow030150BeforeCapRise = pcr.max(0,self.storLow030150 + self.percUpp005030 - \ + (self.actTranspiLow030150 + self.percLow030150 + self.interflow )) + self.capRiseUpp005030 = pcr.min(\ + estimateStorLow030150BeforeCapRise,self.capRiseUpp005030) + + # capillary rise to storUpp000005 is limited to available storUpp005030 + # + estimateStorUpp005030BeforeCapRise = pcr.max(0,self.storUpp005030 + self.percUpp000005 - \ + (self.actTranspiUpp005030 + self.percUpp005030)) + self.capRiseUpp000005 = pcr.min(\ + estimateStorUpp005030BeforeCapRise,self.capRiseUpp000005) + + def scaleAllFluxesOptimizeEvaporationVersion27April2014(self, groundwater): + + # We re-scale all fluxes (based on available water). + # - in irrigated areas, evaporation fluxes are priority + # - percolation and interfflow losses depend on the remaining water + ######################################################################################################################################## + + # remaining total energy for evaporation fluxes: + remainingPotET = self.potBareSoilEvap + self.potTranspiration + + # for irrigation areas: interflow will be minimized + if self.name.startswith('irr'): self.interflow = 0. + + # an idea: deep percolation should consider losses during application in non paddy areas + # + if self.name == 'irrNonPaddy': + startingCropKC = 0.75 + minimum_deep_percolation = pcr.min(self.infiltration, self.potential_irrigation_loss) + maxADJUST = 2.0 + # + if self.numberOfLayers == 2: + deep_percolation = pcr.max(minimum_deep_percolation, \ + self.percLow + self.interflow) + ADJUST = self.percLow + self.interflow + ADJUST = pcr.ifthenelse(ADJUST > 0., \ + pcr.min(maxADJUST,pcr.max(0.0, deep_percolation)/ADJUST),0.) + ADJUST = pcr.ifthenelse(self.cropKC > startingCropKC, ADJUST, 1.) + self.percLow = ADJUST*self.percLow + self.interflow = ADJUST*self.interflow + if self.numberOfLayers == 3: + deep_percolation = pcr.max(minimum_deep_percolation, \ + self.percLow030150 + self.interflow) + ADJUST = self.percLow030150 + self.interflow + ADJUST = pcr.ifthenelse(ADJUST > 0., \ + pcr.min(maxADJUST,pcr.max(0.0, deep_percolation)/ADJUST),0.) + ADJUST = pcr.ifthenelse(self.cropKC > startingCropKC, ADJUST, 1.) + self.percLow030150 = ADJUST*self.percLow030150 + self.interflow = ADJUST*self.interflow + + + + # scaling all fluxes based on available water + + if self.numberOfLayers == 2: + + # scale fluxes (for Upp) + # - potential transpiration will be used to boost the transpiration process + ADJUST = self.actBareSoilEvap + self.potTranspiration + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storUpp + \ + self.infiltration) / ADJUST),0.) + self.actBareSoilEvap = ADJUST*self.actBareSoilEvap + self.actTranspiUpp = ADJUST*self.potTranspiration + # + # - allowing more transpiration + remainingPotET = pcr.max(0.0, remainingPotET -\ + (self.actBareSoilEvap + self.actTranspiUpp)) + extraTranspiration = pcr.min(remainingPotET,\ + pcr.max(0.0, self.storUpp + self.infiltration - \ + self.actBareSoilEvap - \ + self.actTranspiUpp)) + self.actTranspiUpp += extraTranspiration + remainingPotET = pcr.max(0.0, remainingPotET - extraTranspiration) + # + # - percolation fluxes depend on the remaining water + self.percUpp = pcr.min(self.percUpp,\ + pcr.max(0.0, self.storUpp + self.infiltration - \ + self.actBareSoilEvap - \ + self.actTranspiUpp)) + + # scale fluxes (for Low) + # - remaining potential evaporation will be used to boost the transpiration process + ADJUST = remainingPotET + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storLow + \ + self.percUpp)/ADJUST),0.) + self.actTranspiLow = ADJUST*remainingPotET + # - percolation and interflow fluxes depend on the remaining water + ADJUST = self.percLow + self.interflow + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storLow + \ + self.percUpp - self.actTranspiLow)/ADJUST),0.) + self.percLow = ADJUST*self.percLow + self.interflow = ADJUST*self.interflow + + # capillary rise to storLow is limited to available storGroundwater + # - also limited with reducedCapRise + self.capRiseLow = pcr.max(0.,\ + pcr.min(\ + pcr.max(0.,\ + groundwater.storGroundwater-self.reducedCapRise),self.capRiseLow)) + + # capillary rise to storUpp is limited to available storLow + estimateStorLowBeforeCapRise = pcr.max(0,self.storLow + self.percUpp - \ + (self.actTranspiLow + self.percLow + self.interflow )) + self.capRiseUpp = pcr.min(\ + estimateStorLowBeforeCapRise,self.capRiseUpp) # original Rens's line: + # CR1_L[TYPE] = min(max(0,S2_L[TYPE]+P1_L[TYPE]-(T_a2[TYPE]+P2_L[TYPE]+Q2_L[TYPE])),CR1_L[TYPE]) + + if self.numberOfLayers == 3: + + # scale fluxes (for Upp000005) + # - potential transpiration will be used to boost the transpiration process + ADJUST = self.actBareSoilEvap + self.potTranspiration + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storUpp000005 + \ + self.infiltration) / ADJUST),0.) + self.actBareSoilEvap = ADJUST*self.actBareSoilEvap + self.actTranspiUpp000005 = ADJUST*self.potTranspiration + # + # - allowing more transpiration + remainingPotET = pcr.max(0.0, remainingPotET -\ + (self.actBareSoilEvap + self.actTranspiUpp000005)) + extraTranspiration = pcr.min(remainingPotET,\ + pcr.max(0.0, self.storUpp000005 + self.infiltration - \ + self.actBareSoilEvap - \ + self.actTranspiUpp000005)) + self.actTranspiUpp000005 += extraTranspiration + remainingPotET = pcr.max(0.0, remainingPotET - extraTranspiration) + # + # - percolation fluxes depend on the remaining water + self.percUpp000005 = pcr.min(self.percUpp000005,\ + pcr.max(0.0, self.storUpp000005 + self.infiltration - \ + self.actBareSoilEvap - \ + self.actTranspiUpp000005)) + + # scale fluxes (for Upp005030) + # - remaining potential evaporation will be used to boost the transpiration process + ADJUST = remainingPotET + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storUpp005030 + \ + self.percUpp000005)/ADJUST),0.) + self.actTranspiUpp005030 = ADJUST*remainingPotET + # - percolation fluxes depend on the remaining water + self.percUpp005030 = pcr.min(self.percUpp005030,\ + pcr.max(0.0, self.storUpp005030 + self.percUpp000005 - \ + self.actTranspiUpp005030)) + + # scale fluxes (for Low030150) + # - remaining potential evaporation will be used to boost the transpiration process + remainingPotET = pcr.max(0.0, remainingPotET - self.actTranspiUpp005030) + ADJUST = remainingPotET + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storLow030150 + \ + self.percUpp005030)/ADJUST),0.) + self.actTranspiLow030150 = ADJUST*remainingPotET + # - percolation and interflow fluxes depend on the remaining water + ADJUST = self.percLow030150 + self.interflow + ADJUST = pcr.ifthenelse(ADJUST>0.0, \ + pcr.min(1.0,pcr.max(0.0, self.storLow030150 + \ + self.percUpp005030 - self.actTranspiLow030150)/ADJUST),0.) + self.percLow030150 = ADJUST*self.percLow030150 + self.interflow = ADJUST*self.interflow + + # capillary rise to storLow is limited to available storGroundwater + # - also limited with reducedCapRise + # + self.capRiseLow030150 = pcr.max(0.,\ + pcr.min(\ + pcr.max(0.,\ + groundwater.storGroundwater-\ + self.reducedCapRise),\ + self.capRiseLow030150)) + + # capillary rise to storUpp005030 is limited to available storLow030150 + # + estimateStorLow030150BeforeCapRise = pcr.max(0,self.storLow030150 + self.percUpp005030 - \ + (self.actTranspiLow030150 + self.percLow030150 + self.interflow )) + self.capRiseUpp005030 = pcr.min(\ + estimateStorLow030150BeforeCapRise,self.capRiseUpp005030) + + # capillary rise to storUpp000005 is limited to available storUpp005030 + # + estimateStorUpp005030BeforeCapRise = pcr.max(0,self.storUpp005030 + self.percUpp000005 - \ + (self.actTranspiUpp005030 + self.percUpp005030)) + self.capRiseUpp000005 = pcr.min(\ + estimateStorUpp005030BeforeCapRise,self.capRiseUpp000005) + + def updateSoilStates(self): # We give new states and make sure that no storage capacities will be exceeded. ################################################################################# @@ -1577,30 +3296,35 @@ def updateSoilStates(self, parameters): # # If necessary, reduce percolation input: percUpp = self.percUpp - self.percUpp = pcr.max(0., percUpp - \ - pcr.max(0.,self.storLow - \ - parameters.storCapLow)) - #~ self.percUpp = percUpp - \ - #~ pcr.max(0.,self.storLow - \ - #~ parameters.storCapLow) # Rens's line: P1_L[TYPE] = P1_L[TYPE]-max(0,S2_L[TYPE]-SC2[TYPE]); - #~ # PS: In the original Rens's code, P1 can be negative. - self.storLow = self.storLow - percUpp + \ - self.percUpp - # If necessary, reduce capRise input: - capRiseLow = self.capRiseLow - self.capRiseLow = pcr.max(0.,capRiseLow - \ - pcr.max(0.,self.storLow - \ - parameters.storCapLow)) - self.storLow = self.storLow - capRiseLow + \ - self.capRiseLow - # If necessary, increase interflow outflow: - addInterflow = pcr.max(0.,\ - self.storLow - parameters.storCapLow) - self.interflow += addInterflow - self.storLow -= addInterflow - - self.storLow = pcr.min(self.storLow,\ - parameters.storCapLow) + + if self.allowNegativePercolation: + # this is as defined in the original oldcalc script of Rens + self.percUpp = percUpp - \ + pcr.max(0.,self.storLow - \ + self.parameters.storCapLow) + # Rens's line: P1_L[TYPE] = P1_L[TYPE]-max(0,S2_L[TYPE]-SC2[TYPE]); + # PS: In the original Rens's code, P1 can be negative. + else: + # alternative, proposed by Edwin: avoid negative percolation + self.percUpp = pcr.max(0., percUpp - \ + pcr.max(0.,self.storLow - \ + self.parameters.storCapLow)) + self.storLow = self.storLow - percUpp + \ + self.percUpp + # If necessary, reduce capRise input: + capRiseLow = self.capRiseLow + self.capRiseLow = pcr.max(0.,capRiseLow - \ + pcr.max(0.,self.storLow - \ + self.parameters.storCapLow)) + self.storLow = self.storLow - capRiseLow + \ + self.capRiseLow + # If necessary, increase interflow outflow: + addInterflow = pcr.max(0.,\ + self.storLow - self.parameters.storCapLow) + self.interflow += addInterflow + self.storLow -= addInterflow + # + self.storLow = pcr.min(self.storLow, self.parameters.storCapLow) # # update storUpp after the following fluxes: @@ -1619,21 +3343,20 @@ def updateSoilStates(self, parameters): # # any excess above storCapUpp is handed to topWaterLayer self.satExcess = pcr.max(0.,self.storUpp - \ - parameters.storCapUpp) + self.parameters.storCapUpp) self.topWaterLayer = self.topWaterLayer + self.satExcess # any excess above minTopWaterLayer is released as directRunoff self.directRunoff = self.directRunoff + \ - pcr.max(0.,self.topWaterLayer - \ - self.minTopWaterLayer) + pcr.max(0.,self.topWaterLayer - self.minTopWaterLayer) # make sure that storage capacities are not exceeded self.topWaterLayer = pcr.min( self.topWaterLayer , \ self.minTopWaterLayer) self.storUpp = pcr.min(self.storUpp,\ - parameters.storCapUpp) + self.parameters.storCapUpp) self.storLow = pcr.min(self.storLow,\ - parameters.storCapLow) + self.parameters.storCapLow) # total actual evaporation + transpiration self.actualET += self.actBareSoilEvap + \ @@ -1679,7 +3402,7 @@ def updateSoilStates(self, parameters): percUpp005030 = self.percUpp005030 self.percUpp005030 = pcr.max(0., percUpp005030 - \ pcr.max(0.,self.storLow030150 - \ - parameters.storCapLow030150)) + self.parameters.storCapLow030150)) self.storLow030150 = self.storLow030150 - \ percUpp005030 + \ self.percUpp005030 @@ -1688,19 +3411,19 @@ def updateSoilStates(self, parameters): capRiseLow030150 = self.capRiseLow030150 self.capRiseLow030150 = pcr.max(0.,capRiseLow030150 - \ pcr.max(0.,self.storLow030150 - \ - parameters.storCapLow030150)) + self.parameters.storCapLow030150)) self.storLow030150 = self.storLow030150 - \ capRiseLow030150 + \ self.capRiseLow030150 # # If necessary, increase interflow outflow: addInterflow = pcr.max(0.,\ - self.storLow030150 - parameters.storCapLow030150) + self.storLow030150 - self.parameters.storCapLow030150) self.interflow += addInterflow self.storLow030150 -= addInterflow self.storLow030150 = pcr.min(self.storLow030150,\ - parameters.storCapLow030150) + self.parameters.storCapLow030150) # update storUpp005030 after the following fluxes: # + percUpp000005 @@ -1720,7 +3443,7 @@ def updateSoilStates(self, parameters): percUpp000005 = self.percUpp000005 self.percUpp000005 = pcr.max(0., percUpp000005 - \ pcr.max(0.,self.storUpp005030 - \ - parameters.storCapUpp005030)) + self.parameters.storCapUpp005030)) self.storUpp005030 = self.storUpp005030 - \ percUpp000005 + \ self.percUpp000005 @@ -1729,14 +3452,14 @@ def updateSoilStates(self, parameters): capRiseUpp005030 = self.capRiseUpp005030 self.capRiseUpp005030 = pcr.max(0.,capRiseUpp005030 - \ pcr.max(0.,self.storUpp005030 - \ - parameters.storCapUpp005030)) + self.parameters.storCapUpp005030)) self.storUpp005030 = self.storUpp005030 - \ capRiseUpp005030 + \ self.capRiseUpp005030 # # If necessary, introduce interflow outflow: self.interflowUpp005030 = pcr.max(0.,\ - self.storUpp005030 - parameters.storCapUpp005030) + self.storUpp005030 - self.parameters.storCapUpp005030) self.storUpp005030 = self.storUpp005030 - \ self.interflowUpp005030 @@ -1756,7 +3479,7 @@ def updateSoilStates(self, parameters): # # any excess above storCapUpp is handed to topWaterLayer self.satExcess = pcr.max(0.,self.storUpp000005 - \ - parameters.storCapUpp000005) + self.parameters.storCapUpp000005) self.topWaterLayer = self.topWaterLayer + self.satExcess # any excess above minTopWaterLayer is released as directRunoff @@ -1768,11 +3491,11 @@ def updateSoilStates(self, parameters): self.topWaterLayer = pcr.min( self.topWaterLayer , \ self.minTopWaterLayer) self.storUpp000005 = pcr.min(self.storUpp000005,\ - parameters.storCapUpp000005) + self.parameters.storCapUpp000005) self.storUpp005030 = pcr.min(self.storUpp005030,\ - parameters.storCapUpp005030) + self.parameters.storCapUpp005030) self.storLow030150 = pcr.min(self.storLow030150,\ - parameters.storCapLow030150) + self.parameters.storCapLow030150) # total actual evaporation + transpiration self.actualET += self.actBareSoilEvap + \ @@ -1810,12 +3533,14 @@ def updateSoilStates(self, parameters): self.landSurfaceRunoff = self.directRunoff + self.interflowTotal def upperSoilUpdate(self,meteo,groundwater,routing,\ - parameters,capRiseFrac,\ - nonIrrGrossDemand,swAbstractionFraction,\ + capRiseFrac,\ + nonIrrGrossDemandDict,swAbstractionFractionDict,\ currTimeStep,\ - allocSegments): + allocSegments,\ + desalinationWaterUse,\ + groundwater_pumping_region_ids,regionalAnnualGroundwaterAbstractionLimit): - if self.debugWaterBalance == str('True'): + if self.debugWaterBalance: netLqWaterToSoil = self.netLqWaterToSoil # input preTopWaterLayer = self.topWaterLayer if self.numberOfLayers == 2: @@ -1829,13 +3554,14 @@ def upperSoilUpdate(self,meteo,groundwater,routing,\ # given soil storages, we can calculate several derived states, such as # effective degree of saturation, unsaturated hydraulic conductivity, and # readily available water within the root zone. - self.getSoilStates(parameters) + self.getSoilStates() # calculate water demand (including partitioning to different source) - self.calculateWaterDemand(parameters, \ - nonIrrGrossDemand, swAbstractionFraction, \ + self.calculateWaterDemand(nonIrrGrossDemandDict, swAbstractionFractionDict, \ groundwater, routing, \ - allocSegments, currTimeStep) + allocSegments, currTimeStep,\ + desalinationWaterUse,\ + groundwater_pumping_region_ids,regionalAnnualGroundwaterAbstractionLimit) # calculate openWaterEvap: open water evaporation from the paddy field, # and update topWaterLayer after openWaterEvap. @@ -1843,36 +3569,44 @@ def upperSoilUpdate(self,meteo,groundwater,routing,\ # calculate directRunoff and infiltration, based on the improved Arno scheme (Hageman and Gates, 2003): # and update topWaterLayer (after directRunoff and infiltration). - self.calculateDirectRunoff(parameters) - self.calculateInfiltration(parameters) + self.calculateDirectRunoff() + self.calculateInfiltration() # estimate bare soil evaporation and transpiration: if self.numberOfLayers == 2: self.actBareSoilEvap, self.actTranspiUpp, self.actTranspiLow = \ - self.estimateTranspirationAndBareSoilEvap(parameters) + self.estimateTranspirationAndBareSoilEvap() if self.numberOfLayers == 3: self.actBareSoilEvap, self.actTranspiUpp000005, self.actTranspiUpp005030, self.actTranspiLow030150 = \ - self.estimateTranspirationAndBareSoilEvap(parameters) + self.estimateTranspirationAndBareSoilEvap() # estimate percolation and capillary rise, as well as interflow - self.estimateSoilFluxes(parameters,capRiseFrac) + self.estimateSoilFluxes(capRiseFrac,groundwater) # all fluxes are limited to available (source) storage - self.scaleAllFluxes(parameters, groundwater) + if self.name.startswith('irr') and self.includeIrrigation: + self.scaleAllFluxesForIrrigatedAreas(groundwater) + #~ self.scaleAllFluxes(groundwater) + else: + self.scaleAllFluxes(groundwater) # update all soil states (including get final/corrected fluxes) - self.updateSoilStates(parameters) + self.updateSoilStates() - if self.debugWaterBalance == str('True'): + # reporting irrigation transpiration deficit + self.irrigationTranspirationDeficit = 0.0 + if self.name.startswith('irr'): self.irrigationTranspirationDeficit = pcr.max(0.0, self.potTranspiration - self.actTranspiTotal) + + if self.debugWaterBalance: # - vos.waterBalanceCheck([netLqWaterToSoil,\ - self.irrGrossDemand,\ - self.satExcess],\ - [self.directRunoff, - self.openWaterEvap, - self.infiltration],\ - [ preTopWaterLayer],\ - [self.topWaterLayer],\ + vos.waterBalanceCheck([netLqWaterToSoil ,\ + self.irrGrossDemand ,\ + self.satExcess ],\ + [self.directRunoff ,\ + self.openWaterEvap ,\ + self.infiltration] ,\ + [ preTopWaterLayer ],\ + [self.topWaterLayer ] ,\ 'topWaterLayer',True,\ currTimeStep.fulldate,threshold=1e-4) diff --git a/model/landSurface.py b/model/landSurface.py old mode 100755 new mode 100644 index c5dff0483..61485245c --- a/model/landSurface.py +++ b/model/landSurface.py @@ -1,6 +1,28 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- - +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import types import pcraster as pcr import virtualOS as vos @@ -82,15 +104,15 @@ def getPseudoState(self): def __init__(self,iniItems,landmask,initialState=None): object.__init__(self) + # clone map, temporary directory, absolute path of input directory, and landmask self.cloneMap = iniItems.cloneMap self.tmpDir = iniItems.tmpDir self.inputDir = iniItems.globalOptions['inputDir'] self.landmask = landmask - # get cellArea: # TODO: integrate this one with the one coming from the routing module - self.cellArea = vos.readPCRmapClone(\ - iniItems.routingOptions['cellAreaMap'], - self.cloneMap,self.tmpDir,self.inputDir) + # cellArea (unit: m2) + self.cellArea = vos.readPCRmapClone(iniItems.routingOptions['cellAreaMap'], \ + self.cloneMap, self.tmpDir, self.inputDir) self.cellArea = pcr.ifthen(self.landmask, self.cellArea) # number of soil layers: @@ -110,10 +132,13 @@ def __init__(self,iniItems,landmask,initialState=None): # # state variables (unit: m) self.stateVars = ['storUppTotal', - 'storLowTotal'] + 'storLowTotal', + 'satDegUppTotal', + 'satDegLowTotal'] # # flux variables (unit: m/day) - self.fluxVars = ['infiltration','gwRecharge', + self.fluxVars = ['infiltration','gwRecharge','netLqWaterToSoil', + 'totalPotET', 'actualET', 'interceptEvap', 'openWaterEvap', @@ -128,13 +153,31 @@ def __init__(self,iniItems,landmask,initialState=None): 'irrGrossDemand', 'nonIrrGrossDemand', 'totalPotentialGrossDemand', - 'potGroundwaterAbstract', 'actSurfaceWaterAbstract', 'allocSurfaceWaterAbstract', + 'desalinationAbstraction', + 'desalinationAllocation', + 'nonFossilGroundwaterAbs', + 'allocNonFossilGroundwater', + 'fossilGroundwaterAbstr', + 'fossilGroundwaterAlloc', 'landSurfaceRunoff', - 'totalPotET', 'satExcess', - 'snowMelt'] + 'snowMelt', + 'totalGroundwaterAbstraction', + 'totalGroundwaterAllocation', + 'totalPotentialMaximumGrossDemand', + 'totalPotentialMaximumIrrGrossDemand', + 'totalPotentialMaximumIrrGrossDemandPaddy', + 'totalPotentialMaximumIrrGrossDemandNonPaddy', + 'totalPotentialMaximumNonIrrGrossDemand', + 'irrGrossDemandPaddy', + 'irrGrossDemandNonPaddy', + 'domesticWaterWithdrawal', + 'industryWaterWithdrawal', + 'livestockWaterWithdrawal', + 'nonIrrReturnFlow', + 'irrigationTranspirationDeficit'] # # specific variables for 2 and 3 layer soil models: # @@ -144,7 +187,7 @@ def __init__(self,iniItems,landmask,initialState=None): self.fluxVars += ['actTranspiUpp','actTranspiLow','netPercUpp'] # if self.numberOfSoilLayers == 3: - self.mainStates += ['storUpp000005','storUpp005030','storLow030150'] + self.mainStates += ['storUpp000005', 'storUpp005030', 'storLow030150'] self.stateVars += self.mainStates self.fluxVars += ['actTranspiUpp000005','actTranspiUpp005030','actTranspiLow030150', 'netPercUpp000005', 'netPercUpp005030', @@ -152,12 +195,15 @@ def __init__(self,iniItems,landmask,initialState=None): # list of all variables that will be calculated/reported in landSurface.py self.aggrVars = self.stateVars + self.fluxVars - - # assign the topography and soil parameters - self.parameters = parSoilAndTopo.SoilAndTopoParameters(iniItems,self.landmask) - self.parameters.read(iniItems) + if self.numberOfSoilLayers == 2: self.aggrVars += ['satDegUpp','satDegLow'] + if self.numberOfSoilLayers == 3: self.aggrVars += ['satDegUpp000005','satDegUpp005030','satDegLow030150'] self.debugWaterBalance = iniItems.landSurfaceOptions['debugWaterBalance'] + # TDOD: Perform water balance checks for aggregates values (from values of each land cover type). + + # limitAbstraction + self.limitAbstraction = False + if iniItems.landSurfaceOptions['limitAbstraction'] == "True": self.limitAbstraction = True # landCover types included in the simulation: self.coverTypes = ["forest","grassland"] @@ -165,35 +211,143 @@ def __init__(self,iniItems,landmask,initialState=None): self.includeIrrigation = False if iniItems.landSurfaceOptions['includeIrrigation'] == "True": self.includeIrrigation = True - self.coverTypes += ["irrPaddy","irrNonPaddy"] - - # limitAbstraction - self.limitAbstraction = False - if iniItems.landSurfaceOptions['limitAbstraction'] == "True": self.limitAbstraction = True + self.coverTypes += ["irrPaddy","irrNonPaddy"] + logger.info("Irrigation is included/considered in this run.") + else: + logger.info("Irrigation is NOT included/considered in this run.") + + # if user define their land cover types: + if 'landCoverTypes' in iniItems.landSurfaceOptions.keys(): + self.coverTypes = iniItems.landSurfaceOptions['landCoverTypes'].split(",") - # non irrigation water demand options: + # water demand options: irrigation efficiency, non irrigation water demand, and desalination supply self.waterDemandOptions(iniItems) - # + # TODO: Make an option so that users can easily perform natural runs (without water user, without reservoirs). - # instantiate self.landCoverObj[coverType] - self.landCoverObj = {} # initialize land cover objects + # pre-defined surface water source fraction for satisfying irrigation and livestock water demand + self.swAbstractionFractionData = None + self.swAbstractionFractionDataQuality = None + if 'irrigationSurfaceWaterAbstractionFractionData' in iniItems.landSurfaceOptions.keys() and\ + 'irrigationSurfaceWaterAbstractionFractionDataQuality' in iniItems.landSurfaceOptions.keys(): + if iniItems.landSurfaceOptions['irrigationSurfaceWaterAbstractionFractionData'] not in ["None", "False"] or\ + iniItems.landSurfaceOptions['irrigationSurfaceWaterAbstractionFractionDataQuality'] not in ["None", "False"]: + + logger.info('Using/incorporating the predefined surface water source of Siebert et al. (2010) for satisfying irrigation and livestock demand.') + self.swAbstractionFractionData = pcr.cover(\ + vos.readPCRmapClone(iniItems.landSurfaceOptions['irrigationSurfaceWaterAbstractionFractionData'],\ + self.cloneMap,self.tmpDir,self.inputDir), 0.0) + self.swAbstractionFractionData = pcr.ifthen(self.swAbstractionFractionData >= 0.0, \ + self.swAbstractionFractionData ) + self.swAbstractionFractionDataQuality = \ + pcr.cover(\ + vos.readPCRmapClone(iniItems.landSurfaceOptions['irrigationSurfaceWaterAbstractionFractionDataQuality'],\ + self.cloneMap,self.tmpDir,self.inputDir), 0.0) + # ignore value with the quality above 5 (very bad) + # - Note: The resulting map has values only in cells with the data auality <= 5.0 + self.swAbstractionFractionData = pcr.ifthen(self.swAbstractionFractionDataQuality <= 5.0, \ + self.swAbstractionFractionData) + + # maximum pre-defined surface water source fraction for satisfying industrial and domestic water demand: + # - if not defined (default), set it to the maximum + self.maximumNonIrrigationSurfaceWaterAbstractionFractionData = pcr.scalar(1.0) + # - based on the map of McDonald et al. (2014) + if 'maximumNonIrrigationSurfaceWaterAbstractionFractionData' in iniItems.landSurfaceOptions.keys(): + if iniItems.landSurfaceOptions['maximumNonIrrigationSurfaceWaterAbstractionFractionData'] != "None" or\ + iniItems.landSurfaceOptions['maximumNonIrrigationSurfaceWaterAbstractionFractionData'] != "False": + + logger.info('Using/incorporating the predefined surface water source of McDonald et al. (2014) for satisfying domestic and industrial demand.') + self.maximumNonIrrigationSurfaceWaterAbstractionFractionData = pcr.min(1.0,\ + pcr.cover(\ + vos.readPCRmapClone(iniItems.landSurfaceOptions['maximumNonIrrigationSurfaceWaterAbstractionFractionData'],\ + self.cloneMap,self.tmpDir,self.inputDir), 1.0)) + + # threshold values defining the preference for irrigation water source (unit: fraction/percentage) + self.treshold_to_maximize_irrigation_surface_water = \ + vos.readPCRmapClone(iniItems.landSurfaceOptions['treshold_to_maximize_irrigation_surface_water'],\ + self.cloneMap,self.tmpDir,self.inputDir) + self.treshold_to_minimize_fossil_groundwater_irrigation = \ + vos.readPCRmapClone(iniItems.landSurfaceOptions['treshold_to_minimize_fossil_groundwater_irrigation'],\ + self.cloneMap,self.tmpDir,self.inputDir) + + # assign the topography and soil parameters + self.soil_topo_parameters = {} + # - default values used for all land cover types + self.soil_topo_parameters['default'] = parSoilAndTopo.SoilAndTopoParameters(iniItems,self.landmask) + self.soil_topo_parameters['default'].read(iniItems) + # - specific soil and topography parameter (per land cover type) for coverType in self.coverTypes: + name_of_section_given_in_ini_file = str(coverType)+'Options' + dictionary_of_land_cover_settings = iniItems.__getattribute__(name_of_section_given_in_ini_file) + + if 'usingSpecificSoilTopo' not in dictionary_of_land_cover_settings.keys(): dictionary_of_land_cover_settings['usingSpecificSoilTopo'] = "False" + if dictionary_of_land_cover_settings['usingSpecificSoilTopo'] == "True": + + msg = "Using a specific set of soil and topo parameters " + msg += "as defined in the "+name_of_section_given_in_ini_file+" of the ini/configuration file." + + self.soil_topo_parameters[coverType] = parSoilAndTopo.SoilAndTopoParameters(iniItems,self.landmask) + self.soil_topo_parameters[coverType].read(iniItems, dictionary_of_land_cover_settings) + else: + + msg = "Using the default set of soil and topo parameters " + msg += "as defined in the landSurfaceOptions of the ini/configuration file." + + self.soil_topo_parameters[coverType] = self.soil_topo_parameters['default'] + + logger.info(msg) + + + # instantiate self.landCoverObj[coverType] + self.landCoverObj = {} + for coverType in self.coverTypes: self.landCoverObj[coverType] = lc.LandCover(iniItems,\ str(coverType)+'Options',\ - self.parameters,self.landmask,self.usingAllocSegments) + self.soil_topo_parameters[coverType],self.landmask,\ + self.irrigationEfficiency,\ + self.usingAllocSegments) # rescale landCover Fractions - self.scaleNaturalLandCoverFractions() - if self.includeIrrigation: self.scaleModifiedLandCoverFractions() + # - by default, the land cover fraction will always be corrected (to ensure the total of all fractions = 1.0) + self.noLandCoverFractionCorrection = False + if "noLandCoverFractionCorrection" in iniItems.landSurfaceOptions.keys(): + if iniItems.landSurfaceOptions["noLandCoverFractionCorrection"] == "True": self.noLandCoverFractionCorrection = True + # - rescaling land cover fractions + if self.noLandCoverFractionCorrection == False: + self.scaleNaturalLandCoverFractions() + if self.includeIrrigation: self.scaleModifiedLandCoverFractions() + # an option to introduce changes of land cover parameters (not only fracVegCover) + self.noAnnualChangesInLandCoverParameter = True + if 'annualChangesInLandCoverParameters' in iniItems.landSurfaceOptions.keys(): + if iniItems.landSurfaceOptions['annualChangesInLandCoverParameters'] == "True": self.noAnnualChangesInLandCoverParameter = False + + # Note that "dynamicIrrigationArea" CANNOT be combined with "noLandCoverFractionCorrection" + if self.noLandCoverFractionCorrection: self.dynamicIrrigationArea = False + + # Also note that "noAnnualChangesInLandCoverParameter = False" must be followed by "noLandCoverFractionCorrection" + if self.noAnnualChangesInLandCoverParameter == False and self.noLandCoverFractionCorrection == False: + self.noLandCoverFractionCorrection = True + msg = "WARNING! No land cover fraction correction will be performed. Please make sure that the 'total' of all fracVegCover adds to one." + logger.warning(msg) + logger.warning(msg) + logger.warning(msg) + logger.warning(msg) + logger.warning(msg) + + ######################################################################################################################################################################################### + # 29 July 2014: + # # If using historical/dynamic irrigation file (changing every year), we have to get fraction over irrigation area # (in order to calculate irrigation area for each irrigation type) # # Note that: totalIrrAreaFrac = fraction irrigated areas (e.g. paddy + nonPaddy) over the entire cell area (dimensionless) ; this value changes (if self.dynamicIrrigationArea = True) # irrTypeFracOverIrr = fraction each land cover type (paddy or nonPaddy) over the irrigation area (dimensionless) ; this value is constant for the entire simulation # - if self.includeIrrigation and self.dynamicIrrigationArea: + if self.dynamicIrrigationArea: + + logger.info('Determining fraction of total irrigated areas over each cell') + # Note that this is needed ONLY if historical irrigation areas are used (if self.dynamicIrrigationArea = True). # total irrigated area fraction (over the entire cell) totalIrrAreaFrac = 0.0 @@ -207,11 +361,15 @@ def __init__(self,iniItems,landmask,initialState=None): self.landCoverObj[coverType].irrTypeFracOverIrr = vos.getValDivZero(self.landCoverObj[coverType].fracVegCover,\ totalIrrAreaFrac, vos.smallNumber) - # Get the initialconditions + # get the initial conditions (for every land cover type) self.getInitialConditions(iniItems, initialState) - # initiate old style reporting # TODO: remove this! + # initiate old style reporting (this is useful for debuging) self.initiate_old_style_land_surface_reporting(iniItems) + + # make iniItems available for the other methods/functions: + self.iniItems = iniItems + def initiate_old_style_land_surface_reporting(self,iniItems): @@ -294,25 +452,27 @@ def initiate_old_style_land_surface_reporting(self,iniItems): str(var)+"_annuaEnd.nc",\ var,"undefined") - def getInitialConditions(self,iniItems,iniConditions=None): + def getInitialConditions(self, iniItems, iniConditions = None): - # obtaining initial land cover fractions for runs with includeIrrigation and dynamicIrrigationArea - # # starting year in integer starting_year = int(iniItems.globalOptions['startTime'][0:4]) # # check if the run start at the first day of the year: start_on_1_Jan = False if iniItems.globalOptions['startTime'][-5:] == "01-01": start_on_1_Jan = True - # + # condition to consider previous year land cover fraction consider_previous_year_land_cover_fraction = False + + + ####################################################################################################################################### + # obtaining initial land cover fractions for runs with dynamicIrrigationArea # # For non spin-up runs that start at the first day of the year (1 January), # - we have to consider the previous year land cover fractions, specifically if we consider the dynamic/expansion of irrigation areas # if iniConditions == None and start_on_1_Jan == True and \ - self.dynamicIrrigationArea and self.includeIrrigation: + self.dynamicIrrigationArea and self.noLandCoverFractionCorrection == False: # obtain the previous year land cover fractions: self.scaleDynamicIrrigation(starting_year - 1) # the previous year land cover fractions consider_previous_year_land_cover_fraction = True @@ -321,44 +481,110 @@ def getInitialConditions(self,iniItems,iniConditions=None): # - we do not have to consider the previous year land cover fractions # if consider_previous_year_land_cover_fraction == False and \ - self.dynamicIrrigationArea and self.includeIrrigation: + self.dynamicIrrigationArea and self.noLandCoverFractionCorrection == False: # just using the current year land cover fractions: self.scaleDynamicIrrigation(starting_year) # the current year land cover fractions - - # get initial land cover fractions that will be used # - for coverType in self.coverTypes:\ - self.landCoverObj[coverType].previousFracVegCover = self.landCoverObj[coverType].fracVegCover + ################################################################################################################################# - # get initial conditions + ####################################################################################################################################### + # obtaining initial land cover fractions for runs with noLandCoverFractionCorrection and annualChangesInLandCoverParameters # - # first, we set all aggregated states to zero (only the ones in mainStates): - for var in self.mainStates: vars(self)[var] = pcr.scalar(0.0) + # For non spin-up runs that start at the first day of the year (1 January), + # - we have to consider the previous year land cover fractions + # + if iniConditions == None and start_on_1_Jan == True and \ + self.noLandCoverFractionCorrection and self.noAnnualChangesInLandCoverParameter == False: + # obtain the previous year land cover fractions: + previous_year = starting_year - 1 + one_january_prev_year = str(previous_year)+"-01-01" + for coverType in self.coverTypes: + self.landCoverObj[coverType].previousFracVegCover = self.landCoverObj[coverType].get_land_cover_parameters(date_in_string = one_january_prev_year, \ + get_only_fracVegCover = True) + + #################################################################################################################################################################### + # correcting land cover fractions + total_fractions = pcr.scalar(0.0) + for coverType in self.coverTypes: + total_fractions += self.landCoverObj[coverType].previousFracVegCover + + if 'grassland' in self.landCoverObj.keys(): + self.landCoverObj['grassland'].previousFracVegCover = pcr.ifthenelse(total_fractions > 0.1, self.landCoverObj['grassland'].previousFracVegCover, 1.0) + + if 'short_natural' in self.landCoverObj.keys(): + self.landCoverObj['short_natural'].previousFracVegCover = pcr.ifthenelse(total_fractions > 0.1, self.landCoverObj['short_natural'].previousFracVegCover, 1.0) + + total_fractions = pcr.scalar(0.0) + for coverType in self.coverTypes: + total_fractions += self.landCoverObj[coverType].previousFracVegCover + + for coverType in self.coverTypes: + self.landCoverObj[coverType].previousFracVegCover = self.landCoverObj[coverType].previousFracVegCover / total_fractions + #################################################################################################################################################################### + + consider_previous_year_land_cover_fraction = True + + # For spin-up runs or for runs that start after 1 January, + # - we do not have to consider the previous year land cover fractions # - # then we initiate them in the following land cover loop: + if consider_previous_year_land_cover_fraction == False and \ + self.noLandCoverFractionCorrection and self.noAnnualChangesInLandCoverParameter == False: + # just using the current year land cover fractions: + one_january_this_year = str(starting_year)+"-01-01" + for coverType in self.coverTypes: + self.landCoverObj[coverType].previousFracVegCover = self.landCoverObj[coverType].get_land_cover_parameters(date_in_string = one_january_this_year, \ + get_only_fracVegCover = True) + + #################################################################################################################################################################### + # correcting land cover fractions + total_fractions = pcr.scalar(0.0) + for coverType in self.coverTypes: + total_fractions += self.landCoverObj[coverType].previousFracVegCover + + if 'grassland' in self.landCoverObj.keys(): + self.landCoverObj['grassland'].previousFracVegCover = pcr.ifthenelse(total_fractions > 0.1, self.landCoverObj['grassland'].previousFracVegCover, 1.0) + + if 'short_natural' in self.landCoverObj.keys(): + self.landCoverObj['short_natural'].previousFracVegCover = pcr.ifthenelse(total_fractions > 0.1, self.landCoverObj['short_natural'].previousFracVegCover, 1.0) + + total_fractions = pcr.scalar(0.0) + for coverType in self.coverTypes: + total_fractions += self.landCoverObj[coverType].previousFracVegCover + + for coverType in self.coverTypes: + self.landCoverObj[coverType].previousFracVegCover = self.landCoverObj[coverType].previousFracVegCover / total_fractions + #################################################################################################################################################################### + + + # get initial conditions + # - first, we set all aggregated states to zero (only the ones in mainStates): + for var in self.mainStates: vars(self)[var] = pcr.scalar(0.0) + # - then we initiate them in the following loop of land cover types: for coverType in self.coverTypes: if iniConditions != None: self.landCoverObj[coverType].getICsLC(iniItems,iniConditions['landSurface'][coverType]) else: self.landCoverObj[coverType].getICsLC(iniItems) - # # summarize/aggregate the initial states/storages (using the initial land cover fractions: previousFracVegCover) for var in self.mainStates: - land_cover_states = vars(self.landCoverObj[coverType])[var] + # - initial land cover fractions (dimensionless) + if isinstance(self.landCoverObj[coverType].previousFracVegCover, types.NoneType): + self.landCoverObj[coverType].previousFracVegCover = self.landCoverObj[coverType].fracVegCover land_cover_fraction = self.landCoverObj[coverType].previousFracVegCover - vars(self)[var] += land_cover_states * land_cover_fraction - + # - initial land cover states (unit: m) + land_cover_states = vars(self.landCoverObj[coverType])[var] + vars(self)[var] += land_cover_states * land_cover_fraction def waterDemandOptions(self,iniItems): # domestic water demand (unit: m/day) # self.domesticWaterDemandOption = False - try: - if iniItems.landSurfaceOptions['includeDomesticWaterDemand'] == "True":\ - self.domesticWaterDemandOption = True - except: - logger.info("WARNING! Domestic water demand is not included in the calculation.") + if iniItems.landSurfaceOptions['includeDomesticWaterDemand'] == "True": + logger.info("Domestic water demand is included in the calculation.") + self.domesticWaterDemandOption = True + else: + logger.info("Domestic water demand is NOT included in the calculation.") # if self.domesticWaterDemandOption: self.domesticWaterDemandFile = vos.getFullPath(\ @@ -367,59 +593,93 @@ def waterDemandOptions(self,iniItems): # industry water demand (unit: m/day) # self.industryWaterDemandOption = False - try: - if iniItems.landSurfaceOptions['includeIndustryWaterDemand'] == "True":\ - self.industryWaterDemandOption = True - except: - logger.info("WARNING! Industry water demand is not included in the calculation.") + if iniItems.landSurfaceOptions['includeIndustryWaterDemand'] == "True": + logger.info("Industry water demand is included in the calculation.") + self.industryWaterDemandOption = True + else: + logger.info("Industry water demand is NOT included in the calculation.") # if self.industryWaterDemandOption: self.industryWaterDemandFile = vos.getFullPath(\ iniItems.landSurfaceOptions['industryWaterDemandFile'],self.inputDir,False) + # livestock water demand (unit: m/day) + self.livestockWaterDemandOption = False + if iniItems.landSurfaceOptions['includeLivestockWaterDemand'] == "True": + logger.info("Livestock water demand is included in the calculation.") + self.livestockWaterDemandOption = True + else: + logger.info("Livestock water demand is NOT included in the calculation.") + # + if self.livestockWaterDemandOption: + self.livestockWaterDemandFile = vos.getFullPath(\ + iniItems.landSurfaceOptions['livestockWaterDemandFile'],self.inputDir,False) + # historical irrigation area (unit: hectar) self.dynamicIrrigationArea = False - try: - if iniItems.landSurfaceOptions['historicalIrrigationArea'] != "None": - self.dynamicIrrigationArea = True - else: - logger.info("Extent of irrigation areas is SAME for EVERY YEAR.") - except: - logger.info("Extent of irrigation areas is SAME for EVERY YEAR.") + if iniItems.landSurfaceOptions['historicalIrrigationArea'] != "None": + logger.info("Using the dynamicIrrigationArea option. Extent of irrigation areas is based on the file provided in the 'historicalIrrigationArea'.") + self.dynamicIrrigationArea = True # if self.dynamicIrrigationArea: self.dynamicIrrigationAreaFile = vos.getFullPath(\ iniItems.landSurfaceOptions['historicalIrrigationArea'],self.inputDir,False) + # irrigation efficiency map (in percentage) # TODO: Using the time series of efficiency (considering historical technological development). + self.irrigationEfficiency = vos.readPCRmapClone(\ + iniItems.landSurfaceOptions['irrigationEfficiency'], + self.cloneMap,self.tmpDir,self.inputDir) + # extrapolate efficiency map: # TODO: Make a better extrapolation algorithm (considering cell size, etc.). + window_size = 1.25 * pcr.clone().cellSize() + window_size = min(window_size, min(pcr.clone().nrRows(), pcr.clone().nrCols())*pcr.clone().cellSize()) + try: + self.irrigationEfficiency = pcr.cover(self.irrigationEfficiency, pcr.windowaverage(self.irrigationEfficiency, window_size)) + self.irrigationEfficiency = pcr.cover(self.irrigationEfficiency, pcr.windowaverage(self.irrigationEfficiency, window_size)) + self.irrigationEfficiency = pcr.cover(self.irrigationEfficiency, pcr.windowaverage(self.irrigationEfficiency, window_size)) + self.irrigationEfficiency = pcr.cover(self.irrigationEfficiency, pcr.windowaverage(self.irrigationEfficiency, window_size)) + self.irrigationEfficiency = pcr.cover(self.irrigationEfficiency, pcr.windowaverage(self.irrigationEfficiency, window_size)) + self.irrigationEfficiency = pcr.cover(self.irrigationEfficiency, pcr.windowaverage(self.irrigationEfficiency, 0.75)) + self.irrigationEfficiency = pcr.cover(self.irrigationEfficiency, pcr.windowaverage(self.irrigationEfficiency, 1.00)) + self.irrigationEfficiency = pcr.cover(self.irrigationEfficiency, pcr.windowaverage(self.irrigationEfficiency, 1.50)) + except: + pass + #~ self.irrigationEfficiency = pcr.ifthen(self.landmask, self.irrigationEfficiency) + self.irrigationEfficiency = pcr.cover(self.irrigationEfficiency, 1.0) + self.irrigationEfficiency = pcr.max(0.1, self.irrigationEfficiency) + self.irrigationEfficiency = pcr.ifthen(self.landmask, self.irrigationEfficiency) + + # desalination water supply option + self.includeDesalination = False + if iniItems.landSurfaceOptions['desalinationWater'] not in ["None", "False"]: + logger.info("Monthly desalination water is included.") + self.includeDesalination = True + self.desalinationWaterFile = iniItems.landSurfaceOptions['desalinationWater'] + else: + logger.info("Monthly desalination water is NOT included.") + # zones at which water allocation (surface and groundwater allocation) is determined self.usingAllocSegments = False self.allocSegments = None - try: - if iniItems.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'] != "None": - - self.usingAllocSegments = True - - self.allocSegments = vos.readPCRmapClone(\ - iniItems.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'], - self.cloneMap,self.tmpDir,self.inputDir,isLddMap=False,cover=None,isNomMap=True) - self.allocSegments = pcr.ifthen(self.landmask, self.allocSegments) - #~ self.allocSegments = pcr.clump(self.allocSegments) - - cellArea = vos.readPCRmapClone(\ - iniItems.routingOptions['cellAreaMap'], - self.cloneMap,self.tmpDir,self.inputDir) - cellArea = pcr.ifthen(self.landmask, cellArea) - self.segmentArea = pcr.areatotal(pcr.cover(cellArea, 0.0), self.allocSegments) - self.segmentArea = pcr.ifthen(self.landmask, self.segmentArea) - - else: - logger.info("Water demand can only be satisfied by the local cell.") - - except: - logger.info("Water demand can only be satisfied by the local cell.") - - # TODO: include desalinization water use + if iniItems.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'] != "None": + self.usingAllocSegments = True + + self.allocSegments = vos.readPCRmapClone(\ + iniItems.landSurfaceOptions['allocationSegmentsForGroundSurfaceWater'], + self.cloneMap,self.tmpDir,self.inputDir,isLddMap=False,cover=None,isNomMap=True) + self.allocSegments = pcr.ifthen(self.landmask, self.allocSegments) + cellArea = vos.readPCRmapClone(\ + iniItems.routingOptions['cellAreaMap'], + self.cloneMap,self.tmpDir,self.inputDir) + cellArea = pcr.ifthen(self.landmask, cellArea) + + self.segmentArea = pcr.areatotal(pcr.cover(cellArea, 0.0), self.allocSegments) + self.segmentArea = pcr.ifthen(self.landmask, self.segmentArea) + + else: + + logger.info("Water demand is satisfied by local source only.") + def scaleNaturalLandCoverFractions(self): ''' rescales natural land cover fractions (make sure the total = 1)''' @@ -490,26 +750,25 @@ def scaleNaturalLandCoverFractions(self): a,b,c = vos.getMinMaxMean(check_map) threshold = 1e-4 if abs(a) > threshold or abs(b) > threshold: - logger.info("total of 'Natural Area' fractions is not equal to 1.0 ... Min %f Max %f Mean %f" %(a,b,c)) + logger.error("total of 'Natural Area' fractions is not equal to 1.0 ... Min %f Max %f Mean %f" %(a,b,c)) def scaleModifiedLandCoverFractions(self): ''' rescales the land cover fractions with irrigation areas''' - # check + # calculate irrigatedAreaFrac (fraction of irrigation areas) irrigatedAreaFrac = pcr.spatial(pcr.scalar(0.0)) for coverType in self.coverTypes: if coverType.startswith('irr'): - irrigatedAreaFrac += \ - self.landCoverObj[coverType].fracVegCover + irrigatedAreaFrac = irrigatedAreaFrac + self.landCoverObj[coverType].fracVegCover - # scale fracVegCover of irrigation if irrigatedAreaFrac > 1 + # correcting/scaling fracVegCover of irrigation if irrigatedAreaFrac > 1 for coverType in self.coverTypes: if coverType.startswith('irr'): self.landCoverObj[coverType].fracVegCover = pcr.ifthenelse(irrigatedAreaFrac > 1.0,\ self.landCoverObj[coverType].fracVegCover/irrigatedAreaFrac,\ self.landCoverObj[coverType].fracVegCover) - # corrected irrigated area fraction: + # the corrected irrigated area fraction irrigatedAreaFrac = pcr.spatial(pcr.scalar(0.0)) for coverType in self.coverTypes: if coverType.startswith('irr'): @@ -538,48 +797,8 @@ def scaleModifiedLandCoverFractions(self): a,b,c = vos.getMinMaxMean(totalArea - pcr.scalar(1.0)) threshold = 1e-4 if abs(a) > threshold or abs(b) > threshold: - logger.info("fraction total (from all land cover types) is not equal to 1.0 ... Min %f Max %f Mean %f" %(a,b,c)) + logger.error("fraction total (from all land cover types) is not equal to 1.0 ... Min %f Max %f Mean %f" %(a,b,c)) - def getICsFor3Layers(self,iniItems,iniConditions = None): - - # first, we set the following aggregated storages to zero - self.interceptStor = pcr.scalar(0.0) - self.snowCoverSWE = pcr.scalar(0.0) - self.snowFreeWater = pcr.scalar(0.0) - self.topWaterLayer = pcr.scalar(0.0) - self.storUpp000005 = pcr.scalar(0.0) - self.storUpp005030 = pcr.scalar(0.0) - self.storLow030150 = pcr.scalar(0.0) - - # then we initiate them in the following land cover loop: - for coverType in self.coverTypes: - if iniConditions != None: - self.landCoverObj[coverType].getICsLC(iniItems,iniConditions['landSurface'][coverType]) - else: - self.landCoverObj[coverType].getICsLC(iniItems) - # summarize the following initial storages: - self.interceptStor += \ - self.landCoverObj[coverType].interceptStor*\ - self.landCoverObj[coverType].fracVegCover - self.snowCoverSWE += \ - self.landCoverObj[coverType].snowCoverSWE*\ - self.landCoverObj[coverType].fracVegCover - self.snowFreeWater += \ - self.landCoverObj[coverType].snowFreeWater*\ - self.landCoverObj[coverType].fracVegCover - self.topWaterLayer += \ - self.landCoverObj[coverType].topWaterLayer*\ - self.landCoverObj[coverType].fracVegCover - self.storUpp000005 += \ - self.landCoverObj[coverType].storUpp000005*\ - self.landCoverObj[coverType].fracVegCover - self.storUpp005030 += \ - self.landCoverObj[coverType].storUpp005030*\ - self.landCoverObj[coverType].fracVegCover - self.storLow030150 += \ - self.landCoverObj[coverType].storLow030150*\ - self.landCoverObj[coverType].fracVegCover - def obtainNonIrrWaterDemand(self,routing,currTimeStep): # get NON-Irrigation GROSS water demand and its return flow fraction @@ -587,103 +806,166 @@ def obtainNonIrrWaterDemand(self,routing,currTimeStep): if currTimeStep.timeStepPCR == 1 or currTimeStep.day == 1: if self.domesticWaterDemandOption: # - if self.domesticWaterDemandFile.endswith('.nc'): + if self.domesticWaterDemandFile.endswith(vos.netcdf_suffixes): # - self.domesticGrossDemand = pcr.cover(\ + self.domesticGrossDemand = pcr.max(0.0, pcr.cover(\ vos.netcdf2PCRobjClone(self.domesticWaterDemandFile,\ 'domesticGrossDemand',\ currTimeStep.fulldate, useDoy = 'monthly',\ - cloneMapFileName = self.cloneMap), 0.0) + cloneMapFileName = self.cloneMap), 0.0)) # - self.domesticNettoDemand = pcr.cover(\ + self.domesticNettoDemand = pcr.max(0.0, pcr.cover(\ vos.netcdf2PCRobjClone(self.domesticWaterDemandFile,\ 'domesticNettoDemand',\ currTimeStep.fulldate, useDoy = 'monthly',\ - cloneMapFileName = self.cloneMap), 0.0) + cloneMapFileName = self.cloneMap), 0.0)) else: string_month = str(currTimeStep.month) if currTimeStep.month < 10: string_month = "0"+str(currTimeStep.month) grossFileName = self.domesticWaterDemandFile+"w"+str(currTimeStep.year)+".0"+string_month - self.domesticGrossDemand = pcr.cover(\ - vos.readPCRmapClone(grossFileName,self.cloneMap,self.tmpDir), 0.0) + self.domesticGrossDemand = pcr.max(pcr.cover(\ + vos.readPCRmapClone(grossFileName,self.cloneMap,self.tmpDir), 0.0), 0.0) nettoFileName = self.domesticWaterDemandFile+"n"+str(currTimeStep.year)+".0"+string_month - self.domesticNettoDemand = pcr.cover(\ - vos.readPCRmapClone(nettoFileName,self.cloneMap,self.tmpDir), 0.0) + self.domesticNettoDemand = pcr.max(pcr.cover(\ + vos.readPCRmapClone(nettoFileName,self.cloneMap,self.tmpDir), 0.0), 0.0) else: self.domesticGrossDemand = pcr.scalar(0.0) self.domesticNettoDemand = pcr.scalar(0.0) - logger.info("WARNING! Domestic water demand is not included.") + logger.debug("Domestic water demand is NOT included.") - # ignore small values of demand (less than 1 m3 and/or 0.0001 m): - self.domesticGrossDemand = pcr.rounddown(self.domesticGrossDemand*routing.cellArea)/routing.cellArea - self.domesticNettoDemand = pcr.rounddown(self.domesticNettoDemand*routing.cellArea)/routing.cellArea - self.domesticGrossDemand = pcr.rounddown(self.domesticGrossDemand*routing.cellArea)/routing.cellArea - self.domesticNettoDemand = pcr.rounddown(self.domesticNettoDemand*routing.cellArea)/routing.cellArea + # gross and netto domestic water demand in m/day self.domesticGrossDemand = pcr.cover(self.domesticGrossDemand,0.0) self.domesticNettoDemand = pcr.cover(self.domesticNettoDemand,0.0) self.domesticNettoDemand = pcr.min(self.domesticGrossDemand, self.domesticNettoDemand) # industry water demand - if currTimeStep.timeStepPCR == 1 or currTimeStep.doy == 1: + if currTimeStep.timeStepPCR == 1 or currTimeStep.day == 1: if self.industryWaterDemandOption: # - if self.industryWaterDemandFile.endswith('.nc'): + if self.industryWaterDemandFile.endswith(vos.netcdf_suffixes): # - self.industryGrossDemand = pcr.cover(\ + self.industryGrossDemand = pcr.max(0.0, pcr.cover(\ vos.netcdf2PCRobjClone(self.industryWaterDemandFile,\ 'industryGrossDemand',\ - currTimeStep.fulldate, useDoy = 'yearly',\ - cloneMapFileName = self.cloneMap), 0.0) + currTimeStep.fulldate, useDoy = 'monthly',\ + cloneMapFileName = self.cloneMap), 0.0)) # - self.industryNettoDemand = pcr.cover(\ + self.industryNettoDemand = pcr.max(0.0, pcr.cover(\ vos.netcdf2PCRobjClone(self.industryWaterDemandFile,\ 'industryNettoDemand',\ - currTimeStep.fulldate, useDoy = 'yearly',\ - cloneMapFileName = self.cloneMap), 0.0) + currTimeStep.fulldate, useDoy = 'monthly',\ + cloneMapFileName = self.cloneMap), 0.0)) else: grossFileName = self.industryWaterDemandFile+"w"+str(currTimeStep.year)+".map" - self.industryGrossDemand = pcr.cover(\ - vos.readPCRmapClone(grossFileName,self.cloneMap,self.tmpDir), 0.0) + self.industryGrossDemand = pcr.max(0.0, pcr.cover(\ + vos.readPCRmapClone(grossFileName,self.cloneMap,self.tmpDir), 0.0)) nettoFileName = self.industryWaterDemandFile+"n"+str(currTimeStep.year)+".map" - self.industryNettoDemand = pcr.cover(\ - vos.readPCRmapClone(nettoFileName,self.cloneMap,self.tmpDir), 0.0) + self.industryNettoDemand = pcr.max(0.0, pcr.cover(\ + vos.readPCRmapClone(nettoFileName,self.cloneMap,self.tmpDir), 0.0)) else: self.industryGrossDemand = pcr.scalar(0.0) self.industryNettoDemand = pcr.scalar(0.0) - logger.info("WARNING! Industry water demand is not included.") + logger.debug("Industry water demand is NOT included.") - - # ignore small values of demand (less than 1 m3 and/or 0.0001 m): - self.industryGrossDemand = pcr.rounddown(self.industryGrossDemand*routing.cellArea)/routing.cellArea - self.industryNettoDemand = pcr.rounddown(self.industryNettoDemand*routing.cellArea)/routing.cellArea - self.industryGrossDemand = pcr.rounddown(self.industryGrossDemand*routing.cellArea)/routing.cellArea - self.industryNettoDemand = pcr.rounddown(self.industryNettoDemand*routing.cellArea)/routing.cellArea + # gross and netto industrial water demand in m/day self.industryGrossDemand = pcr.cover(self.industryGrossDemand,0.0) self.industryNettoDemand = pcr.cover(self.industryNettoDemand,0.0) self.industryNettoDemand = pcr.min(self.industryGrossDemand, self.industryNettoDemand) - self.domesticGrossDemand = pcr.ifthen(self.landmask, self.domesticGrossDemand) - self.domesticNettoDemand = pcr.ifthen(self.landmask, self.domesticNettoDemand) - self.industryGrossDemand = pcr.ifthen(self.landmask, self.industryGrossDemand) - self.industryNettoDemand = pcr.ifthen(self.landmask, self.industryNettoDemand) + # livestock water demand + if currTimeStep.timeStepPCR == 1 or currTimeStep.day == 1: + if self.livestockWaterDemandOption: + # + if self.livestockWaterDemandFile.endswith(vos.netcdf_suffixes): + # + self.livestockGrossDemand = pcr.max(0.0, pcr.cover(\ + vos.netcdf2PCRobjClone(self.livestockWaterDemandFile,\ + 'livestockGrossDemand',\ + currTimeStep.fulldate, useDoy = 'monthly',\ + cloneMapFileName = self.cloneMap), 0.0)) + # + self.livestockNettoDemand = pcr.max(0.0, pcr.cover(\ + vos.netcdf2PCRobjClone(self.livestockWaterDemandFile,\ + 'livestockNettoDemand',\ + currTimeStep.fulldate, useDoy = 'monthly',\ + cloneMapFileName = self.cloneMap), 0.0)) + else: + string_month = str(currTimeStep.month) + if currTimeStep.month < 10: string_month = "0"+str(currTimeStep.month) + grossFileName = self.livestockWaterDemandFile+"w"+str(currTimeStep.year)+".0"+string_month + self.livestockGrossDemand = pcr.max(pcr.cover(\ + vos.readPCRmapClone(grossFileName,self.cloneMap,self.tmpDir), 0.0), 0.0) + nettoFileName = self.livestockWaterDemandFile+"n"+str(currTimeStep.year)+".0"+string_month + self.livestockNettoDemand = pcr.max(pcr.cover(\ + vos.readPCRmapClone(nettoFileName,self.cloneMap,self.tmpDir), 0.0), 0.0) + else: + self.livestockGrossDemand = pcr.scalar(0.0) + self.livestockNettoDemand = pcr.scalar(0.0) + logger.debug("Livestock water demand is NOT included.") + + # gross and netto livestock water demand in m/day + self.livestockGrossDemand = pcr.cover(self.livestockGrossDemand,0.0) + self.livestockNettoDemand = pcr.cover(self.livestockNettoDemand,0.0) + self.livestockNettoDemand = pcr.min(self.livestockGrossDemand, self.livestockNettoDemand) + + # GROSS domestic, industrial and livestock water demands (unit: m/day) + self.domesticGrossDemand = pcr.ifthen(self.landmask, self.domesticGrossDemand ) + self.domesticNettoDemand = pcr.ifthen(self.landmask, self.domesticNettoDemand ) + self.industryGrossDemand = pcr.ifthen(self.landmask, self.industryGrossDemand ) + self.industryNettoDemand = pcr.ifthen(self.landmask, self.industryNettoDemand ) + self.livestockGrossDemand = pcr.ifthen(self.landmask, self.livestockGrossDemand) + self.livestockNettoDemand = pcr.ifthen(self.landmask, self.livestockNettoDemand) - # total (potential) non irrigation water demand - potentialNonIrrGrossWaterDemand = self.domesticGrossDemand + self.industryGrossDemand - potentialNonIrrNettoWaterDemand = pcr.min(potentialNonIrrGrossWaterDemand,\ - self.domesticNettoDemand + self.industryNettoDemand) + # RETURN FLOW fractions for domestic, industrial and livestock water demands (unit: fraction/percentage) + self.domesticReturnFlowFraction = pcr.min(1.0, pcr.max(0.0, 1.0 - vos.getValDivZero(self.domesticNettoDemand, self.domesticGrossDemand))) + self.industryReturnFlowFraction = pcr.min(1.0, pcr.max(0.0, 1.0 - vos.getValDivZero(self.industryNettoDemand, self.industryGrossDemand))) + self.livestockReturnFlowFraction = pcr.min(1.0, pcr.max(0.0, 1.0 - vos.getValDivZero(self.livestockNettoDemand, self.livestockGrossDemand))) - # fraction of return flow from domestic and industrial water demand - nonIrrReturnFlowFraction = vos.getValDivZero(\ - (potentialNonIrrGrossWaterDemand - potentialNonIrrNettoWaterDemand),\ - (potentialNonIrrGrossWaterDemand), vos.smallNumber) + # make a dictionary summarizing potential demand (potential withdrawal) and its return flow fraction + nonIrrigationWaterDemandDict = {} + nonIrrigationWaterDemandDict['potential_demand'] = {} + nonIrrigationWaterDemandDict['potential_demand']['domestic'] = self.domesticGrossDemand + nonIrrigationWaterDemandDict['potential_demand']['industry'] = self.industryGrossDemand + nonIrrigationWaterDemandDict['potential_demand']['livestock'] = self.livestockGrossDemand + nonIrrigationWaterDemandDict['return_flow_fraction'] = {} + nonIrrigationWaterDemandDict['return_flow_fraction']['domestic'] = pcr.cover(pcr.min(1.0, pcr.roundup(self.domesticReturnFlowFraction *1000.)/1000.), 1.0) + nonIrrigationWaterDemandDict['return_flow_fraction']['industry'] = pcr.cover(pcr.min(1.0, pcr.roundup(self.industryReturnFlowFraction *1000.)/1000.), 1.0) + nonIrrigationWaterDemandDict['return_flow_fraction']['livestock'] = pcr.cover(pcr.min(1.0, pcr.roundup(self.livestockReturnFlowFraction*1000.)/1000.), 1.0) - return potentialNonIrrGrossWaterDemand, nonIrrReturnFlowFraction + return nonIrrigationWaterDemandDict def calculateCapRiseFrac(self,groundwater,routing,currTimeStep): # calculate cell fraction influenced by capillary rise: + # relative groundwater head (m) above the minimum elevation within a grid cell + if groundwater.useMODFLOW == True: + + dzGroundwater = groundwater.relativeGroundwaterHead + + # update dzGroundwater from file, from modflow calculation, using the previous time step + # - assumption that it will be updated once every month + + if currTimeStep.day == 1 and currTimeStep.timeStepPCR > 1: + + # for online coupling, we will read files from pcraster maps + directory = self.iniItems.main_output_directory + "/modflow/transient/maps/" + + # - relative groundwater head from MODFLOW + yesterday = str(currTimeStep.yesterday()) + filename = directory + "relativeGroundwaterHead_" + str(yesterday) + ".map" + dzGroundwater = pcr.ifthen(self.landmask, pcr.cover(vos.readPCRmapClone(filename, self.cloneMap, self.tmpDir), 0.0)) + + else: + dzGroundwater = groundwater.storGroundwater/groundwater.specificYield + + # add some tolerance/influence level (unit: m) + dzGroundwater += self.soil_topo_parameters['default'].maxGWCapRise; + + # set minimum value to zero (zero relativeGroundwaterHead indicate no capRiseFrac) + dzGroundwater = pcr.max(0.0, dzGroundwater) + # approximate cell fraction under influence of capillary rise - dzGroundwater = groundwater.storGroundwater/groundwater.specificYield + self.parameters.maxGWCapRise; + FRACWAT = pcr.scalar(0.0); if currTimeStep.timeStepPCR > 1: FRACWAT = pcr.cover(routing.WaterBodies.fracWat, 0.0); @@ -700,32 +982,38 @@ def calculateCapRiseFrac(self,groundwater,routing,currTimeStep): self.cloneMap,self.tmpDir,self.inputDir) FRACWAT = pcr.cover(FRACWAT, 0.0) - CRFRAC = pcr.min( 1.0,1.0 -(self.parameters.dzRel0100-dzGroundwater)*0.1 /pcr.max(1e-3,self.parameters.dzRel0100-self.parameters.dzRel0090 )); - CRFRAC = pcr.ifthenelse(dzGroundwater 70% , the potential of using surface water as its primary source is very high - swAbstractionFraction = pcr.ifthenelse(swAbstractionFraction > 0.7, 1.0, swAbstractionFraction) - swAbstractionFraction = pcr.roundup(swAbstractionFraction*10.)/10. - swAbstractionFraction = pcr.min(1.0, swAbstractionFraction) - - # TODO: constrain swAbstractionFraction with Siebert's map - if self.usingAllocSegments: swAbstractionFraction = pcr.areamaximum(swAbstractionFraction, self.allocSegments) - swAbstractionFraction = pcr.cover(swAbstractionFraction, 0.0) + swAbstractionFraction = pcr.cover(swAbstractionFraction, 1.0) swAbstractionFraction = pcr.ifthen(self.landmask, swAbstractionFraction) - gwAbstractionFraction = 1.0 - swAbstractionFraction - return swAbstractionFraction + # making a dictionary containing the surface water fraction for various purpose + swAbstractionFractionDict = {} + # - the default estimate (based on de Graaf et al., 2014) + swAbstractionFractionDict['estimate'] = swAbstractionFraction + # - for irrigation and livestock purpose + swAbstractionFractionDict['irrigation'] = swAbstractionFraction + # - for industrial and domestic purpose + swAbstractionFractionDict['max_for_non_irrigation'] = swAbstractionFraction + # + # - a treshold fraction value to optimize/maximize surface water withdrawal for irrigation + # Principle: Areas with swAbstractionFractionDict['irrigation'] above this treshold will prioritize surface water use for irrigation purpose. + # A zero treshold value will ignore this principle. + swAbstractionFractionDict['treshold_to_maximize_irrigation_surface_water'] = self.treshold_to_maximize_irrigation_surface_water + # + # - a treshold fraction value to minimize fossil groundwater withdrawal, particularly to remove the unrealistic areas of fossil groundwater abstraction + # Principle: Areas with swAbstractionFractionDict['irrigation'] above this treshold will not extract fossil groundwater. + swAbstractionFractionDict['treshold_to_minimize_fossil_groundwater_irrigation'] = self.treshold_to_minimize_fossil_groundwater_irrigation + + # if defined, incorporating the pre-defined fraction of surface water sources (e.g. based on Siebert et al., 2014 and McDonald et al., 2014) + if not isinstance(self.swAbstractionFractionData, types.NoneType): + + logger.debug('Using/incorporating the predefined fractions of surface water source.') + swAbstractionFractionDict['estimate'] = swAbstractionFraction + swAbstractionFractionDict['irrigation'] = self.partitioningGroundSurfaceAbstractionForIrrigation(swAbstractionFraction,\ + self.swAbstractionFractionData,\ + self.swAbstractionFractionDataQuality) + swAbstractionFractionDict['max_for_non_irrigation'] = self.maximumNonIrrigationSurfaceWaterAbstractionFractionData + + else: + logger.debug('NOT using/incorporating the predefined fractions of surface water source.') + + return swAbstractionFractionDict + + def partitioningGroundSurfaceAbstractionForIrrigation(self,\ + swAbstractionFractionEstimate,\ + swAbstractionFractionData,\ + swAbstractionFractionDataQuality): + + # surface water source fraction based on Stefan Siebert's map: + factor = 0.5 # using this factor, the minimum value for the following 'data_weight_value' is 0.75 (for swAbstractionFractionDataQuality == 5) + data_weight_value = pcr.scalar(1.0) - \ + (pcr.min(5., pcr.max(0.0, swAbstractionFractionDataQuality))/10.0)*factor + + swAbstractionFractionForIrrigation = data_weight_value * swAbstractionFractionData +\ + (1.0 - data_weight_value) * swAbstractionFractionEstimate + + swAbstractionFractionForIrrigation = pcr.cover(swAbstractionFractionForIrrigation, swAbstractionFractionEstimate) + swAbstractionFractionForIrrigation = pcr.cover(swAbstractionFractionForIrrigation, 1.0) + swAbstractionFractionForIrrigation = pcr.ifthen(self.landmask, swAbstractionFractionForIrrigation) + + return swAbstractionFractionForIrrigation def scaleDynamicIrrigation(self,yearInInteger): - # This method is to update fracVegCover of landCover for historical irrigation areas (done at yearly basis). - # Available datasets are only from 1960 to 2010 (status on 24 September 2010) - yearInInteger = int(yearInInteger) - if yearInInteger < 1960 or yearInInteger > 2010:\ - logger.info('Dataset of historical irrigation areas is only available from 1960 to 2010.') - yearInInteger = min(2010, max(1960, yearInInteger)) + + #~ # Available datasets are only from 1960 to 2010 (status on 24 September 2010) + #~ yearInInteger = int(yearInInteger) + #~ if float(yearInInteger) < 1960. or float(yearInInteger) > 2010.: + #~ msg = 'Dataset for the year '+str(yearInInteger)+" is not available. Dataset of historical irrigation areas is only available from 1960 to 2010." + #~ logger.warning(msg) + #~ yearInInteger = min(2010, max(1960, yearInInteger)) + # + # TODO: Generally, I do not need the aforementioned lines as I have defined the functions "findLastYearInNCTime" and "findFirstYearInNCTime" in the module virtualOS.py + # However, Niko still need them for his DA scheme as we somehow his DA scheme cannot handle the netcdf file of historical irrigation areas (and therefore we have to use pcraster map files). + + yearInString = str(yearInInteger) # read historical irrigation areas @@ -782,7 +1118,7 @@ def scaleDynamicIrrigation(self,yearInInteger): cloneMapFileName = self.cloneMap), 0.0) # unit: m2 (input file is in hectare) else: irrigation_pcraster_file = self.dynamicIrrigationAreaFile + yearInString + ".map" - logger.info('reading irrigation area map from : '+irrigation_pcraster_file) + logger.debug('reading irrigation area map from : '+irrigation_pcraster_file) self.irrigationArea = 10000. * pcr.cover(\ vos.readPCRmapClone(irrigation_pcraster_file,\ self.cloneMap,self.tmpDir), 0.0) # unit: m2 (input file is in hectare) @@ -810,23 +1146,108 @@ def scaleDynamicIrrigation(self,yearInInteger): def update(self,meteo,groundwater,routing,currTimeStep): + # updating regional groundwater abstraction limit (at the begining of the year or at the beginning of simulation) + if groundwater.limitRegionalAnnualGroundwaterAbstraction: + + logger.debug('Total groundwater abstraction is limited by regional annual pumping capacity.') + if currTimeStep.doy == 1 or currTimeStep.timeStepPCR == 1: + + self.groundwater_pumping_region_ids = \ + vos.netcdf2PCRobjClone(groundwater.pumpingCapacityNC,'region_ids',\ + currTimeStep.fulldate, useDoy = 'yearly', cloneMapFileName = self.cloneMap) + other_ids = pcr.mapmaximum(self.groundwater_pumping_region_ids) + pcr.scalar(1000.) + pcr.uniqueid(self.landmask) + self.groundwater_pumping_region_ids = pcr.cover(self.groundwater_pumping_region_ids, other_ids) + self.groundwater_pumping_region_ids = pcr.ifthen(self.landmask, pcr.nominal(self.groundwater_pumping_region_ids)) + + self.regionalAnnualGroundwaterAbstractionLimit = \ + pcr.ifthen(self.landmask,\ + pcr.cover(\ + vos.netcdf2PCRobjClone(groundwater.pumpingCapacityNC,'regional_pumping_limit',\ + currTimeStep.fulldate, useDoy = 'yearly', cloneMapFileName = self.cloneMap), 0.0)) + + self.regionalAnnualGroundwaterAbstractionLimit = pcr.areamaximum(self.regionalAnnualGroundwaterAbstractionLimit, self.groundwater_pumping_region_ids) + + self.regionalAnnualGroundwaterAbstractionLimit *= 1000. * 1000. * 1000. # unit: m3/year + self.regionalAnnualGroundwaterAbstractionLimit = pcr.ifthen(self.landmask,\ + self.regionalAnnualGroundwaterAbstractionLimit) + # minimum value (unit: m3/year at the regional scale) + minimum_value = 1000. + self.regionalAnnualGroundwaterAbstractionLimit = pcr.max(minimum_value,\ + self.regionalAnnualGroundwaterAbstractionLimit) + else: + + logger.debug('Total groundwater abstraction is NOT limited by regional annual pumping capacity.') + self.groundwater_pumping_region_ids = None + self.regionalAnnualGroundwaterAbstractionLimit = None + # updating fracVegCover of each landCover (landCover fraction) # - if considering dynamic/historical irrigation areas (expansion/reduction of irrigated areas) - # - done at yearly basis, at the beginning of each year - # - note, for the first time step (timeStepPCR == 1), land cover fractions have been defined in getInitialConditions + # - done at yearly basis, at the beginning of each year, also at the beginning of simulation # if self.dynamicIrrigationArea and self.includeIrrigation and \ - (currTimeStep.timeStepPCR > 1 and currTimeStep.doy == 1): - # + (currTimeStep.timeStepPCR == 1 or currTimeStep.doy == 1) and self.noLandCoverFractionCorrection == False: + # scale land cover fraction (due to expansion/reduction of irrigated areas) self.scaleDynamicIrrigation(currTimeStep.year) + #################################################################################################################################################################### + # correcting land cover fractions + total_fractions = pcr.scalar(0.0) + for coverType in self.coverTypes: + total_fractions += self.landCoverObj[coverType].fracVegCover + + if 'grassland' in self.landCoverObj.keys(): + self.landCoverObj['grassland'].fracVegCover = pcr.ifthenelse(total_fractions > 0.1, self.landCoverObj['grassland'].fracVegCover, 1.0) + + if 'short_natural' in self.landCoverObj.keys(): + self.landCoverObj['short_natural'].fracVegCover = pcr.ifthenelse(total_fractions > 0.1, self.landCoverObj['short_natural'].fracVegCover, 1.0) + + total_fractions = pcr.scalar(0.0) + for coverType in self.coverTypes: + total_fractions += self.landCoverObj[coverType].fracVegCover + + for coverType in self.coverTypes: + self.landCoverObj[coverType].fracVegCover = self.landCoverObj[coverType].fracVegCover / total_fractions + #################################################################################################################################################################### + + + # read land cover fractions from netcdf files + # - assumption: annual resolution + if self.noAnnualChangesInLandCoverParameter == False and self.dynamicIrrigationArea == False and \ + (currTimeStep.timeStepPCR == 1 or currTimeStep.doy == 1): + msg = 'Read land cover fractions based on the given netcdf file.' + logger.debug(msg) + for coverType in self.coverTypes: + self.landCoverObj[coverType].fracVegCover = self.landCoverObj[coverType].get_land_cover_parameters(date_in_string = str(currTimeStep.fulldate), \ + get_only_fracVegCover = True) + + #################################################################################################################################################################### + # correcting land cover fractions + total_fractions = pcr.scalar(0.0) + for coverType in self.coverTypes: + total_fractions += self.landCoverObj[coverType].fracVegCover + + if 'grassland' in self.landCoverObj.keys(): + self.landCoverObj['grassland'].fracVegCover = pcr.ifthenelse(total_fractions > 0.1, self.landCoverObj['grassland'].fracVegCover, 1.0) + + if 'short_natural' in self.landCoverObj.keys(): + self.landCoverObj['short_natural'].fracVegCover = pcr.ifthenelse(total_fractions > 0.1, self.landCoverObj['short_natural'].fracVegCover, 1.0) + + total_fractions = pcr.scalar(0.0) + for coverType in self.coverTypes: + total_fractions += self.landCoverObj[coverType].fracVegCover + + for coverType in self.coverTypes: + self.landCoverObj[coverType].fracVegCover = self.landCoverObj[coverType].fracVegCover / total_fractions + #################################################################################################################################################################### + + # transfer some states, due to changes/dynamics in land cover conditions # - if considering dynamic/historical irrigation areas (expansion/reduction of irrigated areas) # - done at yearly basis, at the beginning of each year # - note that this must be done at the beginning of each year, including for the first time step (timeStepPCR == 1) # - if self.dynamicIrrigationArea and self.includeIrrigation and currTimeStep.doy == 1: + if ((self.dynamicIrrigationArea and self.includeIrrigation) or self.noAnnualChangesInLandCoverParameter == False) and currTimeStep.doy == 1: # # loop for all main states: for var in self.mainStates: @@ -875,10 +1296,10 @@ def update(self,meteo,groundwater,routing,currTimeStep): a,b,c = vos.getMinMaxMean(check_map) threshold = 1e-5 if abs(a) > threshold or abs(b) > threshold: - logger.info("WARNING !!!!! Error in transfering states (due to dynamic in land cover fractions) ... Min %f Max %f Mean %f" %(a,b,c)) + logger.warning("Error in transfering states (due to dynamic in land cover fractions) ... Min %f Max %f Mean %f" %(a,b,c)) else: - logger.info("Successful in transfering states (for considering dynamic in land cover fractions) ... Min %f Max %f Mean %f" %(a,b,c)) - # + logger.info("Successful in transfering states (after change in land cover fractions) ... Min %f Max %f Mean %f" %(a,b,c)) + # for the last day of the year, we have to save the previous land cover fractions (to be considered in the next time step) if self.dynamicIrrigationArea and self.includeIrrigation and currTimeStep.isLastDayOfYear: # save the current state of fracVegCover @@ -888,26 +1309,39 @@ def update(self,meteo,groundwater,routing,currTimeStep): # calculate cell fraction influenced by capillary rise: self.capRiseFrac = self.calculateCapRiseFrac(groundwater,routing,currTimeStep) - # get domestic and industrial water demand, including their (combined) return flow fraction - self.potentialNonIrrGrossWaterDemand, self.nonIrrReturnFlowFraction = \ - self.obtainNonIrrWaterDemand(routing, currTimeStep) + # get a dictionary containing livestock, domestic and industrial water demand, including their return flow fractions + self.nonIrrigationWaterDemandDict = self.obtainNonIrrWaterDemand(routing, currTimeStep) - # partitioning abstraction sources: groundwater and surface water - self.swAbstractionFraction = \ - self.partitioningGroundSurfaceAbstraction(groundwater,routing) + # get a dictionary containing the partitioning of withdrawal/abstraction sources: (from groundwater and surface water) + self.swAbstractionFractionDict = self.partitioningGroundSurfaceAbstraction(groundwater,routing) + + # get desalination water use (m/day); assume this one as potential supply + if self.includeDesalination: + logger.debug("Monthly desalination water use is included.") + if (currTimeStep.timeStepPCR == 1 or currTimeStep.day == 1): + desalinationWaterUse = \ + pcr.ifthen(self.landmask,\ + pcr.cover(\ + vos.netcdf2PCRobjClone(self.desalinationWaterFile,'desalination_water_use',\ + currTimeStep.fulldate, useDoy = 'monthly', cloneMapFileName = self.cloneMap), 0.0)) + self.desalinationWaterUse = pcr.max(0.0, desalinationWaterUse) + else: + logger.debug("Monthly desalination water use is NOT included.") + self.desalinationWaterUse = pcr.scalar(0.0) # update (loop per each land cover type): for coverType in self.coverTypes: logger.info("Updating land cover: "+str(coverType)) - print(coverType) self.landCoverObj[coverType].updateLC(meteo,groundwater,routing,\ - self.parameters,self.capRiseFrac,\ - self.potentialNonIrrGrossWaterDemand,\ - self.swAbstractionFraction,\ + self.capRiseFrac,\ + self.nonIrrigationWaterDemandDict,\ + self.swAbstractionFractionDict,\ currTimeStep,\ - allocSegments = self.allocSegments) - + self.allocSegments,\ + self.desalinationWaterUse,\ + self.groundwater_pumping_region_ids,self.regionalAnnualGroundwaterAbstractionLimit) + # first, we set all aggregated values/variables to zero: for var in self.aggrVars: vars(self)[var] = pcr.scalar(0.0) # @@ -916,8 +1350,7 @@ def update(self,meteo,groundwater,routing,currTimeStep): # calculate the aggregrated or global landSurface values: for var in self.aggrVars: vars(self)[var] += \ - self.landCoverObj[coverType].fracVegCover*\ - vars(self.landCoverObj[coverType])[var] + self.landCoverObj[coverType].fracVegCover * vars(self.landCoverObj[coverType])[var] # total storages (unit: m3) in the entire landSurface module if self.numberOfSoilLayers == 2: self.totalSto = \ @@ -932,45 +1365,8 @@ def update(self,meteo,groundwater,routing,currTimeStep): self.storUpp000005 + self.storUpp005030 +\ self.storLow030150 - # saturation degrees (needed only for reporting): - # - if self.numberOfSoilLayers == 2: - self.satDegUpp = vos.getValDivZero(\ - self.storUpp, self.parameters.storCapUpp,\ - vos.smallNumber,0.) - self.satDegUpp = pcr.ifthen(self.landmask, self.satDegUpp) - self.satDegLow = vos.getValDivZero(\ - self.storLow, self.parameters.storCapLow,\ - vos.smallNumber,0.) - self.satDegLow = pcr.ifthen(self.landmask, self.satDegLow) - - self.satDegUppTotal = self.satDegUpp - self.satDegLowTotal = self.satDegLow - - if self.numberOfSoilLayers == 3: - self.satDegUpp000005 = vos.getValDivZero(\ - self.storUpp000005, self.parameters.storCapUpp000005,\ - vos.smallNumber,0.) - self.satDegUpp000005 = pcr.ifthen(self.landmask, self.satDegUpp000005) - self.satDegUpp005030 = vos.getValDivZero(\ - self.storUpp005030, self.parameters.storCapUpp005030,\ - vos.smallNumber,0.) - self.satDegUpp005030 = pcr.ifthen(self.landmask, self.satDegUpp005030) - self.satDegLow030150 = vos.getValDivZero(\ - self.storLow030150, self.parameters.storCapLow030150,\ - vos.smallNumber,0.) - self.satDegLow030150 = pcr.ifthen(self.landmask, self.satDegLow030150) - - self.satDegUppTotal = vos.getValDivZero(\ - self.storUpp000005 + self.storUpp005030,\ - self.parameters.storCapUpp000005 + \ - self.parameters.storCapUpp005030,\ - vos.smallNumber,0.) - self.satDegUppTotal = pcr.ifthen(self.landmask, self.satDegUppTotal) - self.satDegLowTotal = self.satDegLow030150 - - # old-style reporting - self.old_style_land_surface_reporting(currTimeStep) # TODO: remove this one + # old-style reporting (this is useful for debugging) + self.old_style_land_surface_reporting(currTimeStep) def old_style_land_surface_reporting(self,currTimeStep): @@ -986,7 +1382,7 @@ def old_style_land_surface_reporting(self,currTimeStep): self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_dailyTot.nc",\ var,\ - pcr2numpy(self.__getattribute__(var),vos.MV),\ + pcr.pcr2numpy(self.__getattribute__(var),vos.MV),\ timeStamp,timestepPCR-1) # writing monthly output to netcdf files @@ -1008,7 +1404,7 @@ def old_style_land_surface_reporting(self,currTimeStep): self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_monthTot.nc",\ var,\ - pcr2numpy(self.__getattribute__(var+'MonthTot'),\ + pcr.pcr2numpy(self.__getattribute__(var+'MonthTot'),\ vos.MV),timeStamp,currTimeStep.monthIdx-1) # -average if self.outMonthAvgNC[0] != "None": @@ -1031,7 +1427,7 @@ def old_style_land_surface_reporting(self,currTimeStep): self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_monthAvg.nc",\ var,\ - pcr2numpy(self.__getattribute__(var+'MonthAvg'),\ + pcr.pcr2numpy(self.__getattribute__(var+'MonthAvg'),\ vos.MV),timeStamp,currTimeStep.monthIdx-1) # # -last day of the month @@ -1042,7 +1438,7 @@ def old_style_land_surface_reporting(self,currTimeStep): self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_monthEnd.nc",\ var,\ - pcr2numpy(self.__getattribute__(var),vos.MV),\ + pcr.pcr2numpy(self.__getattribute__(var),vos.MV),\ timeStamp,currTimeStep.monthIdx-1) # writing yearly output to netcdf files @@ -1064,7 +1460,7 @@ def old_style_land_surface_reporting(self,currTimeStep): self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_annuaTot.nc",\ var,\ - pcr2numpy(self.__getattribute__(var+'AnnuaTot'),\ + pcr.pcr2numpy(self.__getattribute__(var+'AnnuaTot'),\ vos.MV),timeStamp,currTimeStep.annuaIdx-1) # -average if self.outAnnuaAvgNC[0] != "None": @@ -1086,7 +1482,7 @@ def old_style_land_surface_reporting(self,currTimeStep): self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_annuaAvg.nc",\ var,\ - pcr2numpy(self.__getattribute__(var+'AnnuaAvg'),\ + pcr.pcr2numpy(self.__getattribute__(var+'AnnuaAvg'),\ vos.MV),timeStamp,currTimeStep.annuaIdx-1) # # -last day of the year @@ -1097,5 +1493,5 @@ def old_style_land_surface_reporting(self,currTimeStep): self.netcdfObj.data2NetCDF(str(self.outNCDir)+"/"+ \ str(var)+"_annuaEnd.nc",\ var,\ - pcr2numpy(self.__getattribute__(var),vos.MV),\ + pcr.pcr2numpy(self.__getattribute__(var),vos.MV),\ timeStamp,currTimeStep.annuaIdx-1) diff --git a/model/meteo.py b/model/meteo.py old mode 100755 new mode 100644 index 9c239c0e7..93bf2d70d --- a/model/meteo.py +++ b/model/meteo.py @@ -1,5 +1,26 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os from pcraster.framework import * @@ -28,6 +49,11 @@ def __init__(self,iniItems,landmask,spinUp): iniItems.globalOptions['landmask'], self.cloneMap,self.tmpDir,self.inputDir) + # option to ignore snow (temperature will be set to 25 deg C if this option is activated) + self.ignore_snow = False + if 'ignoreSnow' in iniItems.meteoOptions.keys() and iniItems.meteoOptions['ignoreSnow'] == "True": + self.ignore_snow = True + self.preFileNC = iniItems.meteoOptions['precipitationNC'] # starting from 19 Feb 2014, we only support netcdf input files self.tmpFileNC = iniItems.meteoOptions['temperatureNC'] @@ -45,6 +71,11 @@ def __init__(self,iniItems,landmask,spinUp): # forcing downscaling options: self.forcingDownscalingOptions(iniItems) + # option to use netcdf files that are defined per year (one file for each year) + self.precipitation_set_per_year = iniItems.meteoOptions['precipitation_set_per_year'] == "True" + self.temperature_set_per_year = iniItems.meteoOptions['temperature_set_per_year'] == "True" + self.refETPotFileNC_set_per_year = iniItems.meteoOptions['refETPotFileNC_set_per_year'] == "True" + self.report = True try: self.outDailyTotNC = iniItems.meteoOptions['outDailyTotNC'].split(",") @@ -196,7 +227,7 @@ def forcingDownscalingOptions(self, iniItems): self.smoothingWindowsLength = vos.readPCRmapClone(\ iniItems.meteoDownscalingOptions['smoothingWindowsLength'], self.cloneMap,self.tmpDir,self.inputDir) - msg = "Forcing data are smoothed with 'windowaverage' using the window length:"+str(iniItems.meteoDownscalingOptions['smoothingWindowsLength']) + msg = "Forcing data will be smoothed with 'windowaverage' using the window length:"+str(iniItems.meteoDownscalingOptions['smoothingWindowsLength']) logger.info(msg) def perturb(self, name, **parameters): @@ -285,14 +316,24 @@ def downscaleReferenceETPot(self, zeroCelciusInKelvin = 273.15): self.referencePotET = pcr.max(0.0, factor * self.referencePotET) def read_forcings(self,currTimeStep): - # reading precipitation: - self.precipitation = vos.netcdf2PCRobjClone(\ - self.preFileNC,'precipitation',\ - str(currTimeStep.fulldate), - useDoy = None, - cloneMapFileName=self.cloneMap,\ - LatitudeLongitude = True) + # reading precipitation: + if self.precipitation_set_per_year: + #~ print currTimeStep.year + nc_file_per_year = self.preFileNC %(float(currTimeStep.year), float(currTimeStep.year)) + self.precipitation = vos.netcdf2PCRobjClone(\ + nc_file_per_year, 'precipitation',\ + str(currTimeStep.fulldate), + useDoy = None, + cloneMapFileName = self.cloneMap,\ + LatitudeLongitude = True) + else: + self.precipitation = vos.netcdf2PCRobjClone(\ + self.preFileNC, 'precipitation',\ + str(currTimeStep.fulldate), + useDoy = None, + cloneMapFileName = self.cloneMap,\ + LatitudeLongitude = True) precipitationCorrectionFactor = pcr.scalar(1.0) # Since 19 Feb 2014, Edwin removed the support for correcting precipitation. self.precipitation = pcr.max(0.,self.precipitation*\ precipitationCorrectionFactor) @@ -303,12 +344,21 @@ def read_forcings(self,currTimeStep): self.precipitation = pcr.rounddown(self.precipitation*100000.)/100000. # reading temperature - self.temperature = vos.netcdf2PCRobjClone(\ + if self.temperature_set_per_year: + nc_file_per_year = self.tmpFileNC %(int(currTimeStep.year), int(currTimeStep.year)) + self.temperature = vos.netcdf2PCRobjClone(\ + nc_file_per_year, 'temperature',\ + str(currTimeStep.fulldate), + useDoy = None, + cloneMapFileName = self.cloneMap,\ + LatitudeLongitude = True) + else: + self.temperature = vos.netcdf2PCRobjClone(\ self.tmpFileNC,'temperature',\ str(currTimeStep.fulldate), useDoy = None, - cloneMapFileName=self.cloneMap,\ - LatitudeLongitude = True) + cloneMapFileName=self.cloneMap,\ + LatitudeLongitude = True) # Downscaling precipitation and temperature if self.downscalePrecipitationOption: self.downscalePrecipitation(currTimeStep) @@ -320,10 +370,19 @@ def read_forcings(self,currTimeStep): currTimeStep.doy,\ self.latitudes) if self.refETPotMethod == 'Input': - self.referencePotET = vos.netcdf2PCRobjClone(\ - self.etpFileNC,'evapotranspiration',\ - str(currTimeStep.fulldate), - useDoy = None, + if self.refETPotFileNC_set_per_year: + nc_file_per_year = self.etpFileNC %(int(currTimeStep.year), int(currTimeStep.year)) + self.referencePotET = vos.netcdf2PCRobjClone(\ + nc_file_per_year, 'evapotranspiration',\ + str(currTimeStep.fulldate), + useDoy = None, + cloneMapFileName = self.cloneMap,\ + LatitudeLongitude = True) + else: + self.referencePotET = vos.netcdf2PCRobjClone(\ + self.etpFileNC,'evapotranspiration',\ + str(currTimeStep.fulldate), + useDoy = None, cloneMapFileName=self.cloneMap,\ LatitudeLongitude = True) @@ -332,16 +391,25 @@ def read_forcings(self,currTimeStep): # smoothing: if self.forcingSmoothing == True: - logger.info("Forcing data are smoothed.") + logger.debug("Forcing data are smoothed.") self.precipitation = pcr.windowaverage(self.precipitation , self.smoothingWindowsLength) self.temperature = pcr.windowaverage(self.temperature , self.smoothingWindowsLength) self.referencePotET = pcr.windowaverage(self.referencePotET, self.smoothingWindowsLength) + # make sure precipitation is always positive: + self.precipitation = pcr.max(0.0, self.precipitation) + + # rounding temperature values to minimize numerical errors (note only to minimize, not remove) + self.temperature = pcr.roundoff(self.temperature*1000.)/1000. + + # ignore snow by setting temperature to 25 deg C + if self.ignore_snow: self.temperature = pcr.spatial(pcr.scalar(25.)) + # define precipitation, temperature and referencePotET ONLY at landmask area (for reporting): self.precipitation = pcr.ifthen(self.landmask, self.precipitation) self.temperature = pcr.ifthen(self.landmask, self.temperature) self.referencePotET = pcr.ifthen(self.landmask, self.referencePotET) - + if self.report == True: timeStamp = datetime.datetime(currTimeStep.year,\ currTimeStep.month,\ diff --git a/model/ncConverter.py b/model/ncConverter.py old mode 100755 new mode 100644 index cc513544a..914877737 --- a/model/ncConverter.py +++ b/model/ncConverter.py @@ -1,67 +1,105 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os import sys import datetime import time import re +import glob import subprocess import netCDF4 as nc import numpy as np -#from pcraster.numpy import pcr2numpy,numpy2pcr -from pcraster import pcr2numpy, numpy2pcr # needed if we use PCRaster-4 (EHS, 7 May 2013) import pcraster as pcr import virtualOS as vos +# TODO: defined the dictionary (e.g. filecache = dict()) to avoid open and closing files + class PCR2netCDF(): - def __init__(self,iniItems): + def __init__(self,iniItems,specificAttributeDictionary=None): # cloneMap pcr.setclone(iniItems.cloneMap) cloneMap = pcr.boolean(1.0) # latitudes and longitudes - self.latitudes = np.unique(pcr2numpy(pcr.ycoordinate(cloneMap), vos.MV))[::-1] - self.longitudes = np.unique(pcr2numpy(pcr.xcoordinate(cloneMap), vos.MV)) + self.latitudes = np.unique(pcr.pcr2numpy(pcr.ycoordinate(cloneMap), vos.MV))[::-1] + self.longitudes = np.unique(pcr.pcr2numpy(pcr.xcoordinate(cloneMap), vos.MV)) # TODO: Let users decide what their preference regarding latitude order. # Consult with Stefanie regarding CF convention. - # netCDF format and attributes: + # set the general netcdf attributes (based on the information given in the ini/configuration file) + self.set_general_netcdf_attributes(iniItems, specificAttributeDictionary) + + # netcdf format and zlib setup self.format = 'NETCDF3_CLASSIC' + self.zlib = False + if "formatNetCDF" in iniItems.reportingOptions.keys(): + self.format = str(iniItems.reportingOptions['formatNetCDF']) + if "zlib" in iniItems.reportingOptions.keys(): + if iniItems.reportingOptions['zlib'] == "True": self.zlib = True + + def set_general_netcdf_attributes(self,iniItems,specificAttributeDictionary=None): + + # netCDF attributes (based on the configuration file or specificAttributeDictionary): self.attributeDictionary = {} - self.attributeDictionary['institution'] = iniItems.globalOptions['institution'] - self.attributeDictionary['title' ] = iniItems.globalOptions['title' ] - self.attributeDictionary['description'] = iniItems.globalOptions['description'] + if specificAttributeDictionary == None: + self.attributeDictionary['institution'] = iniItems.globalOptions['institution'] + self.attributeDictionary['title' ] = iniItems.globalOptions['title' ] + self.attributeDictionary['description'] = iniItems.globalOptions['description'] + else: + self.attributeDictionary['institution'] = specificAttributeDictionary['institution'] + self.attributeDictionary['title' ] = specificAttributeDictionary['title' ] + self.attributeDictionary['description'] = specificAttributeDictionary['description'] - def createNetCDF(self, ncFileName, varName, varUnits, \ - longName = None): + def createNetCDF(self, ncFileName, varName, varUnits, longName = None): - rootgrp= nc.Dataset(ncFileName,'w',format= self.format) + rootgrp = nc.Dataset(ncFileName,'w',format= self.format) #-create dimensions - time is unlimited, others are fixed rootgrp.createDimension('time',None) rootgrp.createDimension('lat',len(self.latitudes)) rootgrp.createDimension('lon',len(self.longitudes)) - date_time= rootgrp.createVariable('time','f4',('time',)) - date_time.standard_name= 'time' - date_time.long_name= 'Days since 1901-01-01' + date_time = rootgrp.createVariable('time','f4',('time',)) + date_time.standard_name = 'time' + date_time.long_name = 'Days since 1901-01-01' - date_time.units= 'Days since 1901-01-01' - date_time.calendar= 'standard' + date_time.units = 'Days since 1901-01-01' + date_time.calendar = 'standard' lat= rootgrp.createVariable('lat','f4',('lat',)) - lat.long_name= 'latitude' - lat.units= 'degrees_north' + lat.long_name = 'latitude' + lat.units = 'degrees_north' lat.standard_name = 'latitude' lon= rootgrp.createVariable('lon','f4',('lon',)) - lon.standard_name= 'longitude' - lon.long_name= 'longitude' - lon.units= 'degrees_east' + lon.standard_name = 'longitude' + lon.long_name = 'longitude' + lon.units = 'degrees_east' lat[:]= self.latitudes lon[:]= self.longitudes @@ -69,39 +107,36 @@ def createNetCDF(self, ncFileName, varName, varUnits, \ shortVarName = varName longVarName = varName if longName != None: longVarName = longName - - var= rootgrp.createVariable(shortVarName,'f4',('time','lat','lon',) ,fill_value=vos.MV,zlib=False) + + var = rootgrp.createVariable(shortVarName,'f4',('time','lat','lon',) ,fill_value=vos.MV,zlib=self.zlib) var.standard_name = varName var.long_name = longVarName var.units = varUnits attributeDictionary = self.attributeDictionary - for k, v in attributeDictionary.items(): - setattr(rootgrp,k,v) + for k, v in attributeDictionary.items(): setattr(rootgrp,k,v) rootgrp.sync() rootgrp.close() - def changeAtrribute(self,ncFileName,attributeDictionary): + def changeAtrribute(self, ncFileName, attributeDictionary): - rootgrp= nc.Dataset(ncFileName,'a',format= self.format) + rootgrp = nc.Dataset(ncFileName,'a') - for k, v in attributeDictionary.items(): - setattr(rootgrp,k,v) + for k, v in attributeDictionary.items(): setattr(rootgrp,k,v) rootgrp.sync() rootgrp.close() - def addNewVariable(self, ncFileName, varName, varUnits,\ - longName = None): + def addNewVariable(self, ncFileName, varName, varUnits, longName = None): - rootgrp= nc.Dataset(ncFileName,'a',format= self.format) + rootgrp = nc.Dataset(ncFileName,'a') shortVarName = varName longVarName = varName if longName != None: longVarName = longName - var= rootgrp.createVariable(shortVarName,'f4',('time','lat','lon',) ,fill_value=vos.MV,zlib=False) + var = rootgrp.createVariable(shortVarName,'f4',('time','lat','lon',) ,fill_value=vos.MV,zlib=self.zlib) var.standard_name = varName var.long_name = longVarName var.units = varUnits @@ -109,35 +144,36 @@ def addNewVariable(self, ncFileName, varName, varUnits,\ rootgrp.sync() rootgrp.close() - def data2NetCDF(self,ncFile,varName,varField,timeStamp,posCnt = None): - - #-write data to netCDF - rootgrp= nc.Dataset(ncFile,'a') + def data2NetCDF(self, ncFileName, shortVarName, varField, timeStamp, posCnt = None): - shortVarName= varName + rootgrp = nc.Dataset(ncFileName,'a') - date_time= rootgrp.variables['time'] + date_time = rootgrp.variables['time'] if posCnt == None: posCnt = len(date_time) - date_time[posCnt]= nc.date2num(timeStamp,date_time.units,date_time.calendar) + date_time[posCnt] = nc.date2num(timeStamp,date_time.units,date_time.calendar) - rootgrp.variables[shortVarName][posCnt,:,:]= (varField) + rootgrp.variables[shortVarName][posCnt,:,:] = varField rootgrp.sync() rootgrp.close() - def dataList2NetCDF(self,ncFile,varNameList,varFieldList,timeStamp,posCnt = None): + def dataList2NetCDF(self, ncFileName, shortVarNameList, varFieldList, timeStamp, posCnt = None): - #-write data to netCDF - rootgrp= nc.Dataset(ncFile,'a') + rootgrp = nc.Dataset(ncFileName,'a') date_time = rootgrp.variables['time'] if posCnt == None: posCnt = len(date_time) - for varName in varNameList: - shortVarName = varName - varField = varFieldList[varName] - date_time[posCnt]= nc.date2num(timeStamp,date_time.units,date_time.calendar) - rootgrp.variables[shortVarName][posCnt,:,:]= varField + for shortVarName in shortVarNameList: + date_time[posCnt] = nc.date2num(timeStamp,date_time.units,date_time.calendar) + rootgrp.variables[shortVarName][posCnt,:,:] = varFieldList[shortVarName] rootgrp.sync() rootgrp.close() + + def close(self, ncFileName): + + rootgrp = nc.Dataset(ncFileName,'w') + + # closing the file + rootgrp.close() diff --git a/model/oldcalc_framework.py b/model/oldcalc_framework.py new file mode 100644 index 000000000..1a7164082 --- /dev/null +++ b/model/oldcalc_framework.py @@ -0,0 +1,256 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os +import sys +import shutil +import datetime + +import pcraster as pcr +from pcraster.framework import DynamicModel + +from ncConverter import * +import virtualOS as vos + +import variable_list as varDicts + +import logging +logger = logging.getLogger(__name__) + +class PCRGlobWBVersionOne(DynamicModel): + + def __init__(self, configuration, \ + modelTime, \ + landmask, \ + cellArea): + DynamicModel.__init__(self) + + # configuration (based on the ini file) + self.configuration = configuration + + # time variable/object + self.modelTime = modelTime + + # cloneMapFileName + self.cloneMapFileName = self.configuration.cloneMap + pcr.setclone(self.cloneMapFileName) + + # cell area and landmask maps + self.landmask = landmask + self.cellArea = pcr.ifthen(self.landmask, cellArea) + + # output variables that will be compared (at daily resolution) + self.debug_state_variables = [ + 'temperature', + 'snowCoverSWE', + 'snowFreeWater', + 'interceptStor', + 'storUppTotal', + 'storLowTotal', + 'storGroundwater' + ] + self.debug_flux_variables = [ + 'precipitation', + 'referencePotET', + 'interceptEvap', + 'actSnowFreeWaterEvap', + 'actBareSoilEvap', + 'actTranspiTotal', + 'actTranspiUppTotal', + 'actTranspiLowTotal', + 'infiltration', + 'gwRecharge', + 'runoff', + 'directRunoff', + 'interflowTotal', + 'baseflow', + 'actualET' + ] + self.debug_variables = self.debug_state_variables + self.debug_flux_variables + + # folder/location of oldcalc input maps + self.maps_folder = self.configuration.mapsDir + + # folder/location of oldcalc results maps + self.results_folder = self.configuration.globalOptions['outputDir']+"/oldcalc_results/" + # - preparing the directory + if os.path.exists(self.results_folder): shutil.rmtree(self.results_folder) + os.makedirs(self.results_folder) + # - preparing the folder to store netcdf files + self.netcdf_folder = self.configuration.globalOptions['outputDir']+"/oldcalc_results/netcdf/" + os.makedirs(self.netcdf_folder) + + # go to the starting directory and copy/backup the oldcalc_script and parameter_table files + os.chdir(self.configuration.starting_directory) + + # the oldscript scripts used: + self.oldcalc_script_file = vos.getFullPath(self.configuration.globalOptions['oldcalc_script_file'], self.configuration.starting_directory) + self.parameter_tabel_file = vos.getFullPath(self.configuration.globalOptions['parameter_tabel_file'], self.configuration.starting_directory) + + # make the backup of oldscript scripts used + shutil.copy(self.oldcalc_script_file , self.configuration.scriptDir) + shutil.copy(self.parameter_tabel_file, self.configuration.scriptDir) + + # attribute information used in netcdf files: + netcdfAttributeDictionary = {} + netcdfAttributeDictionary['institution'] = self.configuration.globalOptions['institution'] + netcdfAttributeDictionary['title' ] = "PCR-GLOBWB 1 output" + netcdfAttributeDictionary['description'] = self.configuration.globalOptions['description']+" (this is the output from the oldcalc PCR-GLOBWB version 1)" + + # netcdf object for reporting + self.netcdf_report = PCR2netCDF(configuration, netcdfAttributeDictionary) + + # make/prepare netcdf files + for var in self.debug_variables: + + short_name = varDicts.netcdf_short_name[var] + unit = varDicts.netcdf_unit[var] + long_name = varDicts.netcdf_long_name[var] + if long_name == None: long_name = short_name + + netcdf_file_name = self.netcdf_folder+"/"+str(var)+"_dailyTot_output_version_one.nc" + + logger.info("Creating the netcdf file for daily reporting for the variable %s to the file %s (output from PCR-GLOBWB version 1).", str(var), str(netcdf_file_name)) + + self.netcdf_report.createNetCDF(netcdf_file_name,short_name,unit,long_name) + + def initial(self): + + logger.info("Execute the oldcalc script.") + + # choosing the steps for monthly reporting + if self.modelTime.nrOfTimeSteps == 365: monthly_end_times = "31 59 90 120 151 181 212 243 273 304 334 365" + if self.modelTime.nrOfTimeSteps == 366: monthly_end_times = "31 60 91 121 152 182 213 244 274 305 335 366" + + # execute oldcalc script + # - copy the parameter table file to mapsDir + shutil.copy(self.parameter_tabel_file, self.configuration.mapsDir) + # - copy the script directory to outputDir and execute it from there + shutil.copy(self.oldcalc_script_file , self.configuration.globalOptions['outputDir']) + os.chdir(self.configuration.globalOptions['outputDir']) + # - execute the script + cmd = 'oldcalc -f '+str(os.path.basename(self.oldcalc_script_file))+" "+monthly_end_times + print cmd + vos.cmd_line(cmd) + + def dynamic(self): + + # re-calculate current model time using current pcraster timestep value + self.modelTime.update(self.currentTimeStep()) + + # for the first day of the year or the first timestep + # - initiate accumulative flux variables (for calculating yearly total) + if self.modelTime.timeStepPCR == 1 or self.modelTime.doy == 1: + for var in self.debug_flux_variables: vars(self)[var+'AnnuaTot'] = pcr.ifthen(self.landmask, pcr.scalar(0.0)) + + # reading variables from pcraster files, then report them as netcdf files also accumulate annual total values + # - timeStamp for reporting + timeStamp = datetime.datetime(self.modelTime.year,\ + self.modelTime.month,\ + self.modelTime.day, 0) + for var in self.debug_variables: + + pcraster_map_file_name = self.results_folder + "/" +\ + pcr.framework.frameworkBase.generateNameT(varDicts.pcr_short_name[var],\ + self.modelTime.timeStepPCR) + logger.debug("Reading the variable %s from the file %s ", var, pcraster_map_file_name) + pcr_map_values = pcr.readmap(str(pcraster_map_file_name)) + + if var in self.debug_flux_variables: + logger.debug("Accumulating variable %s ", var) + vars(self)[var+'AnnuaTot'] += pcr_map_values + + netcdf_file_name = self.netcdf_folder + "/"+ str(var) + "_dailyTot_output_version_one.nc" + logger.debug("Saving to the file %s ", netcdf_file_name) + short_name = varDicts.netcdf_short_name[var] + self.netcdf_report.data2NetCDF(netcdf_file_name, short_name,\ + pcr.pcr2numpy(pcr_map_values, vos.MV),\ + timeStamp) + + # at the last day of the year, report yearly accumulative values (to the logger) + if self.modelTime.isLastDayOfYear() or self.modelTime.isLastTimeStep(): + + logger.info("") + msg = '\n' + msg += '=======================================================================================================================\n' + msg += '=======================================================================================================================\n' + msg += 'Summary of yearly annual flux values of PCR-GLOBWB 1.0.\n' + msg += 'The following summary values do not include storages in surface water bodies (lake, reservoir and channel storages).\n' + msg += '=======================================================================================================================\n' + msg += '=======================================================================================================================\n' + msg += '\n' + msg += '\n' + logger.info(msg) + + totalCellArea = vos.getMapTotal(pcr.ifthen(self.landmask, self.cellArea)) + msg = 'Total area = %e km2'\ + % (totalCellArea/1e6) + logger.info(msg) + + for var in self.debug_flux_variables: + volume = vos.getMapVolume(\ + self.__getattribute__(var + 'AnnuaTot'),\ + self.cellArea) + msg = 'Accumulated %s from PCR-GLOBWB 1.0 days 1 to %i in %i = %e km3 = %e mm'\ + % (var,int(self.modelTime.doy), \ + int(self.modelTime.year),volume/1e9,volume*1000/totalCellArea) + logger.info(msg) + + msg = '\n' + msg += '\n' + msg += '\n' + msg += '=======================================================================================================================\n' + msg += '\n' + msg += '\n' + logger.info(msg) + + # at the last time step, compare the output of version 1 to the one of version 2 + if self.modelTime.isLastTimeStep(): self.compare_output() + + def compare_output(self): + + logger.info("Comparing the netcdf output files from versions one and two (using cdo).") + + # make/prepare the debug directory and go to the debug directory + debug_directory = self.configuration.globalOptions['outputDir']+"/debug/" + # - preparing the directory + if os.path.exists(debug_directory): shutil.rmtree(debug_directory) + os.makedirs(debug_directory) + # - go to the debug directory + os.chdir(debug_directory) + + for var in self.debug_variables: + + msg = "Comparing the netcdf output files from the variable "+str(var) + logger.info(msg) + + short_name = varDicts.netcdf_short_name[var] + + filename_version_two = self.configuration.outNCDir + "/" +str(var) +"_dailyTot_output.nc" + filename_version_one = self.netcdf_folder + "/" +str(var) +"_dailyTot_output_version_one.nc" + + cmd = 'cdo sub '+filename_version_two+" "+filename_version_one+" "+var+"_diff.nc" + vos.cmd_line(cmd) + + diff --git a/model/parameterSoilAndTopo.py b/model/parameterSoilAndTopo.py old mode 100755 new mode 100644 index 989ed1fef..a79327f13 --- a/model/parameterSoilAndTopo.py +++ b/model/parameterSoilAndTopo.py @@ -1,5 +1,26 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os @@ -8,9 +29,10 @@ class SoilAndTopoParameters(object): - def __init__(self,iniItems,landmask): + def __init__(self, iniItems, landmask): object.__init__(self) + # cloneMap, tmpDir, inputDir based on the configuration/setting given in the ini/configuration file self.cloneMap = iniItems.cloneMap self.tmpDir = iniItems.tmpDir self.inputDir = iniItems.globalOptions['inputDir'] @@ -19,42 +41,47 @@ def __init__(self,iniItems,landmask): # How many soil layers (excluding groundwater): self.numberOfLayers = int(iniItems.landSurfaceOptions['numberOfUpperSoilLayers']) - def read(self,iniItems): + def read(self, iniItems, optionDict = None): - self.readTopo(iniItems) - self.readSoil(iniItems) + self.readTopo(iniItems, optionDict) + self.readSoil(iniItems, optionDict) - def readTopo(self,iniItems): + def readTopo(self, iniItems, optionDict): + + # a dictionary/section of options that will be used + if optionDict == None: optionDict = iniItems.landSurfaceOptions # maps of elevation attributes: topoParams = ['tanslope','slopeLength','orographyBeta'] - if iniItems.landSurfaceOptions['topographyNC'] == str(None): + if optionDict['topographyNC'] == str(None): for var in topoParams: input = iniItems.landSurfaceOptions[str(var)] - vars(self)[var] = pcr.scalar(0.0) vars(self)[var] = vos.readPCRmapClone(input,self.cloneMap, self.tmpDir,self.inputDir) - vars(self)[var] = pcr.cover(vars(self)[var], 0.0) + if var != "slopeLength": vars(self)[var] = pcr.cover(vars(self)[var], 0.0) else: topoPropertiesNC = vos.getFullPath(\ - iniItems.landSurfaceOptions[\ - 'topographyNC'], + optionDict['topographyNC'], self.inputDir) for var in topoParams: vars(self)[var] = vos.netcdf2PCRobjCloneWithoutTime(\ topoPropertiesNC,var, \ cloneMapFileName = self.cloneMap) - vars(self)[var] = pcr.cover(vars(self)[var], 0.0) - self.tanslope = pcr.max(self.tanslope, 0.00001) + if var != "slopeLength": vars(self)[var] = pcr.cover(vars(self)[var], 0.0) + + #~ self.tanslope = pcr.max(self.tanslope, 0.00001) # In principle, tanslope can be zero. Zero tanslope will provide zero TCL (no interflow) + + # covering slopeLength with its maximum value + self.slopeLength = pcr.cover(self.slopeLength, pcr.mapmaximum(self.slopeLength)) # maps of relative elevation above flood plains dzRel = ['dzRel0001','dzRel0005', 'dzRel0010','dzRel0020','dzRel0030','dzRel0040','dzRel0050', 'dzRel0060','dzRel0070','dzRel0080','dzRel0090','dzRel0100'] - if iniItems.landSurfaceOptions['topographyNC'] == str(None): + if optionDict['topographyNC'] == str(None): for i in range(0, len(dzRel)): var = dzRel[i] - input = iniItems.landSurfaceOptions[str(var)] + input = optionDict[str(var)] vars(self)[var] = vos.readPCRmapClone(input,self.cloneMap, self.tmpDir,self.inputDir) vars(self)[var] = pcr.cover(vars(self)[var], 0.0) @@ -68,33 +95,75 @@ def readTopo(self,iniItems): vars(self)[var] = pcr.cover(vars(self)[var], 0.0) if i > 0: vars(self)[var] = pcr.max(vars(self)[var], vars(self)[dzRel[i-1]]) - def readSoilMapOfFAO(self,iniItems): + def readSoilMapOfFAO(self, iniItems, optionDict = None): + # a dictionary/section of options that will be used + if optionDict == None: optionDict = iniItems.landSurfaceOptions + # soil variable names given either in the ini or netCDF file: soilParameters = ['airEntryValue1','airEntryValue2', 'poreSizeBeta1','poreSizeBeta2', 'resVolWC1','resVolWC2', 'satVolWC1','satVolWC2', - 'KSat1','KSat2', + 'KSat1','KSat2', 'percolationImp'] - if iniItems.landSurfaceOptions['soilPropertiesNC'] == str(None): + if optionDict['soilPropertiesNC'] == str(None): for var in soilParameters: - input = iniItems.landSurfaceOptions[str(var)] + input = optionDict[str(var)] vars(self)[var] = \ vos.readPCRmapClone(input,self.cloneMap,\ self.tmpDir,self.inputDir) vars(self)[var] = pcr.scalar(vars(self)[var]) + + if input == "percolationImp": vars(self)[var] = pcr.cover(vars(self)[var], 0.0) + + # extrapolation + # - TODO: Make a general extrapolation option as a function in the virtualOS.py + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 0.75)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) vars(self)[var] = pcr.cover(vars(self)[var], 0.0) + else: soilPropertiesNC = vos.getFullPath(\ - iniItems.landSurfaceOptions[\ - 'soilPropertiesNC'], + optionDict['soilPropertiesNC'], self.inputDir) for var in soilParameters: vars(self)[var] = vos.netcdf2PCRobjCloneWithoutTime(\ soilPropertiesNC,var, \ cloneMapFileName = self.cloneMap) - vars(self)[var] = pcr.cover(vars(self)[var], 0.0) + + if var == "percolationImp": vars(self)[var] = pcr.cover(vars(self)[var], 0.0) + + # extrapolation + # - TODO: Make a general extrapolation option as a function in the virtualOS.py + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 0.75)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) + vars(self)[var] = pcr.cover(vars(self)[var], + pcr.windowaverage(vars(self)[var], 1.00)) + + vars(self)[var] = pcr.cover(vars(self)[var], 0.01) + + # make sure that resVolWC1 <= satVolWC1 + self.resVolWC1 = pcr.min(self.resVolWC1, self.satVolWC1) + self.resVolWC2 = pcr.min(self.resVolWC2, self.satVolWC2) if self.numberOfLayers == 2: self.satVolMoistContUpp = self.satVolWC1 # saturated volumetric moisture content (m3.m-3) @@ -125,30 +194,59 @@ def readSoilMapOfFAO(self,iniItems): self.kSatUpp005030 = self.KSat1 self.kSatLow030150 = self.KSat2 - self.percolationImp = self.percolationImp # fractional area where percolation to groundwater store is impeded (dimensionless) + self.percolationImp = pcr.cover(self.percolationImp, 0.0) # fractional area where percolation to groundwater store is impeded (dimensionless) # soil thickness and storage variable names # as given either in the ini or netCDF file: soilStorages = ['firstStorDepth', 'secondStorDepth', 'soilWaterStorageCap1','soilWaterStorageCap2'] - if iniItems.landSurfaceOptions['soilPropertiesNC'] == str(None): + if optionDict['soilPropertiesNC'] == str(None): for var in soilStorages: - input = iniItems.landSurfaceOptions[str(var)] + input = optionDict[str(var)] temp = str(var)+'Inp' vars(self)[temp] = vos.readPCRmapClone(input,\ self.cloneMap, self.tmpDir,self.inputDir) + + # extrapolation + # - TODO: Make a general extrapolation option as a function in the virtualOS.py + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 0.75)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) vars(self)[temp] = pcr.cover(vars(self)[temp], 0.0) + else: soilPropertiesNC = vos.getFullPath(\ - iniItems.landSurfaceOptions[\ - 'soilPropertiesNC'], + optionDict['soilPropertiesNC'], self.inputDir) for var in soilStorages: temp = str(var)+'Inp' vars(self)[temp] = vos.netcdf2PCRobjCloneWithoutTime(\ soilPropertiesNC,var, \ cloneMapFileName = self.cloneMap) + # extrapolation + # - TODO: Make a general extrapolation option as a function in the virtualOS.py + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 0.75)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) + vars(self)[temp] = pcr.cover(vars(self)[temp], + pcr.windowaverage(vars(self)[temp], 1.05)) vars(self)[temp] = pcr.cover(vars(self)[temp], 0.0) # layer thickness @@ -169,7 +267,7 @@ def readSoilMapOfFAO(self,iniItems): self.storCapLow = self.thickLow * \ (self.satVolMoistContLow - self.resVolMoistContLow) self.rootZoneWaterStorageCap = self.storCapUpp + \ - self.storCapLow + self.storCapLow # This is called as WMAX in the original pcrcalc script. if self.numberOfLayers == 3: self.storCapUpp000005 = self.thickUpp000005 * \ (self.satVolMoistContUpp000005 - self.resVolMoistContUpp000005) @@ -181,12 +279,16 @@ def readSoilMapOfFAO(self,iniItems): self.storCapUpp005030 + \ self.storCapLow030150 - def readSoil(self,iniItems): + def readSoil(self, iniItems, optionDict = None): + + # a dictionary/section of options that will be used + if optionDict == None: optionDict = iniItems.landSurfaceOptions # default values of soil parameters that are constant/uniform for the entire domain: self.clappAddCoeff = pcr.scalar(3.0) # dimensionless self.matricSuctionFC = pcr.scalar(1.0) # unit: m - self.matricSuction50 = pcr.scalar(10./3.) # unit: m + #~ self.matricSuction50 = pcr.scalar(10./3.) # unit: m + self.matricSuction50 = pcr.scalar(3.33) # unit: m self.matricSuctionWP = pcr.scalar(156.0) # unit: m self.maxGWCapRise = pcr.scalar(5.0) # unit: m # @@ -203,97 +305,102 @@ def readSoil(self,iniItems): self.tmpDir,self.inputDir) # read soil parameter based on the FAO soil map: - self.readSoilMapOfFAO(iniItems) + self.readSoilMapOfFAO(iniItems, optionDict) # assign Campbell's (1974) beta coefficient, as well as degree # of saturation at field capacity and corresponding unsaturated hydraulic conductivity # if self.numberOfLayers == 2: - self.campbellBetaUpp = 2.*self.poreSizeBetaUpp + \ - self.clappAddCoeff # Campbell's (1974) coefficient ; Rens's line: BCB = 2*BCH + BCH_ADD - self.campbellBetaLow = 2.*self.poreSizeBetaLow + \ + self.campbellBetaUpp = self.poreSizeBetaUpp*2.0 + \ + self.clappAddCoeff # Campbell's (1974) coefficient ; Rens's line: BCB = 2*BCH + BCH_ADD + self.campbellBetaLow = self.poreSizeBetaLow*2.0 + \ self.clappAddCoeff self.effSatAtFieldCapUpp = \ (self.matricSuctionFC / self.airEntryValueUpp)**\ - (-1 / self.poreSizeBetaUpp ) # saturation degree at field capacity ; THEFF_FC = (PSI_FC/PSI_A)**(-1/BCH) + (-1.0/ self.poreSizeBetaUpp ) # saturation degree at field capacity : THEFF_FC = (PSI_FC/PSI_A)**(-1/BCH) + self.effSatAtFieldCapUpp = pcr.cover(self.effSatAtFieldCapUpp, 1.0) + self.effSatAtFieldCapLow = \ (self.matricSuctionFC / self.airEntryValueLow)**\ - (-1 / self.poreSizeBetaLow ) + (-1.0/ self.poreSizeBetaLow ) + self.effSatAtFieldCapLow = pcr.cover(self.effSatAtFieldCapLow, 1.0) self.kUnsatAtFieldCapUpp = pcr.max(0., \ - self.effSatAtFieldCapUpp ** self.poreSizeBetaUpp * self.kSatUpp) + (self.effSatAtFieldCapUpp ** self.campbellBetaUpp) * self.kSatUpp) # unsaturated conductivity at field capacity: KTHEFF_FC = max(0,THEFF_FC[TYPE]**BCB*KS1) self.kUnsatAtFieldCapLow = pcr.max(0., \ - self.effSatAtFieldCapLow ** self.poreSizeBetaLow * self.kSatLow) + (self.effSatAtFieldCapLow ** self.campbellBetaLow) * self.kSatLow) # if self.numberOfLayers == 3: - self.campbellBetaUpp000005 = 2.*self.poreSizeBetaUpp000005 + \ + self.campbellBetaUpp000005 = self.poreSizeBetaUpp000005*2.0 + \ self.clappAddCoeff - self.campbellBetaUpp005030 = 2.*self.poreSizeBetaUpp005030 + \ + self.campbellBetaUpp005030 = self.poreSizeBetaUpp005030*2.0 + \ self.clappAddCoeff - self.campbellBetaLow030150 = 2.*self.poreSizeBetaLow030150 + \ + self.campbellBetaLow030150 = self.poreSizeBetaLow030150*2.0 + \ self.clappAddCoeff self.effSatAtFieldCapUpp000005 = \ (self.matricSuctionFC / self.airEntryValueUpp000005)**\ - (-1 / self.poreSizeBetaUpp000005) + (-1.0/ self.poreSizeBetaUpp000005) self.effSatAtFieldCapUpp005030 = \ (self.matricSuctionFC / self.airEntryValueUpp005030)**\ - (-1 / self.poreSizeBetaUpp005030) + (-1.0/ self.poreSizeBetaUpp005030) self.effSatAtFieldCapLow030150 = \ (self.matricSuctionFC / self.airEntryValueLow030150)**\ - (-1 / self.poreSizeBetaLow030150) + (-1.0/ self.poreSizeBetaLow030150) self.kUnsatAtFieldCapUpp000005 = pcr.max(0., \ - self.effSatAtFieldCapUpp000005 ** self.poreSizeBetaUpp000005 * self.kSatUpp000005) + (self.effSatAtFieldCapUpp000005 ** self.campbellBetaUpp000005) * self.kSatUpp000005) self.kUnsatAtFieldCapUpp005030 = pcr.max(0., \ - self.effSatAtFieldCapUpp005030 ** self.poreSizeBetaUpp005030 * self.kSatUpp005030) + (self.effSatAtFieldCapUpp005030 ** self.campbellBetaUpp005030) * self.kSatUpp005030) self.kUnsatAtFieldCapLow030150 = pcr.max(0., \ - self.effSatAtFieldCapLow030150 ** self.poreSizeBetaLow030150 * self.kSatLow030150) + (self.effSatAtFieldCapLow030150 ** self.campbellBetaLow030150) * self.kSatLow030150) # calculate degree of saturation at which transpiration is halved (50) # and at wilting point # if self.numberOfLayers == 2: self.effSatAt50Upp = (self.matricSuction50/self.airEntryValueUpp)**\ - (-1/self.poreSizeBetaUpp) + (-1.0/self.poreSizeBetaUpp) + self.effSatAt50Upp = pcr.cover(self.effSatAt50Upp, 1.0) self.effSatAt50Low = (self.matricSuction50/self.airEntryValueLow)**\ - (-1/self.poreSizeBetaLow) - self.effSatAtWiltPointUpp = \ + (-1.0/self.poreSizeBetaLow) + self.effSatAt50Low = pcr.cover(self.effSatAt50Low, 1.0) + self.effSatAtWiltPointUpp = pcr.cover(\ (self.matricSuctionWP/self.airEntryValueUpp)**\ - (-1/self.poreSizeBetaUpp) - self.effSatAtWiltPointLow = \ + (-1.0/self.poreSizeBetaUpp), 1.0) + self.effSatAtWiltPointLow = pcr.cover(\ (self.matricSuctionWP/self.airEntryValueLow)**\ - (-1/self.poreSizeBetaLow) + (-1.0/self.poreSizeBetaLow), 1.0) if self.numberOfLayers == 3: self.effSatAt50Upp000005 = (self.matricSuction50/self.airEntryValueUpp000005)**\ - (-1/self.poreSizeBetaUpp000005) + (-1.0/self.poreSizeBetaUpp000005) self.effSatAt50Upp005030 = (self.matricSuction50/self.airEntryValueUpp005030)**\ - (-1/self.poreSizeBetaUpp005030) + (-1.0/self.poreSizeBetaUpp005030) self.effSatAt50Low030150 = (self.matricSuction50/self.airEntryValueLow030150)**\ - (-1/self.poreSizeBetaLow030150) + (-1.0/self.poreSizeBetaLow030150) self.effSatAtWiltPointUpp000005 = \ (self.matricSuctionWP/self.airEntryValueUpp000005)**\ - (-1/self.poreSizeBetaUpp000005) + (-1.0/self.poreSizeBetaUpp000005) self.effSatAtWiltPointUpp005030 = \ (self.matricSuctionWP/self.airEntryValueUpp005030)**\ - (-1/self.poreSizeBetaUpp005030) + (-1.0/self.poreSizeBetaUpp005030) self.effSatAtWiltPointLow030150 = \ (self.matricSuctionWP/self.airEntryValueLow030150)**\ - (-1/self.poreSizeBetaLow030150) + (-1.0/self.poreSizeBetaLow030150) # calculate interflow parameter (TCL): # if self.numberOfLayers == 2: - self.interflowConcTime = (2.* self.kSatLow * self.tanslope) / \ + self.interflowConcTime = (self.kSatLow * self.tanslope*2.0) / \ (self.slopeLength * (1.- self.effSatAtFieldCapLow) * \ (self.satVolMoistContLow - self.resVolMoistContLow)) # TCL = Duration*(2*KS2*TANSLOPE)/(LSLOPE*(1-THEFF2_FC)*(THETASAT2-THETARES2)) # if self.numberOfLayers == 3: - self.interflowConcTime = (2.* self.kSatLow030150 * self.tanslope) / \ + self.interflowConcTime = (self.kSatLow030150 * self.tanslope*2.0) / \ (self.slopeLength * (1.-self.effSatAtFieldCapLow030150) * \ (self.satVolMoistContLow030150 - self.resVolMoistContLow030150)) - self.interflowConcTime = pcr.cover(self.interflowConcTime, 0.0) + self.interflowConcTime = pcr.max(0.0, pcr.cover(self.interflowConcTime, 0.0)) diff --git a/model/pcrglobwb.py b/model/pcrglobwb.py old mode 100755 new mode 100644 index 0d638291d..3dabd9b4e --- a/model/pcrglobwb.py +++ b/model/pcrglobwb.py @@ -1,8 +1,32 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + import os +import shutil import sys import math import gc -import logging import pcraster as pcr @@ -13,6 +37,7 @@ import routing +import logging logger = logging.getLogger(__name__) ''' @@ -48,7 +73,22 @@ def __init__(self, configuration, currTimeStep, initialState = None): # number of upperSoilLayers: self.numberOfSoilLayers = int(configuration.landSurfaceOptions['numberOfUpperSoilLayers']) + # preparing sub-modules self.createSubmodels(initialState) + + # option for debugging to PCR-GLOBWB version 1.0 + self.debug_to_version_one = False + if configuration.debug_to_version_one: self.debug_to_version_one = True + if self.debug_to_version_one: + + # preparing initial folder directory + self.directory_for_initial_maps = vos.getFullPath("initials/", self.configuration.mapsDir) + if os.path.exists(self.directory_for_initial_maps): shutil.rmtree(self.directory_for_initial_maps) + os.makedirs(self.directory_for_initial_maps) + + # dump the initial state + self.dumpState(self.directory_for_initial_maps, "initial") + @property def configuration(self): @@ -65,12 +105,10 @@ def createSubmodels(self, initialState): # short name for every land cover type (needed for file name) self.shortNames = ['f','g','p','n'] - - def dumpState(self, outputDirectory): + def dumpState(self, outputDirectory, specific_date_string = None): #write all state to disk to facilitate restarting - if outputDirectory == None: - return + if specific_date_string == None: specific_date_string = str(self._modelTime.fulldate) state = self.getState() @@ -81,7 +119,7 @@ def dumpState(self, outputDirectory): vos.writePCRmapToDir(\ map,\ str(variable)+"_"+coverType+"_"+ - str(self._modelTime.fulldate)+".map",\ + specific_date_string+".map",\ outputDirectory) groundWaterState = state['groundwater'] @@ -89,7 +127,7 @@ def dumpState(self, outputDirectory): vos.writePCRmapToDir(\ map,\ str(variable)+"_"+ - str(self._modelTime.fulldate)+".map",\ + specific_date_string+".map",\ outputDirectory) routingState = state['routing'] @@ -97,9 +135,53 @@ def dumpState(self, outputDirectory): vos.writePCRmapToDir(\ map,\ str(variable)+"_"+ - str(self._modelTime.fulldate)+".map",\ + specific_date_string+".map",\ outputDirectory) + def calculateAndDumpMonthlyValuesForMODFLOW(self, outputDirectory, timeStamp = "Default"): + + logger.debug('Calculating (accumulating and averaging) and dumping some monthly variables for the MODFLOW input.') + + if self._modelTime.day == 1 or self._modelTime.timeStepPCR == 1: + + self.variables = {} + + self.variables['monthly_discharge_cubic_meter_per_second'] = pcr.ifthen(self.routing.landmask, pcr.max(0.0, self.routing.disChanWaterBody)) + self.variables['groundwater_recharge_meter_per_day'] = pcr.ifthen(self.routing.landmask, self.landSurface.gwRecharge) + self.variables['groundwater_abstraction_meter_per_day'] = pcr.ifthen(self.routing.landmask, self.landSurface.totalGroundwaterAbstraction) + + self.variables['monthly_discharge_cubic_meter_per_second'] += pcr.ifthen(self.routing.landmask, pcr.max(0.0, self.routing.disChanWaterBody)) + self.variables['groundwater_recharge_meter_per_day'] += pcr.ifthen(self.routing.landmask, self.landSurface.gwRecharge) + self.variables['groundwater_abstraction_meter_per_day'] += pcr.ifthen(self.routing.landmask, self.landSurface.totalGroundwaterAbstraction) + + if self._modelTime.isLastDayOfMonth(): + + # averaging monthly discharge, groundwater recharge and groundwater abstraction + number_of_days = min(self._modelTime.day, self._modelTime.timeStepPCR) + self.variables['monthly_discharge_cubic_meter_per_second'] = self.variables['monthly_discharge_cubic_meter_per_second'] / number_of_days # unit: m3/s + self.variables['groundwater_recharge_meter_per_day'] = self.variables['groundwater_recharge_meter_per_day'] / number_of_days # unit: m/day + self.variables['groundwater_abstraction_meter_per_day'] = self.variables['groundwater_abstraction_meter_per_day'] / number_of_days # unit: m/day + + # channel storage at the last day of the month + self.variables['channel_storage_cubic_meter'] = pcr.ifthen(self.routing.landmask, self.routing.channelStorage) # unit: m/day + + # time stamp used as part of the file name: + if timeStamp == "Default": timeStamp = str(self._modelTime.fulldate) + + logger.info('Dumping some monthly variables for the MODFLOW input.') + + for variable, map in self.variables.iteritems(): + vos.writePCRmapToDir(\ + map,\ + str(variable)+"_"+ + timeStamp+".map",\ + outputDirectory) + + # make an empty file + filename = outputDirectory+"/pcrglobwb_files_for_"+str(self._modelTime.fulldate)+"_are_ready.txt" + if os.path.exists(filename): os.remove(filename) + open(filename, "w").close() + def resume(self): #restore state from disk. used when restarting pass @@ -107,22 +189,21 @@ def resume(self): #FIXME: implement def setState(self, state): - logger.info("cannot set state") + logger.error("cannot set state") - def report(self, storesAtBeginning, storesAtEnd): - #report the state. which states are written when is based on the configuration + def report_summary(self, landWaterStoresAtBeginning, landWaterStoresAtEnd,\ + surfaceWaterStoresAtBeginning, surfaceWaterStoresAtEnd): - #set total to 0 on first day of the year + # set total to 0 on first day of the year if self._modelTime.doy == 1 or self._modelTime.isFirstTimestep(): # set all accumulated variables to zero + self.precipitationAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) for var in self.landSurface.fluxVars: vars(self)[var+'Acc'] = pcr.ifthen(self.landmask, pcr.scalar(0.0)) - self.nonFossilGroundwaterAbsAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) - self.allocNonFossilGroundwaterAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) self.baseflowAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) self.surfaceWaterInfAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) @@ -133,43 +214,63 @@ def report(self, storesAtBeginning, storesAtEnd): self.waterBalanceAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) self.absWaterBalanceAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) - # also save the storage at the first day of the year (or the first time step) - self.storageAtFirstDay = pcr.ifthen(self.landmask, storesAtBeginning) + # non irrigation water use (unit: m) + self.nonIrrigationWaterUseAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) + + # non irrigation return flow to water body and water body evaporation (unit: m) + self.nonIrrReturnFlowAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) + self.waterBodyEvaporationAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) + + # surface water input/loss volume (m3) and outgoing volume (m3) at pits + self.surfaceWaterInputAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) + self.dischargeAtPitAcc = pcr.ifthen(self.landmask, pcr.scalar(0.0)) + + # also save the storages at the first day of the year (or the first time step) + # - land surface storage (unit: m) + self.storageAtFirstDay = pcr.ifthen(self.landmask, landWaterStoresAtBeginning) + # - channel storages (unit: m3) + self.channelVolumeAtFirstDay = pcr.ifthen(self.landmask, surfaceWaterStoresAtBeginning) # accumulating until the last day of the year: self.precipitationAcc += self.meteo.precipitation for var in self.landSurface.fluxVars: vars(self)[var+'Acc'] += vars(self.landSurface)[var] - self.nonFossilGroundwaterAbsAcc += self.groundwater.nonFossilGroundwaterAbs - self.allocNonFossilGroundwaterAcc += self.groundwater.allocNonFossilGroundwater self.baseflowAcc += self.groundwater.baseflow - self.surfaceWaterInfAcc += self.groundwater.surfaceWaterInf + self.surfaceWaterInfAcc += self.groundwater.surfaceWaterInf self.runoffAcc += self.routing.runoff self.unmetDemandAcc += self.groundwater.unmetDemand self.waterBalance = \ - (storesAtBeginning - storesAtEnd +\ + (landWaterStoresAtBeginning - landWaterStoresAtEnd +\ self.meteo.precipitation + self.landSurface.irrGrossDemand + self.groundwater.surfaceWaterInf -\ self.landSurface.actualET - self.routing.runoff - self.groundwater.nonFossilGroundwaterAbs) - self.waterBalanceAcc = self.waterBalanceAcc + self.waterBalance - self.absWaterBalanceAcc = self.absWaterBalanceAcc + pcr.abs(self.waterBalance) + self.waterBalanceAcc += self.waterBalance + self.absWaterBalanceAcc += pcr.abs(self.waterBalance) - if self._modelTime.isLastDayOfYear(): - self.dumpState(self._configuration.endStateDir) + # consumptive water use for non irrigation demand (m) + self.nonIrrigationWaterUseAcc += self.routing.nonIrrWaterConsumption + + self.waterBodyEvaporationAcc += self.routing.waterBodyEvaporation + + self.surfaceWaterInputAcc += self.routing.local_input_to_surface_water # unit: m3 + self.dischargeAtPitAcc += self.routing.outgoing_volume_at_pits # unit: m3 + + if self._modelTime.isLastDayOfYear() or self._modelTime.isLastTimeStep(): - msg = 'The following waterBalance checks assume fracWat = 0 for all cells (not including surface water bodies).' - logging.getLogger("model").info(msg) # TODO: Improve these water balance checks. + logger.info("") + msg = 'The following summary values do not include storages in surface water bodies (lake, reservoir and channel storages).' + logger.info(msg) # TODO: Improve these water balance checks. - totalCellArea = vos.getMapTotal(pcr.ifthen(self.landmask,self.routing.cellArea)) + totalCellArea = vos.getMapTotal(pcr.ifthen(self.landmask, self.routing.cellArea)) msg = 'Total area = %e km2'\ % (totalCellArea/1e6) - logging.getLogger("model").info(msg) + logger.info(msg) deltaStorageOneYear = vos.getMapVolume( \ - pcr.ifthen(self.landmask,storesAtEnd) - \ + pcr.ifthen(self.landmask,landWaterStoresAtBeginning) - \ pcr.ifthen(self.landmask,self.storageAtFirstDay), self.routing.cellArea) msg = 'Delta total storage days 1 to %i in %i = %e km3 = %e mm'\ @@ -177,19 +278,44 @@ def report(self, storesAtBeginning, storesAtEnd): int(self._modelTime.year),\ deltaStorageOneYear/1e9,\ deltaStorageOneYear*1000/totalCellArea) - logging.getLogger("model").info(msg) + logger.info(msg) - # reporting the endStates at the end of the Year: variableList = ['precipitation', - 'nonFossilGroundwaterAbs', - 'allocNonFossilGroundwater', 'baseflow', 'surfaceWaterInf', 'runoff', 'unmetDemand'] variableList += self.landSurface.fluxVars - variableList += ['waterBalance','absWaterBalance'] + variableList += ['waterBalance','absWaterBalance','irrigationEvaporationWaterUse','nonIrrigationWaterUse'] + + # consumptive water use for irrigation (unit: m) + self.irrigationEvaporationWaterUseAcc = vos.getValDivZero(self.irrGrossDemandAcc,\ + self.precipitationAcc + self.irrGrossDemandAcc) * self.actualETAcc + for var in variableList: + volume = vos.getMapVolume(\ + self.__getattribute__(var + 'Acc'),\ + self.routing.cellArea) + msg = 'Accumulated %s days 1 to %i in %i = %e km3 = %e mm'\ + % (var,int(self._modelTime.doy),\ + int(self._modelTime.year),volume/1e9,volume*1000/totalCellArea) # TODO: Calculation does not always start from day 1. + logger.info(msg) + + logger.info("") + msg = 'The following summary is for surface water bodies.' + logger.info(msg) + + deltaChannelStorageOneYear = vos.getMapTotal( \ + pcr.ifthen(self.landmask,surfaceWaterStoresAtEnd) - \ + pcr.ifthen(self.landmask,self.channelVolumeAtFirstDay)) + msg = 'Delta surface water storage days 1 to %i in %i = %e km3 = %e mm'\ + % ( int(self._modelTime.doy),\ + int(self._modelTime.year),\ + deltaChannelStorageOneYear/1e9,\ + deltaChannelStorageOneYear*1000/totalCellArea) + logger.info(msg) + + variableList = ['waterBodyEvaporation'] for var in variableList: volume = vos.getMapVolume(\ self.__getattribute__(var + 'Acc'),\ @@ -197,7 +323,29 @@ def report(self, storesAtBeginning, storesAtEnd): msg = 'Accumulated %s days 1 to %i in %i = %e km3 = %e mm'\ % (var,int(self._modelTime.doy),\ int(self._modelTime.year),volume/1e9,volume*1000/totalCellArea) - logging.getLogger("model").info(msg) + logger.info(msg) + + + # surface water balance check + surfaceWaterInputTotal = vos.getMapTotal(self.surfaceWaterInputAcc) + msg = 'Accumulated %s days 1 to %i in %i = %e km3 = %e mm'\ + % ("surfaceWaterInput",int(self._modelTime.doy),\ + int(self._modelTime.year),surfaceWaterInputTotal/1e9,surfaceWaterInputTotal*1000/totalCellArea) + logger.info(msg) + + dischargeAtPitTotal = vos.getMapTotal(self.dischargeAtPitAcc) + msg = 'Accumulated %s days 1 to %i in %i = %e km3 = %e mm'\ + % ("dischargeAtPitTotal",int(self._modelTime.doy),\ + int(self._modelTime.year),dischargeAtPitTotal/1e9, dischargeAtPitTotal*1000/totalCellArea) + logger.info(msg) + + surfaceWaterBalance = surfaceWaterInputTotal - dischargeAtPitTotal + deltaChannelStorageOneYear + msg = 'Accumulated %s days 1 to %i in %i = %e km3 = %e mm'\ + % ("surfaceWaterBalance",int(self._modelTime.doy),\ + int(self._modelTime.year),surfaceWaterBalance/1e9, surfaceWaterBalance*1000/totalCellArea) + logger.info(msg) + + def getState(self): result = {} @@ -232,34 +380,9 @@ def getAllState(self): return result - def totalLandStores(self): + def totalLandWaterStores(self): + # unit: m, not including surface water bodies - if self.numberOfSoilLayers == 2: total = \ - self.landSurface.interceptStor +\ - self.landSurface.snowFreeWater +\ - self.landSurface.snowCoverSWE +\ - self.landSurface.topWaterLayer +\ - self.landSurface.storUpp +\ - self.landSurface.storLow +\ - self.groundwater.storGroundwater - - if self.numberOfSoilLayers == 3: total = \ - self.landSurface.interceptStor +\ - self.landSurface.snowFreeWater +\ - self.landSurface.snowCoverSWE +\ - self.landSurface.topWaterLayer +\ - self.landSurface.storUpp000005 +\ - self.landSurface.storUpp005030 +\ - self.landSurface.storLow030150 +\ - self.groundwater.storGroundwater - - total = pcr.ifthen(self.landmask, total) - - return total - - def totalCatchmentStores(self, total_land_stores): - - total_per_catchment = self.routing.channelStorage if self.numberOfSoilLayers == 2: total = \ self.landSurface.interceptStor +\ @@ -283,102 +406,67 @@ def totalCatchmentStores(self, total_land_stores): total = pcr.ifthen(self.landmask, total) return total - - def checkWaterBalance(self, storesAtBeginning, storesAtEnd): - # for the entire modules: snow + interception + soil + groundwater + waterDemand - # except: river/routing - - irrGrossDemand = pcr.ifthen(self.landmask,\ - self.landSurface.irrGrossDemand) # unit: m - - nonIrrGrossDemand = \ - pcr.ifthen(self.landmask,\ - self.landSurface.nonIrrGrossDemand) # unit: m - - precipitation = pcr.ifthen(self.landmask,\ - self.meteo.precipitation) # unit: m - - surfaceWaterInf = pcr.ifthen(self.landmask,\ - self.groundwater.surfaceWaterInf) - - surfaceWaterAbstraction = \ - pcr.ifthen(self.landmask,\ - self.landSurface.actSurfaceWaterAbstract) - - nonFossilGroundwaterAbs = pcr.ifthen(self.landmask,self.groundwater.nonFossilGroundwaterAbs) - - unmetDemand = pcr.ifthen(self.landmask,\ - self.groundwater.unmetDemand) # PS: We assume that unmetDemand is extracted (only) to satisfy local demand. - - runoff = pcr.ifthen(self.landmask,self.routing.runoff) - - actualET = pcr.ifthen(self.landmask,\ - self.landSurface.actualET) - + + def totalSurfaceWaterStores(self): + # unit: m3, only surface water bodies + + return pcr.ifthen(self.landmask, self.routing.channelStorage) + + def checkLandSurfaceWaterBalance(self, storesAtBeginning, storesAtEnd): + + # for the entire stores from snow + interception + soil + groundwater, but excluding river/routing + # + # - incoming fluxes (unit: m) + precipitation = pcr.ifthen(self.landmask, self.meteo.precipitation) + irrGrossDemand = pcr.ifthen(self.landmask, self.landSurface.irrGrossDemand) + surfaceWaterInf = pcr.ifthen(self.landmask, self.groundwater.surfaceWaterInf) + # + # - outgoing fluxes (unit: m) + actualET = pcr.ifthen(self.landmask, self.landSurface.actualET) + runoff = pcr.ifthen(self.landmask, self.routing.runoff) + nonFossilGroundwaterAbs = pcr.ifthen(self.landmask, self.groundwater.nonFossilGroundwaterAbs) + # vos.waterBalanceCheck([precipitation,surfaceWaterInf,irrGrossDemand],\ [actualET,runoff,nonFossilGroundwaterAbs],\ [storesAtBeginning],\ [storesAtEnd],\ - 'all modules (including water demand), but except river/routing',\ + 'all stores (snow + interception + soil + groundwater), but except river/routing',\ True,\ self._modelTime.fulldate,threshold=1e-3) - - - if self.landSurface.usingAllocSegments: - - allocSurfaceWaterAbstract = \ - pcr.ifthen(self.landmask,\ - self.landSurface.allocSurfaceWaterAbstract) - - allocNonFossilGroundwaterAbs = \ - pcr.ifthen(self.landmask,\ - self.groundwater.allocNonFossilGroundwater) - - allocUnmetDemand = unmetDemand # PS: We assume that unmetDemand is extracted (only) to satisfy local demand. - - segTotalDemand = pcr.areatotal( pcr.cover((irrGrossDemand+nonIrrGrossDemand) * self.routing.cellArea, 0.0), self.landSurface.allocSegments) / self.landSurface.segmentArea - - segAllocSurfaceWaterAbstract = pcr.areatotal( pcr.cover(allocSurfaceWaterAbstract * self.routing.cellArea, 0.0), self.landSurface.allocSegments) / self.landSurface.segmentArea - - segAllocNonFossilGroundwaterAbs = pcr.areatotal( pcr.cover(allocNonFossilGroundwaterAbs * self.routing.cellArea, 0.0), self.landSurface.allocSegments) / self.landSurface.segmentArea - - segAllocUnmetDemand = pcr.areatotal( pcr.cover(allocUnmetDemand * self.routing.cellArea, 0.0), self.landSurface.allocSegments) / self.landSurface.segmentArea - - vos.waterBalanceCheck([segTotalDemand],\ - [segAllocSurfaceWaterAbstract,segAllocNonFossilGroundwaterAbs,segAllocUnmetDemand],\ - [pcr.scalar(0.0)],\ - [pcr.scalar(0.0)],\ - 'Water balance error in water allocation (per zone). Note that error here is most likely due to rounding error (32 bit implementation of pcraster)',\ - True,\ - self._modelTime.fulldate,threshold=5e-3) - else: - - vos.waterBalanceCheck([irrGrossDemand,nonIrrGrossDemand],\ - [surfaceWaterAbstraction,nonFossilGroundwaterAbs,unmetDemand],\ - [pcr.scalar(0.0)],\ - [pcr.scalar(0.0)],\ - 'Water balance error in water allocation.',\ - True,\ - self._modelTime.fulldate,threshold=1e-3) def read_forcings(self): - logger.info("reading forcings for time %s", self._modelTime) + logger.info("Reading forcings for time %s", self._modelTime) self.meteo.read_forcings(self._modelTime) - def update(self, report_water_balance=False): - logger.info("updating model to time %s", self._modelTime) + def update(self, report_water_balance = False): + logger.info("Updating model for time %s", self._modelTime) if (report_water_balance): - storesAtBeginning = self.totalLandStores() + landWaterStoresAtBeginning = self.totalLandWaterStores() # not including surface water bodies + surfaceWaterStoresAtBeginning = self.totalSurfaceWaterStores() self.meteo.update(self._modelTime) - self.landSurface.update(self.meteo,self.groundwater,self.routing,self._modelTime) - self.groundwater.update(self.landSurface,self.routing,self._modelTime) - self.routing.update(self.landSurface,self.groundwater,self._modelTime,self.meteo) + self.landSurface.update(self.meteo, self.groundwater, self.routing, self._modelTime) + self.groundwater.update(self.landSurface, self.routing, self._modelTime) + self.routing.update(self.landSurface, self.groundwater, self._modelTime, self.meteo) - if (report_water_balance): - storesAtEnd = self.totalLandStores() - self.checkWaterBalance(storesAtBeginning, storesAtEnd) + # save/dump states at the end of the year or at the end of model simulation + if self._modelTime.isLastDayOfYear() or self._modelTime.isLastTimeStep(): + logger.info("Saving/dumping states to pcraster maps for time %s to the directory %s", self._modelTime, self._configuration.endStateDir) + self.dumpState(self._configuration.endStateDir) + + # calculating and dumping some monthly values for the purpose of online coupling with MODFLOW: + if self._configuration.online_coupling_between_pcrglobwb_and_moflow: + self.calculateAndDumpMonthlyValuesForMODFLOW(self._configuration.mapsDir) - if (report_water_balance): - self.report(storesAtBeginning, storesAtEnd) + if (report_water_balance): + landWaterStoresAtEnd = self.totalLandWaterStores() # not including surface water bodies + surfaceWaterStoresAtEnd = self.totalSurfaceWaterStores() + + # water balance check for the land surface water part + self.checkLandSurfaceWaterBalance(landWaterStoresAtBeginning, landWaterStoresAtEnd) + + # TODO: include water balance checks for the surface water part and combination of both land surface and surface water parts + + self.report_summary(landWaterStoresAtBeginning, landWaterStoresAtEnd,\ + surfaceWaterStoresAtBeginning, surfaceWaterStoresAtEnd) diff --git a/model/pcrglobwb_v1/param_permafrost_edwinVersion.tbl b/model/pcrglobwb_v1/param_permafrost_edwinVersion.tbl new file mode 100755 index 000000000..689a0efbc --- /dev/null +++ b/model/pcrglobwb_v1/param_permafrost_edwinVersion.tbl @@ -0,0 +1,55 @@ +VEGFRAC sv maps\vegf_short.map +THETASAT1 sv maps\fao30_ths30.map +THETASAT2 sv maps\fao30_ths100.map +THETARES1 sv maps\fao30_thr30.map +THETARES2 sv maps\fao30_thr100.map +KS1 sv maps\fao30_ks30.map +KS2 sv maps\fao30_ks100.map +PSI_A1 sv maps\fao30_psis30.map +PSI_A2 sv maps\fao30_psis100.map +BCH1 sv maps\fao30_beta30.map +BCH2 sv maps\fao30_beta100.map +Z1 sv maps\fao30_z1_permafrost.map +Z2 sv maps\fao30_z2_permafrost.map +SC1 sv maps\fao30_sc1_permafrost.map +SC2 sv maps\fao30_sc2_permafrost.map +WMAX sv maps\fao30_sc_permafrost.map +MINFRAC sv maps\minf_short.map +MAXFRAC sv maps\maxf_short.map +RFRAC1 sv maps\rfrac1_short.map +RFRAC2 sv maps\rfrac2_short.map +P2_IMP sv maps\fao30_p2imp_permafrost.map +SC_INI sv maps\initials\snowCoverSWE_grassland_initial.map +SCF_INI sv maps\initials\snowFreeWater_grassland_initial.map +INTS_INI sv maps\initials\interceptStor_grassland_initial.map +S1_INI sv maps\initials\storUpp_grassland_initial.map +S2_INI sv maps\initials\storLow_grassland_initial.map +Q2_INI sv maps\initials\interflow_grassland_initial.map + +VEGFRAC tv maps\vegf_tall.map +THETASAT1 tv maps\fao30_ths30.map +THETASAT2 tv maps\fao30_ths100.map +THETARES1 tv maps\fao30_thr30.map +THETARES2 tv maps\fao30_thr100.map +KS1 tv maps\fao30_ks30.map +KS2 tv maps\fao30_ks100.map +PSI_A1 tv maps\fao30_psis30.map +PSI_A2 tv maps\fao30_psis100.map +BCH1 tv maps\fao30_beta30.map +BCH2 tv maps\fao30_beta100.map +Z1 tv maps\fao30_z1_permafrost.map +Z2 tv maps\fao30_z2_permafrost.map +SC1 tv maps\fao30_sc1_permafrost.map +SC2 tv maps\fao30_sc2_permafrost.map +WMAX tv maps\fao30_sc_permafrost.map +MINFRAC tv maps\minf_tall.map +MAXFRAC tv maps\maxf_tall.map +RFRAC1 tv maps\rfrac1_tall.map +RFRAC2 tv maps\rfrac2_tall.map +P2_IMP tv maps\fao30_p2imp_permafrost.map +SC_INI tv maps\initials\snowCoverSWE_forest_initial.map +SCF_INI tv maps\initials\snowFreeWater_forest_initial.map +INTS_INI tv maps\initials\interceptStor_forest_initial.map +S1_INI tv maps\initials\storUpp_forest_initial.map +S2_INI tv maps\initials\storLow_forest_initial.map +Q2_INI tv maps\initials\interflow_forest_initial.map diff --git a/model/pcrglobwb_v1/pcr-glob_waterbalance_v1.0_corrected.txt b/model/pcrglobwb_v1/pcr-glob_waterbalance_v1.0_corrected.txt new file mode 100755 index 000000000..1d6864aad --- /dev/null +++ b/model/pcrglobwb_v1/pcr-glob_waterbalance_v1.0_corrected.txt @@ -0,0 +1,850 @@ +#PCRGLOB-WB: run oldcalc -f pcrglobwb_v1.1.txt 365 10 +#Rens van Beek, Dept. Physical Geography, Utrecht University, 9/11/2005 +#Basic water balance model, thus omitting routing and water temperature +#-with 2 surface covers (tall and short vegetation) and 3 layers of soil compartment +#-includes surface runoff and soil evaporation based on the improved Arno scheme +# of Hagemann and Gates (2003) +#-climate input based on CRU data downscaled with ERA-40 daily surface fields +#-change made to script regarding fractioning of soil evaporation and transpiration +# and reports on fraction of EACT over EPOT included on 20/08/2008 +# NOTE: WS... for reducing bare soil evaporation is obsolete as a result of changes +# Updates made to root fractions (evapotranspiration parameters dependent on relative +# root fractions RFW rather than on absolute fractions RFRAC) and CR2 limited to parameterized +# storage capacity of second layer rather than on porosity in root zone (17/11/2008) +# Capillary rise is restricted to the fractional area influenced by the groundwater, CRFRAC +# 20/04/2011: Soil moisture scheme has been changed to allow for full saturation of the soil layers +# by including percolation over the contact between the second to third layer to the infiltration; +# both percolation and capillary rise over the first and second layer has been made dependent on +# the square root of k(theta_eff) to include the effect of less pervious layers; +# to limit recursive drying and wetting of the first layer by percolation to and capillary rise from +# the second, drainage from the first layer is restricted to water in excess of field capacity +# under wet conditions (water in excess of field capacity) and capillary rise from the second to +# first layer is based on the gradient rather than on the difference in relative degree of saturation +# alone and is capped to maximum field capacity; see #* for comments on the changes +# Modification 28/06/2012: minor issue with precipitation partitioning following interception solved + +################################################################################################################################## +# 4 Aug 2014: Edwin modified (corrected?) the calculation of CR2, particularly while CR2 flux is +# limited by the availabile groundwater storage volume S3. Previously, if CR2 flux is +# limited by S3, it was multiplied twice with land cover fractions (VEGFRAC). +# For changes, see the comments ***edwin_modification*** (on lines 650-651 and 705). +################################################################################################################################## + + +binding + +#Maps & TSS - input +#-General + Duration= $2; #timestep in days + LANDMASK= $3; #clone map representing landmask of earth surface + CELLAREA= $4; #surface (m2) of cell covered by total land surface + +#-Surface water + LDD= $5; #local drainage direction map + FRACWAT= $6; #fraction of cell area covered by fresh water [m2/m2] + KC_WATSTACK= $7; #composite crop factor for channels and wetlands or lakes + +#-Groundwater + KQ3= $8; #recession coefficient for store 3 (day-1): drainage + SPECYIELD3= $9; #specific yield for aquifer + DZS3INFLUENCED= $10; #additional zone influenced by groundwater + DZREL0001= $91; #maps of relative elevation above floodplain, in percent + DZREL0005= $92; + DZREL0010= $93; + DZREL0020= $94; + DZREL0030= $95; + DZREL0040= $96; + DZREL0050= $97; + DZREL0060= $98; + DZREL0070= $99; + DZREL0080= $100; + DZREL0090= $101; + DZREL0100= $102; + +#-Meteo +#-Precipitation [m/day], conversion constant and factor + PRPSTACK= $11; # input value + PRPCONSTANT= $12; # conversion constant, to get values as required + PRPFACTOR= $13; # conversion factor, to get values as required +#-Precipitation anomaly, multiplicative + PRPANOSTACK= $14; # input value + PRPANOCONSTANT= $15; # conversion constant, to get values as required + PRPANOFACTOR= $16; # conversion factor, to get values as required +#-Temperature [degC], conversion constant and factor + TASTACK= $17; + TACONSTANT= $18; + TAFACTOR= $19; +#-Temperature anomaly , additive + TAANOSTACK= $20; + TAANOCONSTANT= $21; + TAANOFACTOR= $22; +#-Reference potential evapotranspiration [m/day], conversion constant and factor + EVAPSTACK= $23; + EVAPCONSTANT= $24; + EVAPFACTOR= $25; +#-Reference potential evapotranspiration anomaly, multiplicative + EVAPANOSTACK= $26; + EVAPANOCONSTANT= $27; + EVAPANOFACTOR= $28; + +#-Vegetation parameters per cover type, interception and fractions read in per type (maximum 10 values) + COVERTYPE= [ + $31= $41, + $32= $42]; #array of cover type, e.g.: 1) short, 2) tall +#-fractional vegetation cover (m2/m2), interception storage (m per unit area) +# and crop factor per vegetation type + CFSTACK_01= $51; #-cover fraction + CFSTACK_02= $52; + CFSTACK_03= $53; + CFSTACK_04= $54; + CFSTACK_05= $55; + CFSTACK_06= $56; + CFSTACK_07= $57; + CFSTACK_08= $58; + CFSTACK_09= $59; + CFSTACK_10= $60; + SMAXSTACK_01= $61; #-interception, maximum canopy storage + SMAXSTACK_02= $62; + SMAXSTACK_03= $63; + SMAXSTACK_04= $64; + SMAXSTACK_05= $65; + SMAXSTACK_06= $66; + SMAXSTACK_07= $67; + SMAXSTACK_08= $68; + SMAXSTACK_09= $69; + SMAXSTACK_10= $70; + KCSTACK_01= $71; #-crop factor + KCSTACK_02= $72; + KCSTACK_03= $73; + KCSTACK_04= $74; + KCSTACK_05= $75; + KCSTACK_06= $76; + KCSTACK_07= $77; + KCSTACK_08= $78; + KCSTACK_09= $79; + KCSTACK_10= $80; +#-table with parameterization per cover type; all variables read as maps + COVERTABLE= $81; #table with parameterization per cover type +#-parameter values: vegetation fraction + VEGFRAC[COVERTYPE]= index(COVERTABLE); #subdivision in cover type +#-parameter values: snow module + TT[COVERTYPE]= index(COVERTABLE); #threshold temperature for freezing/thawing (?C) + CFMAX[COVERTYPE]= index(COVERTABLE); #degree-day factor (m??C-1?d-1) was: 0.0055 + SFCF[COVERTYPE]= index(COVERTABLE); #snowfall correction factor (-) + CWH[COVERTYPE]= index(COVERTABLE); #water holding capacity snow cover (-) + CFR[COVERTYPE]= index(COVERTABLE); #refreezing coefficient (-) +#-topographical parameters per cover type + LSLOPE[COVERTYPE]= index(COVERTABLE); #slope length (m) + TANSLOPE[COVERTYPE]= index(COVERTABLE); #gradient of slope (m/m) +#-soil parameters per cover type + PSI_FC[COVERTYPE]= index(COVERTABLE); #matric suction at field capacity (m) + PSI_50[COVERTYPE]= index(COVERTABLE); #matric suction at which transpiration is halved (m) + BCH_FACTOR[COVERTYPE]= index(COVERTABLE); #factor for kr-relationship of Clapp & Hornberger (1978; default 2) + BCH_ADD[COVERTYPE]= index(COVERTABLE); #addition for kr-relationship of Clapp & Hornberger (1978; default 3) + BCF[COVERTYPE]= index(COVERTABLE); #beta coefficient of the improved Arno scheme + MINFRAC[COVERTYPE]= index(COVERTABLE); #ratio of min soil depth over average soil depth + #MAXFRAC[COVERTYPE]= index(COVERTABLE); #ratio of max soil depth over average soil depth + P2_IMP[COVERTYPE]= index(COVERTABLE); #fractional area where percolation to groundwater store is impeded +#-soil parameters per cover type, constants and layer (i) + THETASAT1[COVERTYPE]= index(COVERTABLE); #saturated volumetric moisture content (m3.m-3) + THETASAT2[COVERTYPE]= index(COVERTABLE); #first and second layer + THETARES1[COVERTYPE]= index(COVERTABLE); #residual volumetric moisture content (m3.m-3) + THETARES2[COVERTYPE]= index(COVERTABLE); #first and second layer + KS1[COVERTYPE]= index(COVERTABLE); #saturated hydraulic conductivity (m.day-1) + KS2[COVERTYPE]= index(COVERTABLE); #first and second layer + PSI_A1[COVERTYPE]= index(COVERTABLE); #air entry value (m) according to SWRC of Clapp & Hornberger (1978) + PSI_A2[COVERTYPE]= index(COVERTABLE); #first and second layer + BCH1[COVERTYPE]= index(COVERTABLE); #pore size distribution parameter according to Clapp and Hornberger (1978) + BCH2[COVERTYPE]= index(COVERTABLE); #first and second layer + Z1[COVERTYPE]= index(COVERTABLE); #depth of first store + Z2[COVERTYPE]= index(COVERTABLE); #depth of second store + RFRAC1[COVERTYPE]= index(COVERTABLE); #root fraction per soil layer + RFRAC2[COVERTYPE]= index(COVERTABLE); #first and second layer +#-vegetation parameters per crop type + KCMIN[COVERTYPE]= index(COVERTABLE); #used to separate soil evaporation from transpiration +#Initial storages for local variables, cell averages reported by default + SC_INI[COVERTYPE]= index(COVERTABLE); #initial snow cover (m) + SCF_INI[COVERTYPE]= index(COVERTABLE); #initial liquid water stored in snow cover (m) + INTS_INI[COVERTYPE]= index(COVERTABLE); #initial interception storage (m) + S1_INI[COVERTYPE]= index(COVERTABLE); #initial storage in upper store (m) + S2_INI[COVERTYPE]= index(COVERTABLE); #initial storage in second store (m) + Q2_INI[COVERTYPE]= index(COVERTABLE); #initial drainage from second store (m) +#Initial storages for local variables, cell averages reported by default + S3_INI= $82; #initial storage in lower store (m) + +#Output: only maps are reported +#-representative for land cover dependent variables: note cover type is not needed to report local fluxes! +#-initial values + SC_L= $89\sc; #snow cover (m) + SCF_L= $89\scf; #liquid water stored in snow cover (m) + INTS_L= $89\ints; #interception storage (m) + Q2_L= $89\q2; #runoff from second store (flow) (m) + S1_L= $89\s1; #storage in upper store (m) + S2_L= $89\s2; #storage in second store (m) +#-optional output: see matches below for cell-based values + PRP_L= $89\prec; + TA_L= $89\temp; + ET_p= $89\epot; + THETA1_L= $89\th1; + THETA2_L= $89\th2; + THETAS_L= $89\ths; + W= $89\stors; + SATFRAC_L= $89\satf; + EACT_L= $89\eact; + ES_p= $89\espot; + ES_a= $89\esact; + T1_p= $89\t1pot; + T1_a= $89\t1act; + T2_p= $89\t2pot; + T2_a= $89\t2act; + T_p= $89\tpot; + T_a= $89\tact; + P0_L= $89\p0; + P1_L= $89\p1; + P2_L= $89\p2; + Q1_L= $89\q1; + CR1_L= $89\cr1; + CR2_L= $89\cr2; + +#-representative for total cell: meteo + PRPTOT= $89\prec; #total precipitiation (m/day) + TAVG= $89\temp; #average air temperature (degC) + EPOT= $89\epot; #total potential evapotranspiration (m) +#-representative for total cell: states + SC= $89\snowcov; #snow cover (m) + SCF= $89\snowliq; #liquid water stored in snow cover (m) + INTS= $89\intstor; #interception storage (m) + THETA1= $89\theta1x; #volumetric moisture content in the first soil (m3/m3) + THETA2= $89\theta2x; #volumetric moisture content in the second soil (m3/m3) + THETAS= $89\theta; #volumetric moisture content in soil column (m3/m3) + S1= $89\stor1x; #water storage in upper store (m) + S2= $89\stor2x; #water storage in second store (m) + SS= $89\stors; #total water storage in soil (m) + SATFRAC= $89\satf; #fraction saturated area (-) + CRFRAC= $89\crfrac; #fraction of soil surface influenced by capillary rise +#-representative for total cell: fluxes + EWAT= $89\ewat; #potential evaporation over open water + EACT= $89\eact; #actual evapotranspiration (m) + ESPOT= $89\espot; #potential soil evaporation (m) + ESACT= $89\esact; #actual soil evaporation (m) + T1POT= $89\t1pot; #potential transpiration drawn from first soil layer (m) + T1ACT= $89\t1act; #idem, actual + T2POT= $89\t2pot; #potential transpiration drawn from second soil layer (m) + T2ACT= $89\t2act; #idem, actual + TPOT= $89\tpot; #potential transpiration drawn from total soil layer (m) + TACT= $89\tact; #idem, actual + P0= $89\p0x; #infiltration to first layer (m/day) + P1= $89\p1x; #percolation from first layer (m/day) + P2= $89\p2x; #percolation from second layer (m/day) + CR1= $89\cr1x; #capillary rise to first layer (m/day) + CR2= $89\cr2x; #capilary rise to second layer (m/day) + Q1= $89\q1x; #direct runoff (m) + Q2= $89\q2x; #runoff from second store (flow) (m) + Q3= $89\q3x; #runoff from lower store (base flow) (m) + QLOC= $89\qloc; #specific runoff (m) + R3= $89\r3x; #recharge to third store + S3= $89\stor3x; #storage in lower store (m) + QWAT= $89\qwat; #change in storage of freshwater surface + QAVG= $89\qaverage.map;#channel discharge - annual average (m/s) +#budget check + MBE= $89\mbe.map; #absolute local mass balance error (m) + MBR= $89\mbcheck.map; #relative, local mass balance error (-) + +areamap + LANDMASK; + +timer + 1 $1 1; + rep1= endtime; #times to report TSS and initial maps + rep2= 1+1..endtime; #times to report soil states and fluxes + + +initial + +#Patching LDD + LDD= if(LANDMASK,cover(LDD,5)); + +#Initialization, dependent on COVERTYPE +#Initial storages + SC= scalar(0); + SCF= scalar(0); + INTS= scalar(0); + S1= scalar(0); + S2= scalar(0); + S3= S3_INI; + + foreach TYPE in COVERTYPE{ + #Initial storages + #-states and fluxes per vegetation type + SC_L[TYPE]= SC_INI[TYPE]; #initial snow cover (m) + SCF_L[TYPE]= SCF_INI[TYPE]; #initial liquid water stored in snow cover (m) + INTS_L[TYPE]= INTS_INI[TYPE]; #initial interception storage (m) + S1_L[TYPE]= S1_INI[TYPE]; #initial storage in upper store (m) + S2_L[TYPE]= S2_INI[TYPE]; #initial storage in second store (m) + Q2_L[TYPE]= Q2_INI[TYPE]; #initial drainage from second store (m) + #-total storages + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + + #-soil parameters + BCB1[TYPE]= BCH_FACTOR[TYPE]*BCH1[TYPE]+BCH_ADD[TYPE]; #Campbell's (1974) coefficient to calculate the relative, + BCB2[TYPE]= BCH_FACTOR[TYPE]*BCH2[TYPE]+BCH_ADD[TYPE]; #unsaturated hydraulic conductivity + #degree of saturation at field capacity for first and second layer + #and corresponding unstaturated hydraulic conductivity + THEFF1_FC[TYPE]= (PSI_FC[TYPE]/PSI_A1[TYPE])**(-1/BCH1[TYPE]); + KTHEFF1_FC[TYPE]= max(0,THEFF1_FC[TYPE]**BCB1[TYPE]*KS1[TYPE]); + THEFF2_FC[TYPE]= (PSI_FC[TYPE]/PSI_A2[TYPE])**(-1/BCH2[TYPE]); + KTHEFF2_FC[TYPE]= max(0,THEFF2_FC[TYPE]**BCB2[TYPE]*KS2[TYPE]); + #centroid-lag for constant drainable pore space (day), + #rewritten to fractions given the duration of one timestep + TCL[TYPE]= Duration*(2*KS2[TYPE]*TANSLOPE[TYPE])/(LSLOPE[TYPE]*(1-THEFF2_FC[TYPE])*(THETASAT2[TYPE]-THETARES2[TYPE])); + #-storage parameters related to Improved Arno Scheme + #-total active water storage capacity over first and second layer and total soil profile (m) + SC1[TYPE]= Z1[TYPE]*(THETASAT1[TYPE]-THETARES1[TYPE]); + SC2[TYPE]= Z2[TYPE]*(THETASAT2[TYPE]-THETARES2[TYPE]); + WMAX[TYPE]= SC1[TYPE]+SC2[TYPE]; + # storage in top soil limiting bare soil evapotranspiration + WSMAX[TYPE]= SC1[TYPE]; + #minimum storage capacity set to fraction of mean total + WMIN[TYPE]= MINFRAC[TYPE]*WMAX[TYPE]; + WSMIN[TYPE]= MINFRAC[TYPE]*WSMAX[TYPE]; + #range in storage capacity + WRANGE[TYPE]= WMAX[TYPE]-WMIN[TYPE]; + WSRANGE[TYPE]= WSMAX[TYPE]-WSMIN[TYPE]; + #weighed root fractions + RFW1[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0, + min(1.0,RFRAC1[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + RFW2[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0.0, + min(1.0,RFRAC2[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + #average degree of saturation at which actual transpiration is halved + THEFF_50[TYPE]= if(RFW1[TYPE]+RFW2[TYPE] > 0, + (SC1[TYPE]*RFW1[TYPE]*(PSI_50[TYPE]/PSI_A1[TYPE])**(-1/BCH1[TYPE])+ + SC2[TYPE]*RFW2[TYPE]*(PSI_50[TYPE]/PSI_A2[TYPE])**(-1/BCH2[TYPE]))/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5); + BCH_50[TYPE]= if(RFW1[TYPE]+RFW2[TYPE] > 0,(SC1[TYPE]*RFW1[TYPE]*BCH1[TYPE]+SC2[TYPE]*RFW2[TYPE]*BCH2[TYPE])/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5*(BCH1[TYPE]+BCH2[TYPE])); +} + +#-cumulative fluxes for average discharge and budget check + QCUM= scalar(0); + STOT_CUM= scalar(0); + SLOCINI= (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + PTOT= scalar(0); + ETOT= scalar(0); + QTOT= scalar(0); + +dynamic +#---------------- +# Meteo +#---------------- +#Meteorological input as total/average per time step +# PRPORG (m): total precipitation from original forcing +# TA (?C): average temperature +# EVAP (m): reference potential evapotranspiration + PRPORG= PRPCONSTANT+PRPFACTOR* + timeinput(PRPSTACK); + PRPANO= PRPANOCONSTANT+PRPANOFACTOR* + timeinputsparse(PRPANOSTACK); + PRPORG= max(0.,PRPANO*PRPORG)*Duration*timeslice(); + TA= TACONSTANT+TAFACTOR*timeinput(TASTACK); + TAANO= TAANOCONSTANT+TAANOFACTOR* + timeinputsparse(TAANOSTACK); + TA= TAANO+TA; + EVAP= EVAPCONSTANT+EVAPFACTOR* + timeinput(EVAPSTACK); + EVAPANO= EVAPANOCONSTANT+EVAPANOFACTOR* + timeinputsparse(EVAPANOSTACK); + EVAP= max(0.,EVAPANO*EVAP)*Duration*timeslice(); + +#---------------- +# Land surface +#---------------- +#Current approximate height of groundwater table and corresponding reach of cell under +# influence of capillary rise + DZS3= S3/SPECYIELD3+DZS3INFLUENCED; + CRFRAC= min(1.0,1.0-(DZREL0100-DZS3)*0.1/max(1e-3,DZREL0100-DZREL0090)); + CRFRAC= if(DZS30,PTF_L/PRP_L[TYPE],0)); #** + PTF_L= max(0,PTF_L-SNOW_L); #** + EACT_L[TYPE]= min(INTS_L[TYPE],(T_p[TYPE]*if(ICC[TYPE]>0,INTS_L[TYPE]/ICC[TYPE],0)**(2/3))); + INTS_L[TYPE]= INTS_L[TYPE]-EACT_L[TYPE]; + T_p[TYPE]= max(0,T_p[TYPE]-EACT_L[TYPE]); + + #-Snow accumulation and melt + #SC (m): snow cover + #SCF (m): free water stored in snow cover + #DSC (m): change in snow cover, - melt, + gain in snow or refreezing (CFR) + #Pn (m): net liquid water transferred to soil + #DSCR (m): relative contribution of snow melt to net liquid water transfer + #ES_a (m): actual bare soil evaporation, + # here used to subtract any evaporation from liquid phase of snow cover + DSC[TYPE]= if(TA_L[TYPE]<=TT[TYPE],CFR[TYPE]*SCF_L[TYPE],-min(SC_L[TYPE],max(TA_L[TYPE]-TT[TYPE],0)*CFMAX[TYPE]*Duration*timeslice())); + SC_L[TYPE]= SC_L[TYPE]+DSC[TYPE]+SNOW_L; + SCF_L[TYPE]= SCF_L[TYPE]-DSC[TYPE]+PTF_L; + Pn= max(0,SCF_L[TYPE]-CWH[TYPE]*SC_L[TYPE]); + DSCR= if(Pn>0,max(-DSC[TYPE],0)/Pn,0); + SCF_L[TYPE]= max(0,SCF_L[TYPE]-Pn); + ES_a[TYPE]= min(SCF_L[TYPE],ES_p[TYPE]); + SCF_L[TYPE]= SCF_L[TYPE]-ES_a[TYPE]; + ES_p[TYPE]= max(0,ES_p[TYPE]-ES_a[TYPE]); + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]; + + #-Direct runoff and infiltration based on improved Arno scheme + # partial runoff when not entirely saturated (condition 1), else complete saturation excess + #BCF (-): b coefficient of soil water storage capacity distribution + #WMIN, WMAX (m): root zone water storage capacity, area-averaged values + #W (m): actual water storage in root zone + #WRANGE, DW, + #WFRAC (m): computation steps to ease runoff calculation, resp. + # (WMAX-WMIN), (WMAX-W) and DW/WRANGE + # WFRAC capped at 1 + #WFRACB (nd): DW/WRANGE raised to the power (1/(b+1)) + #SATFRAC (-): fractional saturated area + #WACT (m): actual water storage within rootzone + #THEFF(i) (-): effective degree of saturation + # + #-Saturated and unsaturated hydraulic conductivity, matric suction and gradient + #*PSI(i) (m): matric suction in layer(i) + #*GRAD (-): gradient for capillary rise + #KS(i) (m/d): saturated hydraulic conductivity + #KTHEFF(i) (m/d): unsaturated hydraulic conductivity + #*KTHVERT (m/d): idem, exchange between layers, capped at field capacity + #BCH(i) (-): pore size distribution factor of Clapp and Hornberger (1978) + #BCB(i) (-): Campbell's (1974) coefficient to calculate the relative, + # unsaturated hydraulic conductivity + #Pn (m): net liquid precipitation, reduced if WMIN not exceeded + #Q1 (m): direct or surface runoff + #Q1S (-): direct or surface runoff directly attributable to snow melt + #P0 (m): infiltration + #P(i) (m): percolation from layer(i) to layer(i+1) + #* + #* Note that here the scaling of the unsaturated hydraulic conductivity by that at field capacity + #* has been placed which earlier was included in the section where the soil hydrological fluxes (percolation) + #* were calculated. In order to allow for full saturation, the percolation from the second to the third + #* layer is already calculated here and added to the infiltration. + #* To ensure that scaling of k(thetaeff) by that value at field capacity for percolation and capillary rise of the first + #* layer does not affect the other results, the additional variable k(thetaeff) in the vertical direction over + #* the two soil layers is introduced. The capillary rise into this layer is no longer dependent on moisture but + #* primarily on the gradient. To this end, the new variables PSI(i), GRAD are introduced. + #* + THEFF1_L= max(0,S1_L[TYPE]/SC1[TYPE]); + THEFF2_L= max(0,S2_L[TYPE]/SC2[TYPE]); + PSI1= PSI_A1[TYPE]*max(0.01,THEFF1_L)**-BCH1[TYPE]; #* + PSI2= PSI_A2[TYPE]*max(0.01,THEFF2_L)**-BCH2[TYPE]; #* + GRAD= max(0,2*(PSI1-PSI2)/(Z1[TYPE]+Z2[TYPE])-1); #* + KTHEFF1= max(0,THEFF1_L**BCB1[TYPE]*KS1[TYPE]); + KTHEFF2= max(0,THEFF2_L**BCB2[TYPE]*KS2[TYPE]); + KTHVERT= min(sqrt(KTHEFF1*KTHEFF2), + (KTHEFF1*KTHEFF2*KTHEFF1_FC[TYPE]*KTHEFF2_FC[TYPE])**0.25); #* + P2_L[TYPE]= min(KTHEFF2,sqrt(KTHEFF2*KTHEFF2_FC[TYPE]))*Duration*timeslice(); #* + W[TYPE]= max(0,S1_L[TYPE]+S2_L[TYPE]); + P0_L[TYPE]= Pn; + Pn= W[TYPE]+Pn; + Pn= Pn-max(WMIN[TYPE],W[TYPE]); + W[TYPE]= if(Pn<0,WMIN[TYPE]+Pn,max(W[TYPE],WMIN[TYPE])); + Pn= max(0,Pn); + DW= max(0,WMAX[TYPE]-W[TYPE]); + WFRAC= min(1,DW/WRANGE[TYPE]); + WFRACB= WFRAC**(1/(1+BCF[TYPE])); + SATFRAC_L[TYPE]= if(WFRACB>0,1-WFRACB**BCF[TYPE],1.0); + WACT_L= (BCF[TYPE]+1)*WMAX[TYPE]-BCF[TYPE]*WMIN[TYPE]-(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB; + Q1_L[TYPE]= max(0,Pn-(WMAX[TYPE]+P2_L[TYPE]-W[TYPE])+ + if(Pn>=(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB, 0, + WRANGE[TYPE]*(WFRACB-Pn/((BCF[TYPE]+1)*WRANGE[TYPE]))**(BCF[TYPE]+1))); #* + Q1S_L[TYPE]= min(1,DSCR)*Q1_L[TYPE]; + P0_L[TYPE]= P0_L[TYPE]-Q1_L[TYPE]; + + #-Actual bare soil evaporation and transpiration based on the remainder of the potential + # and limited to the available moisture content; top soil for ES, entire root zone for T + #RFW(i) (-): root fraction per layer, corrected to 100% + #WF(i) (-): weighing factor for fractioning transpiration per layer, + # based on total available moisture storage in soil, or else RFW + #ES_p (m): potential bare soil evaporation + #ES_a (m): actual bare soil evaporation + #T_p(i) (m): potential transpiration per layer + #T_a(i) (m): actual transpiration per layer + #FRACTA (-): fraction of actual over potential transpiration + WF1= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW1[TYPE]*S1_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW1[TYPE]); + WF2= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW2[TYPE]*S2_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW2[TYPE]); + FRACTA[TYPE]= (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-(1+BCF[TYPE])/BCF[TYPE]*WFRACB))/ + (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-WFRACB)); + FRACTA[TYPE]= (1-SATFRAC_L[TYPE])/(1+(max(0.01,FRACTA[TYPE])/THEFF_50[TYPE])**(-3*BCH_50[TYPE])); + T1_p[TYPE]= WF1*T_p[TYPE]; + T2_p[TYPE]= max(0,T_p[TYPE]-T1_p[TYPE]); + T1_a[TYPE]= FRACTA[TYPE]*T1_p[TYPE]; + T2_a[TYPE]= FRACTA[TYPE]*T2_p[TYPE]; + T_a[TYPE]= T1_a[TYPE]+T2_a[TYPE]; + #-actual bare soil evaporation + ES_a[TYPE]= SATFRAC_L[TYPE]*min(ES_p[TYPE],KS1[TYPE]*Duration*timeslice())+ + (1-SATFRAC_L[TYPE])*min(ES_p[TYPE],KTHEFF1*Duration*timeslice()); + + #-Percolation, subsurface storm flow and capillary rise + #P(i) (m): percolation from layer(i) to layer(i+1) + #CR(i) (m): capillary rise into layer(i) #* + #Q2 (m): lateral drainage from second store: + # dependent on net recharge to saturated wedge + # and centroid lag (Sloan and Moore, 1984) + # simplified by considering drainable pore space only + #RQ2 (m): recharge adding to or drawing from saturated wedge + #-fluxes + #* + #* Note that here the sequence of calculation has been reversed. First, the direct runoff + #* and the infiltration are modified by the amount of infiltration that is in excess of + #* the infiltration capacity. Next, the percolation from the first into the second layer is + #* computed as the flux due to the vertical unsaturated hydraulic conductivity over the two layers + #* this flux can only drain the layer to field capacity when the latyer is wet; infiltration in + #* excess to the storage capacity of layer 1 is passed on to the second layer. If the second layer + #* becomes saturated, the excess water is passed back to the first layer by means of the percolation + #* which may become negative in extreme cases (gain in storage in layer 1 due to return flow). + #* This was already included in the model but the return flow not assigned to a particular flux. + #* The capillary rise from the second to the first layer has been modified to consider the + #* gradient and the vertical unsaturated hydraulic conductivity. + #* + Q1_L[TYPE]= Q1_L[TYPE]+max(0,P0_L[TYPE]-KS1[TYPE]*Duration*timeslice()); + P0_L[TYPE]= min(P0_L[TYPE],KS1[TYPE]*Duration*timeslice()); + P1_L[TYPE]= KTHVERT*Duration*timeslice(); #* + P1_L[TYPE]= if(THEFF1_L > THEFF1_FC[TYPE],min(max(0,THEFF1_L-THEFF1_FC[TYPE])*SC1[TYPE], + P1_L[TYPE]),P1_L[TYPE])+max(0,P0_L[TYPE]-(SC1[TYPE]-S1_L[TYPE])); #* + CR1_L[TYPE]= min(max(0,THEFF1_FC[TYPE]-THEFF1_L)*SC1[TYPE], + KTHVERT*GRAD*Duration*timeslice()); #* + CR2_L[TYPE]= 0.5*(SATFRAC_L[TYPE]+CRFRAC)*min((1-THEFF2_L)*sqrt(KS2[TYPE]*KTHEFF2)*Duration*timeslice(), + max(0,THEFF2_FC[TYPE]-THEFF2_L)*SC2[TYPE]); + RQ2= P2_IMP[TYPE]*(P1_L[TYPE]+CR2_L[TYPE]-(P2_L[TYPE]+CR1_L[TYPE])); + Q2_L[TYPE]= max(TCL[TYPE]*RQ2+(1-TCL[TYPE])*Q2_L[TYPE],0); + #-water balance: scaled fluxes and new states + # first layer + ADJUST= ES_a[TYPE]+T1_a[TYPE]+P1_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,(max(0,S1_L[TYPE]+P0_L[TYPE]))/ADJUST),0); + ES_a[TYPE]= ADJUST*ES_a[TYPE]; + T1_a[TYPE]= ADJUST*T1_a[TYPE]; + P1_L[TYPE]= ADJUST*P1_L[TYPE]; + # second layer + ADJUST= T2_a[TYPE]+P2_L[TYPE]+Q2_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,max(S2_L[TYPE]+P1_L[TYPE],0)/ADJUST),0); + T2_a[TYPE]= ADJUST*T2_a[TYPE]; + P2_L[TYPE]= ADJUST*P2_L[TYPE]; + Q2_L[TYPE]= ADJUST*Q2_L[TYPE]; + + #CR2_L[TYPE]= min(VEGFRAC[TYPE]*S3,CR2_L[TYPE]); + CR2_L[TYPE]= min( S3,CR2_L[TYPE]); # ***edwin_modification*** (see also the line 705) + + CR1_L[TYPE]= min(max(0,S2_L[TYPE]+P1_L[TYPE]-(T2_a[TYPE]+P2_L[TYPE]+Q2_L[TYPE])),CR1_L[TYPE]); + S2_L[TYPE]= max(0,S2_L[TYPE]+P1_L[TYPE]+CR2_L[TYPE]- + (P2_L[TYPE]+Q2_L[TYPE]+CR1_L[TYPE]+T2_a[TYPE])); + P1_L[TYPE]= P1_L[TYPE]-max(0,S2_L[TYPE]-SC2[TYPE]); #* + S1_L[TYPE]= max(0,S1_L[TYPE]+P0_L[TYPE]+CR1_L[TYPE]- + (P1_L[TYPE]+T1_a[TYPE]+ES_a[TYPE])); #* + S2_L[TYPE]= min(S2_L[TYPE],SC2[TYPE]); + Q1_L[TYPE]= Q1_L[TYPE]+max(0,S1_L[TYPE]-SC1[TYPE]); + S1_L[TYPE]= min(S1_L[TYPE],SC1[TYPE]); + #-total actual evapotranspiration + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]+T1_a[TYPE]+T2_a[TYPE]; + + #-update volumetric moisture content (m3/m3) + # THETA1_L : volumetric moisture content in the first soil layer (m3/m3) + # THETA2_L : volumetric moisture content in the second soil layer (m3/m3) + # THETAS_L : volumetric moisture content in the total soil layer (m3/m3) + # W : total water content in the soil layer (m) + THETA1_L[TYPE]= THETARES1[TYPE]+(THETASAT1[TYPE]-THETARES1[TYPE])*max(0,S1_L[TYPE]/SC1[TYPE]); + THETA2_L[TYPE]= THETARES1[TYPE]+(THETASAT1[TYPE]-THETARES1[TYPE])*max(0,S2_L[TYPE]/SC2[TYPE]); + THETAS_L[TYPE]= (Z1[TYPE]*THETA1_L[TYPE]+Z2[TYPE]*THETA2_L[TYPE])/max(0.001,Z1[TYPE]+Z2[TYPE]); + W[TYPE]= max(0,S1_L[TYPE]+S2_L[TYPE]); + + #-adding local fluxes and states relative to vegetation fractions + # as a function of RTN to correct for vegetation presence + PRPTOT= PRPTOT+VEGFRAC[TYPE]*PRP_L[TYPE]; + TAVG= TAVG+VEGFRAC[TYPE]*TA_L[TYPE]; + EPOT= EPOT+VEGFRAC[TYPE]*ET_p[TYPE]; + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + EACT= EACT+VEGFRAC[TYPE]*EACT_L[TYPE]; + ESPOT= ESPOT+VEGFRAC[TYPE]*ES_p[TYPE]; + ESACT= ESACT+VEGFRAC[TYPE]*ES_a[TYPE]; + T1POT= T1POT+VEGFRAC[TYPE]*T1_p[TYPE]; + T1ACT= T1ACT+VEGFRAC[TYPE]*T1_a[TYPE]; + T2POT= T2POT+VEGFRAC[TYPE]*T2_p[TYPE]; + T2ACT= T2ACT+VEGFRAC[TYPE]*T2_a[TYPE]; + TPOT= T1POT+T2POT; + TACT= T1ACT+T2ACT; + SATFRAC= SATFRAC+VEGFRAC[TYPE]*SATFRAC_L[TYPE]; + WACT= WACT+VEGFRAC[TYPE]*WACT_L; + THETA1= THETA1+VEGFRAC[TYPE]*THETA1_L[TYPE]; + THETA2= THETA2+VEGFRAC[TYPE]*THETA2_L[TYPE]; + THETAS= THETAS+VEGFRAC[TYPE]*THETAS_L[TYPE]; + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + SS= SS+VEGFRAC[TYPE]*W[TYPE]; + P0= P0+VEGFRAC[TYPE]*P0_L[TYPE]; + P1= P1+VEGFRAC[TYPE]*P1_L[TYPE]; + P2= P2+VEGFRAC[TYPE]*P2_L[TYPE]; + CR1= CR1+VEGFRAC[TYPE]*CR1_L[TYPE]; + + CR2= CR2+VEGFRAC[TYPE]*CR2_L[TYPE]; # see the lines 650-651 and the comments at the beginning of the script + + Q1= Q1+VEGFRAC[TYPE]*Q1_L[TYPE]; + Q1S= Q1S+VEGFRAC[TYPE]*Q1S_L[TYPE]; + Q2= Q2+VEGFRAC[TYPE]*Q2_L[TYPE]; + + #-report values per land cover type + #-initial and possible output + report (rep2) SC_L[TYPE]= SC_L[TYPE]; + report (rep2) SCF_L[TYPE]= SCF_L[TYPE]; + report (rep2) INTS_L[TYPE]= INTS_L[TYPE]; + report (rep2) S1_L[TYPE]= S1_L[TYPE]; + report (rep2) S2_L[TYPE]= S2_L[TYPE]; + #-possible output only + report (rep2) PRP_L[TYPE]= PRP_L[TYPE]; + report (rep2) TA_L[TYPE]= TA_L[TYPE]; + report (rep2) ET_p[TYPE]= ET_p[TYPE]; + report (rep2) THETA1_L[TYPE]= THETA1_L[TYPE]; + report (rep2) THETA2_L[TYPE]= THETA2_L[TYPE]; + report (rep2) THETAS_L[TYPE]= THETAS_L[TYPE]; + report (rep2) W[TYPE]= W[TYPE]; + report (rep2) SATFRAC_L[TYPE]= SATFRAC_L[TYPE]; + report (rep2) ES_p[TYPE]= ES_p[TYPE]; + report (rep2) ES_a[TYPE]= ES_a[TYPE]; + report (rep2) T1_p[TYPE]= T1_p[TYPE]; + report (rep2) T1_a[TYPE]= T1_a[TYPE]; + report (rep2) T2_p[TYPE]= T2_p[TYPE]; + report (rep2) T2_a[TYPE]= T2_a[TYPE]; + report (rep2) T_p[TYPE]= T_p[TYPE]; + report (rep2) T_a[TYPE]= T_a[TYPE]; + report (rep2) P0_L[TYPE]= P0_L[TYPE]; + report (rep2) P1_L[TYPE]= P1_L[TYPE]; + report (rep2) P2_L[TYPE]= P2_L[TYPE]; + report (rep2) CR1_L[TYPE]= CR1_L[TYPE]; + report (rep2) CR2_L[TYPE]= CR2_L[TYPE]; + report (rep2) Q1_L[TYPE]= Q1_L[TYPE]; + report (rep2) Q2_L[TYPE]= Q2_L[TYPE]; + + }#-end of land cover type loop + +#-------------------------- +#Overall fluxes third store +#-------------------------- +#Third reservoir +#R3 (m): groundwater recharge +#S3 (m): storage in third store, updated with current fluxes +#Q3 (m): discharge from third reservoir, based on storage previous timestep + R3= P2-CR2; + S3= max(0,S3+P2-CR2); + Q3= min(S3,KQ3*S3*Duration*timeslice()); + S3= max(0,S3-Q3); + +#-------------------- +# Fresh water surface +#-------------------- +# EWAT (m): potential evapotranspiration imposed on water surface +# QWAT (m): local change in storage of fresh water surface (can be negative) + EWAT= timeinputsparse(KC_WATSTACK)*EVAP; + QWAT= if(LANDMASK,PRPTOT-EWAT); + +#----------------------------- +#Channel storage and discharge +#----------------------------- +#QLOC (m): local discharge +#QCHANNEL (m3.s-1): channel discharge +#QAVG (m3.s-1): channel discharge, averaged per year + QLOC= Q1+Q2+Q3; + QCHANNEL= max(0,catchmenttotal(((1-FRACWAT)*QLOC+FRACWAT*QWAT)*CELLAREA,LDD)/(3600*24*Duration*timeslice())); + QCUM= QCUM+QCHANNEL; + QAVG= QCUM/time(); + +#------------ +#Budget check +#------------ +#PTOT (m): total accumulated precipitation +#ETOT (m): total accumulated evapotranspiration +#QTOT (m): total accumulated local discharge +#INTOT, OUTTOT (km3): total incoming and outgoing water volumes per catchment +#SLOC, SLOCINI (m): local storage at any timestep and initially +#STOT_ACT (km3) total active storage (e.g, excluding snow cover) to decide whether equilibrium has been +# achieved (also included STOT_AVG, average total storage in (m) for soil, +# which excludes snow accumulation) +#MBE (m): local mass balance error +#MBR (-): total mass balance error per catchment, relative to total input + PTOT= PTOT+PRPTOT; + ETOT= ETOT+(FRACWAT*EWAT+(1-FRACWAT)*EACT); + QTOT= QTOT+((1-FRACWAT)*QLOC+FRACWAT*QWAT); + SLOC= (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + MBE= PTOT+SLOCINI-(ETOT+QTOT+SLOC); + STOT_ACT= if(LANDMASK,1E-9,1E-9)*maptotal((1-FRACWAT)*CELLAREA*(S1+S2+S3+INTS)); + INTOT= catchmenttotal(1E-9*CELLAREA*(SLOCINI+PTOT),LDD); + OUTTOT= catchmenttotal(1E-9*CELLAREA*(ETOT+QTOT+SLOC),LDD); + MBR= 1-if(INTOT>0,(INTOT-OUTTOT)/INTOT,0); + +#------------------------ +# Reports: overall values +#------------------------ +#-Meteo + report (rep2) PRPTOT= PRPTOT; + report (rep2) EPOT= EPOT; + report (rep2) TAVG= TAVG; +#-states: snow pack + report (rep2) SC= SC; + report (rep2) SCF= SCF; +#-states: soil moisture and saturated area + report (rep2) S1= S1; + report (rep2) S2= S2; + report (rep2) SS= SS; + report (rep2) THETA1= THETA1; + report (rep2) THETA2= THETA2; + report (rep2) THETAS= THETAS; + report (rep2) SATFRAC= SATFRAC; +#-groundwater: storage, recharge and area influenced by capillary rise + report (rep2) S3= S3; + report (rep2) R3= R3; + report (rep2) CRFRAC= CRFRAC; +#-fluxes: evapotranspiration + report EWAT= EWAT; + report EACT= EACT; + report ESPOT= ESPOT; + report ESACT= ESACT; + report T1POT= T1POT; + report T2POT= T2POT; + report T1ACT= T1ACT; + report T2ACT= T2ACT; + report TPOT= TPOT; + report TACT= TACT; +#-fluxes: percolation and capillary rise + report (rep2) P0= P0; + report (rep2) P1= P1; + report (rep2) P2= P2; + report (rep2) CR1= CR1; + report (rep2) CR2= CR2; +#-runoff, discharge and surface water + report (rep2) Q1= Q1; + report (rep2) Q2= Q2; + report (rep2) Q3= Q3; + report (rep2) QLOC= QLOC; + report (rep2) QWAT= QWAT; + report (rep1) QAVG= QAVG; + +#-budget checks + report (rep1) MBE= MBE; + report (rep1) MBR= MBR; + +#-all output reported, end of file diff --git a/model/pcrglobwb_v1/pcrglobwb_version1.0_edwinVersion.txt b/model/pcrglobwb_v1/pcrglobwb_version1.0_edwinVersion.txt new file mode 100755 index 000000000..be12b4d72 --- /dev/null +++ b/model/pcrglobwb_v1/pcrglobwb_version1.0_edwinVersion.txt @@ -0,0 +1,953 @@ +#PCRGLOB-WB: run oldcalc -f pcrglobwb_v1.1.txt 365 10 +#Rens van Beek, Dept. Physical Geography, Utrecht University, 9/11/2005 +#Basic water balance model, thus omitting routing and water temperature +#-with 2 surface covers (tall and short vegetation) and 3 layers of soil compartment +#-includes surface runoff and soil evaporation based on the improved Arno scheme +# of Hagemann and Gates (2003) +#-climate input based on CRU data downscaled with ERA-40 daily surface fields +#-change made to script regarding fractioning of soil evaporation and transpiration +# and reports on fraction of EACT over EPOT included on 20/08/2008 +# NOTE: WS... for reducing bare soil evaporation is obsolete as a result of changes +# Updates made to root fractions (evapotranspiration parameters dependent on relative +# root fractions RFW rather than on absolute fractions RFRAC) and CR2 limited to parameterized +# storage capacity of second layer rather than on porosity in root zone (17/11/2008) +# Capillary rise is restricted to the fractional area influenced by the groundwater, CRFRAC +# 20/04/2011: Soil moisture scheme has been changed to allow for full saturation of the soil layers +# by including percolation over the contact between the second to third layer to the infiltration; +# both percolation and capillary rise over the first and second layer has been made dependent on +# the square root of k(theta_eff) to include the effect of less pervious layers; +# to limit recursive drying and wetting of the first layer by percolation to and capillary rise from +# the second, drainage from the first layer is restricted to water in excess of field capacity +# under wet conditions (water in excess of field capacity) and capillary rise from the second to +# first layer is based on the gradient rather than on the difference in relative degree of saturation +# alone and is capped to maximum field capacity; see #* for comments on the changes +# Modification 28/06/2012: minor issue with precipitation partitioning following interception solved +# Modification 17/12/2012: water balance calculation modified to return monthly totals + +# 18 Jul 2014: Edwin modified the following (for the simplification of debugging purpose) +# - FRACWAT = 0.0 +# - KC_WATSTACK = 0.0 +# - WMAX = SC1 + SC2 (instead of reading from file) +# - CR2_L[TYPE] = min(S3,CR2_L[TYPE]) (instead of CR2_L[TYPE]= min(VEGFRAC[TYPE]*S3,CR2_L[TYPE] as we don't have to reduce it with VEGFRAC) +# - Fixing BCH_50 (now it uses BCH_50[TYPE] instead of BCH_50) +# - Constrain that 0.0 <= SATFRAC_L =<= 1.0 +# - Evaporation from intercepted water <= T_p[TYPE] + + + +binding + +# Maps & TSS - input +###################################################################################################### +###################################################################################################### + + +# -General +###################################################################################################### + + Duration = scalar(1); # timestep in days + LANDMASK = maps\catclone.map; # clone map representing landmask of earth surface + CELLAREA = maps\cellarea30.map; # surface (m2) of cell covered by total land surface + + +# -Surface water +###################################################################################################### + + LDD = maps\lddsound_30min.map; # local drainage direction map + +# FRACWAT = maps\glwd130m_fracw.map; # fraction of cell area covered by fresh water + FRACWAT = scalar(0); # set to zero for debugging purpose + +# KC_WATSTACK = maps\kc_wat; # composite crop factor for channels and wetlands or lakes + KC_WATSTACK = scalar(0.0); + + +# -Groundwater +###################################################################################################### + + KQ3 = maps\globalalpha.map; # recession coefficient for store 3 (day-1): drainage + SPECYIELD3 = maps\specificyield.map; # specific yield for aquifer + DZS3INFLUENCED = scalar(5.0); # additional zone influenced by groundwater + + DZREL0001 = maps\hydro1k_dzrel0001.map; # maps of relative elevation above floodplain, in percent + DZREL0005 = maps\hydro1k_dzrel0005.map; + DZREL0010 = maps\hydro1k_dzrel0010.map; + DZREL0020 = maps\hydro1k_dzrel0020.map; + DZREL0030 = maps\hydro1k_dzrel0030.map; + DZREL0040 = maps\hydro1k_dzrel0040.map; + DZREL0050 = maps\hydro1k_dzrel0050.map; + DZREL0060 = maps\hydro1k_dzrel0060.map; + DZREL0070 = maps\hydro1k_dzrel0070.map; + DZREL0080 = maps\hydro1k_dzrel0080.map; + DZREL0090 = maps\hydro1k_dzrel0090.map; + DZREL0100 = maps\hydro1k_dzrel0100.map; + + +# -Meteo +###################################################################################################### + + prp_input = oldcalc_results\pr; # precipitation (m/day) + ta_input = oldcalc_results\ta; # temperature (degree C) + e0p_input = oldcalc_results\e0p; # reference potential evaporation (m/day) + + + +#-Physiography + LSLOPE = maps\globalbcat.map; # slope length (m) + TANSLOPE = maps\globalgradslope.map; # gradient of slope (m/m) + B_ORO = maps\globalboro.map; # shape coefficient related to orography + + +#STATIONS = maps\grdc_stations.map; # ID of gauging stations +#MONITORSTATIONS = maps\hol_climatelocs.map; # locations to monitor soil behaviour, one per climate zone #** + +#-Climatic input - values in m and ?C per day; CRU data and ERA-40 reanalysis + PRPSTACK = maps\meteo\pr; # map stack of daily precipitation rates (m/day) + TASTACK = maps\meteo\ta; # map stack of average daily temperature (degC) + EVAPSTACK = maps\meteo\e0p; # map stack of daily reference potential evapotranspiration rates (m/day) + +#-Water consumption: abstractions in m3 per day from the open water and groundwater store + POTABSTR_S0 = scalar(0); # from open water surface (m3/d) + POTABSTR_S3 = scalar(0); # from groundwater store (m3/d) + + +#-Minimum bare soil crop factor (-) + KCMIN = scalar(0.2); # used to separate soil evaporation from transpiration + +#-Snow routine parameters: constants + TT = scalar(0.0); # threshold temperature for freezing/thawing (?C) + CFMAX = scalar(0.0025); # degree-day factor (m??C-1?d-1) was: 0.0055 + SFCF = scalar(1.00); # snowfall correction factor (-) + CWH = scalar(0.10); # water holding capacity snow cover (-) + CFR = scalar(0.05); # refreezing coefficient (-) + +#-Vegetation parameters per cover type, interception and fractions read in per type (short, tall) + + COVERTYPE = [ + SHORT = sv, + TALL = tv]; # array of cover type: 1) short, 2) tall + COVERTABLE = maps\param_permafrost_edwinVersion.tbl; # table with parameterization per cover type + + VEGFRAC[COVERTYPE] = index(COVERTABLE); # subdivision in cover type + + CF_SHORTSTACK = maps\cover_fraction\cv_s; # fractional vegetation cover (-) per vegetation type + CF_TALLSTACK = maps\cover_fraction\cv_t; + + SMAX_SHORTSTACK = maps\interception_capacity_input\smax_s; # interception storage (m) per vegetation type + SMAX_TALLSTACK = maps\interception_capacity_input\smax_t; + + KC_SHORTSTACK = maps\crop_coefficient\kc_s; # crop factor (-) per vegetation type + KC_TALLSTACK = maps\crop_coefficient\kc_t; + +#-Soil parameters per cover type and layer (i) + THETASAT1[COVERTYPE] = index(COVERTABLE); # saturated volumetric moisture content (m3.m-3) + THETASAT2[COVERTYPE] = index(COVERTABLE); # first and second layer + THETARES1[COVERTYPE] = index(COVERTABLE); # residual volumetric moisture content (m3.m-3) + THETARES2[COVERTYPE] = index(COVERTABLE); # first and second layer + KS1[COVERTYPE] = index(COVERTABLE); # saturated hydraulic conductivity (m.day-1) + KS2[COVERTYPE] = index(COVERTABLE); # first and second layer + PSI_A1[COVERTYPE] = index(COVERTABLE); # air entry value (m) according to SWRC of Clapp & Hornberger (1978) + PSI_A2[COVERTYPE] = index(COVERTABLE); # first and second layer + BCH1[COVERTYPE] = index(COVERTABLE); # Pore size distribution parameter according to Clapp and Hornberger (1978) + BCH2[COVERTYPE] = index(COVERTABLE); # first and second layer + Z1[COVERTYPE] = index(COVERTABLE); # depth of first store + Z2[COVERTYPE] = index(COVERTABLE); # depth of second store + +#SC1[COVERTYPE] = index(COVERTABLE); # total storage per layer and for the entire soil profile +#SC2[COVERTYPE] = index(COVERTABLE); +#WMAX[COVERTYPE] = index(COVERTABLE); + + MINFRAC[COVERTYPE] = index(COVERTABLE); # ratio of min soil depth over average soil depth + MAXFRAC[COVERTYPE] = index(COVERTABLE); # ratio of max soil depth over average soil depth + RFRAC1[COVERTYPE] = index(COVERTABLE); # root fraction per soil layer + RFRAC2[COVERTYPE] = index(COVERTABLE); # first and second layer + P2_IMP[COVERTYPE] = index(COVERTABLE); # fractional area where percolation to groundwater store is impeded + +#-overall + PSI_FC = scalar(1.00); # matric suction at field capacity (m) + PSI_50 = scalar(3.33); # matric suction at which transpiration is halved (m) + BCH_ADD = scalar(3); # addition for kr-relationship of Clapp & Hornberger (1978; default 3) + + +#Initial storages for local variables, cell averages reported by default + SC_INI[COVERTYPE] = index(COVERTABLE); # initial snow cover (m) + SCF_INI[COVERTYPE] = index(COVERTABLE); # initial liquid water stored in snow cover (m) + INTS_INI[COVERTYPE] = index(COVERTABLE); # initial interception storage (m) + S1_INI[COVERTYPE] = index(COVERTABLE); # initial storage in upper store (m) + S2_INI[COVERTYPE] = index(COVERTABLE); # initial storage in second store (m) + Q2_INI[COVERTYPE] = index(COVERTABLE); # initial drainage from second store (m) + S3_INI = maps\initials\storGroundwater_initial.map; # initial storage in lower store (m) + +#Maps & TSS - output +#-note cover type is not needed to report local fluxes! + + SC = oldcalc_results\snowcov; # snow cover (m) + SC_L = oldcalc_results\sc; # idem, local value + SCF = oldcalc_results\snowliq; # liquid water stored in snow cover (m) + SCF_L = oldcalc_results\scf; # idem, local value + SCTSS = oldcalc_results\snowtot.tss; # total snow storage in equivalent water height (m) + + INTS = oldcalc_results\intstor; # interception storage (m) + INTS_L = oldcalc_results\ints; # idem, local value + INTSTSS = oldcalc_results\ints.tss; # as above, timeseries + + EACT = oldcalc_results\eact; # actual evapotranspiration (m) + EACTTSS = oldcalc_results\eact.tss; # as above, timeseries + ETPOT = oldcalc_results\etpot; # total potential evapotranspiration (m) + EFRAC = oldcalc_results\efrac; # fraction of actual over potential evapotranspiration (-) + ESPOT = oldcalc_results\espot; # potential soil evaporation (m) + ESACT = oldcalc_results\esact; # actual soil evaporation (m) + EWAT = oldcalc_results\ewat; # potential evaporation over open water + + T1POT = oldcalc_results\t1pot; # potential transpiration drawn from first soil layer (m) + T1ACT = oldcalc_results\tactUpp; # idem, actual + + T2POT = oldcalc_results\t2pot; # potential transpiration drawn from second soil layer (m) + T2ACT = oldcalc_results\tactLow; # idem, actual + + T_ACT = oldcalc_results\tact; # total transpiration from the entire layers + + SATFRAC = oldcalc_results\satf; # fraction saturated area (-) + WACT = oldcalc_results\wact; # actual water storage within root zone (m) + + CRFRAC = oldcalc_results\crfrac; # fraction of soil surface influenced by capillary rise + + P0 = oldcalc_results\infl; # infiltration + + P1 = oldcalc_results\p1x; # percolation from first layer + P2 = oldcalc_results\p2x; # percolation from second layer + CR1 = oldcalc_results\cr1x; # capillary rise from first layer + CR2 = oldcalc_results\cr2x; # capilary rise from second layer + + Q1 = oldcalc_results\qDr; # direct runoff (m) + Q1TSS = oldcalc_results\q1.tss; # idem, timeseries + Q1S = oldcalc_results\q1s; # direct runoff attributable to snow melt (m) + Q1STSS = oldcalc_results\q1snow.tss; # idem, timeseries + + Q2 = oldcalc_results\qSf; # runoff from second store (flow) (m) + Q2_L = oldcalc_results\q2; # idem, local value + + Q2TSS = oldcalc_results\q2.tss; # idem, timeseries + + Q3 = oldcalc_results\qBf; # runoff from lower store (base flow) (m) + Q3TSS = oldcalc_results\q3.tss; # idem, timeseries + + QLOC = oldcalc_results\qLoc; # specific runoff (m) + + S1 = oldcalc_results\sUpp; # storage in upper store (m) + S1_L = oldcalc_results\s1; # idem, local value + S1TSS = oldcalc_results\stor1.tss; # as above, timeseries + + S2 = oldcalc_results\sLow; # storage in second store (m) + S2_L = oldcalc_results\s2; # idem, local value + S2TSS = oldcalc_results\stor2.tss; # as above, timeseries + + R3 = oldcalc_results\rch; # recharge to third store + R3AVG = oldcalc_results\r3_avg.map; # average recharge to the third, groundwater store (m) + + S3 = oldcalc_results\sGw; # storage in lower store (m) + S3TSS = oldcalc_results\stor3.tss; # as above, timeseries + + QW = oldcalc_results\qw; # change in storage of freshwater surface + + + # forcing variables (re-written) + + + # channel discharge has been retained as check but is not used + QAVG = oldcalc_results\qaverage.map; # channel discharge - annual average (m/s) + QCHANNEL = oldcalc_results\qc; # channel discharge - daily value + QCHANNELTSS = oldcalc_results\qchannel.tss; # timeseries of total discharge (m/s) + + + # water balance components and budget check included here + + # - monthly water balance fluxes in m waterslice per unit surface area of pertinent type (water, land) per month + + PRECMON = oldcalc_results\precmon; # total precipitation over unit area + ETPMON = oldcalc_results\etpmon; # total potential evapotranspiration over unit land area (crop specific evapotranspiration) + + QWMON = oldcalc_results\qwmon; # change in storage of freshwater surface over water surface + Q1MON = oldcalc_results\q1mon; # runoff over land surface from first, top store + Q2MON = oldcalc_results\q2mon; # runoff over land surface from second store + Q3MON = oldcalc_results\q3mon; # runoff over land surface from third, groundwater store + EWATMON = oldcalc_results\ewatmon; # total potential evaporation over water surface + EACTMON = oldcalc_results\eactmon; # total actual evapotranspiration over land surface + ESACTMON = oldcalc_results\esactmon; # actual evaporation from the soil surface + TACTMON = oldcalc_results\tactmon; # actual transpiration from the soil + + + # - budget check + + PTOTTSS = oldcalc_results\ptot.tss; # total cumulative rainfall and initial accumulated storage (km3) + ETOT = oldcalc_results\etot.map; # total cumulative actual evapotranspiration (m) + ETOTTSS = oldcalc_results\etot.tss; # idem, as timeseries (km3) + QTOTTSS = oldcalc_results\qtot.tss; # total cumulative discharge (km3) + STOTTSS = oldcalc_results\stot.tss; # total accumulated storage (km3) + STOT_ACT = oldcalc_results\stot.map; # total active storage (km3) + STOT_AVG = oldcalc_results\stotavg.map; # average soil storage (m) + MBE = oldcalc_results\mbe.map; # absolute local mass balance error (m) + MBR = oldcalc_results\mbcheck.map; # relative, local mass balance error (-) + MBRTSS = oldcalc_results\mbcheck.tss; # idem, as time series at (selected) outlets + MBRMONTSS = oldcalc_results\mbcheck_selected.tss; # idem, as time series at (selected) monitoring stations #** + +areamap + LANDMASK; + +timer + 1 $12 1; + rep1 = endtime; # times to report TSS and initial maps + rep2 = 1+1..endtime; # times to report soil states and fluxes (default: daily) +#rep2 = $15+$15..endtime; # times to report soil states and fluxes + rep3 = $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12; # times to report monthly updates of water balance components + +initial + +#Initialization, dependent on COVERTYPE +#Initial storages + SC= scalar(0); + SCF= scalar(0); + INTS= scalar(0); + S1= scalar(0); + S2= scalar(0); + S3= S3_INI; + + foreach TYPE in COVERTYPE{ + #Initial storages + #-states and fluxes per vegetation type + SC_L[TYPE]= SC_INI[TYPE]; #initial snow cover (m) + SCF_L[TYPE]= SCF_INI[TYPE]; #initial liquid water stored in snow cover (m) + INTS_L[TYPE]= INTS_INI[TYPE]; #initial interception storage (m) + S1_L[TYPE]= S1_INI[TYPE]; #initial storage in upper store (m) + S2_L[TYPE]= S2_INI[TYPE]; #initial storage in second store (m) + Q2_L[TYPE]= Q2_INI[TYPE]; #initial drainage from second store (m) + #-total storages + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + + #-soil parameters + BCB1[TYPE]= 2*BCH1[TYPE]+BCH_ADD; #Campbell's (1974) coefficient to calculate the relative, + BCB2[TYPE]= 2*BCH2[TYPE]+BCH_ADD; #unsaturated hydraulic conductivity + #degree of saturation at field capacity for first and second layer + #and corresponding unstaturated hydraulic conductivity + THEFF1_FC[TYPE]= (PSI_FC/PSI_A1[TYPE])**(-1/BCH1[TYPE]); + KTHEFF1_FC[TYPE]= max(0,THEFF1_FC[TYPE]**BCB1[TYPE]*KS1[TYPE]); + THEFF2_FC[TYPE]= (PSI_FC/PSI_A2[TYPE])**(-1/BCH2[TYPE]); + KTHEFF2_FC[TYPE]= max(0,THEFF2_FC[TYPE]**BCB2[TYPE]*KS2[TYPE]); + #centroid-lag for constant drainable pore space (day), + #rewritten to fractions given the duration of one timestep + TCL[TYPE]= Duration*(2*KS2[TYPE]*TANSLOPE)/(LSLOPE*(1-THEFF2_FC[TYPE])*(THETASAT2[TYPE]-THETARES2[TYPE])); + TCL[TYPE]= max(0.0, TCL[TYPE]); + + + #-storage parameters related to Improved Arno Scheme + + SC1[TYPE] = Z1[TYPE] * (THETASAT1[TYPE] - THETARES1[TYPE]); + SC2[TYPE] = Z2[TYPE] * (THETASAT2[TYPE] - THETARES2[TYPE]); + + # storage in top soil limiting bare soil evapotranspiration + WSMAX[TYPE]= SC1[TYPE]; + WMAX[TYPE]= SC1[TYPE] + SC2[TYPE]; + + # minimum storage capacity set to fraction of mean total + WMIN[TYPE] = min(MINFRAC[TYPE], MAXFRAC[TYPE])*WMAX[TYPE]; + WSMIN[TYPE]= MINFRAC[TYPE]*WSMAX[TYPE]; + + # range in storage capacity + WRANGE[TYPE]= WMAX[TYPE]-WMIN[TYPE]; + WSRANGE[TYPE]= WSMAX[TYPE]-WSMIN[TYPE]; + + # shape coefficient for distribution of maximum storage capacity, maximum set to fraction of total + BCF[TYPE]= max(0.001,(MAXFRAC[TYPE]-1)/(1-MINFRAC[TYPE])+B_ORO-0.01); + + + # weighed root fractions + RFW1[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0, + min(1.0,RFRAC1[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + RFW2[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0.0, + min(1.0,RFRAC2[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + + # average degree of saturation at which actual transpiration is halved + +# THEFF_50[TYPE] = if(RFW1[TYPE]+RFW2[TYPE] > 0, +# (SC1[TYPE]*RFW1[TYPE]*(PSI_50/PSI_A1[TYPE])**(-1/BCH1[TYPE])+ +# SC2[TYPE]*RFW2[TYPE]*(PSI_50/PSI_A2[TYPE])**(-1/BCH2[TYPE]))/ +# (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5); +# BCH_50[TYPE] = if(RFW1[TYPE]+RFW2[TYPE] > 0,(SC1[TYPE]*RFW1[TYPE]*BCH1[TYPE]+SC2[TYPE]*RFW2[TYPE]*BCH2[TYPE])/ +# (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5*(BCH1[TYPE]+BCH2[TYPE])); + + THEFF_50[TYPE] = if( (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]) > 0, + (SC1[TYPE]*RFW1[TYPE]*(PSI_50/PSI_A1[TYPE])**(-1/BCH1[TYPE])+ + SC2[TYPE]*RFW2[TYPE]*(PSI_50/PSI_A2[TYPE])**(-1/BCH2[TYPE]))/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5); + + BCH_50[TYPE] = if( (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]) > 0,(SC1[TYPE]*RFW1[TYPE]*BCH1[TYPE]+SC2[TYPE]*RFW2[TYPE]*BCH2[TYPE])/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5*(BCH1[TYPE]+BCH2[TYPE])); + + +} + +#-cumulative of monthly water balance + PRECMON= scalar(0); + ETPMON= scalar(0); + QWMON= scalar(0); + Q1MON= scalar(0); + Q2MON= scalar(0); + Q3MON= scalar(0); + EWATMON= scalar(0); + EACTMON= scalar(0); + ESACTMON= scalar(0); + TACTMON= scalar(0); +#-cumulative fluxes for average discharge and budget check + QCUM= scalar(0); + R3CUM= scalar(0); + STOT_CUM= scalar(0); + SLOCINI= (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + PTOT= scalar(0); + ETOT= scalar(0); + QTOT= scalar(0); +#-check on meteo generated + PTEST= scalar(0); + TTEST= scalar(0); + ETEST= scalar(0); + +dynamic +#---------------- +# Meteo +#---------------- +#Meteorological input as total/average per time step +# TA (?C): average temperature +# EVAP (m): reference potential evapotranspiration +# EWAT (m): as above, imposed on water surface +# PRP (m): liquid precipitation +# SNOW (m): snow in water equivalent +# PRPTOT (m): total precipitation + + PRPTOT = max(0.,timeinput(PRPSTACK))*Duration*timeslice(); + +report (rep2) prp_input = PRPTOT; # precipitation (m/day) + + TA= timeinput(TASTACK); + +report (rep2) ta_input = TA; # temperature (degree C) + +#-partitioning rain and snow and converting evapotransiration + + SNOW = if(TA0,PRP/PRPTOT,0))); #** + + PRP= max(0,PRP-SNOW); #** + EACT_L[TYPE]= min(INTS_L[TYPE],(T_p[TYPE]*if(ICC[TYPE]>0,INTS_L[TYPE]/ICC[TYPE],0)**(2/3))); + + EACT_L[TYPE]= min(T_p[TYPE], EACT_L[TYPE]); + + report (rep1) INTS_L[TYPE]= INTS_L[TYPE]-EACT_L[TYPE]; + T_p[TYPE]= max(0,T_p[TYPE]-EACT_L[TYPE]); + + #-Snow accumulation and melt + #SC (m): snow cover + #SCF (m): free water stored in snow cover + #DSC (m): change in snow cover, - melt, + gain in snow or refreezing (CFR) + #Pn (m): net liquid water transferred to soil + #DSCR (m): relative contribution of snow melt to net liquid water transfer + #ES_a (m): actual bare soil evaporation, + # here used to subtract any evaporation from liquid phase of snow cover + + DSC[TYPE] = if(TA<=TT,CFR*SCF_L[TYPE],-min(SC_L[TYPE],max(TA-TT,0)*CFMAX*Duration*timeslice())); + + SC_L[TYPE] = max(0.0, SC_L[TYPE] + SNOW + DSC[TYPE]); + + ## small part of snow will always melt (to minimize numerical errors) + #DSC[TYPE] = DSC[TYPE] - (SC_L[TYPE] - rounddown(SC_L[TYPE]*1000)/1000); + #SC_L[TYPE] = rounddown(SC_L[TYPE]*1000)/1000; + + SCF_L[TYPE] = SCF_L[TYPE] - DSC[TYPE] + PRP; + + Pn = max(0,SCF_L[TYPE]- CWH*SC_L[TYPE]); + #Pn = max(0,SCF_L[TYPE]- rounddown(CWH*SC_L[TYPE]*1000)/1000); + + DSCR = if(Pn>0,max(-DSC[TYPE],0)/Pn,0); + + SCF_L[TYPE]= max(0,SCF_L[TYPE]-Pn); + ES_a[TYPE]= min(SCF_L[TYPE],ES_p[TYPE]); + report (rep1) SCF_L[TYPE]= SCF_L[TYPE]-ES_a[TYPE]; + ES_p[TYPE]= max(0,ES_p[TYPE]-ES_a[TYPE]); + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]; + + #-Direct runoff and infiltration based on improved Arno scheme + # partial runoff when not entirely saturated (condition 1), else complete saturation excess + #BCF (-): b coefficient of soil water storage capacity distribution + #WMIN, WMAX (m): root zone water storage capacity, area-averaged values + #W (m): actual water storage in root zone + #WRANGE, DW, + #WFRAC (m): computation steps to ease runoff calculation, resp. + # (WMAX-WMIN), (WMAX-W) and DW/WRANGE + # WFRAC capped at 1 + #WFRACB (nd): DW/WRANGE raised to the power (1/(b+1)) + #SATFRAC (-): fractional saturated area + #WACT (m): actual water storage within rootzone + #THEFF(i) (-): effective degree of saturation + # + #-Saturated and unsaturated hydraulic conductivity, matric suction and gradient + #*PSI(i) (m): matric suction in layer(i) + #*GRAD (-): gradient for capillary rise + #KS(i) (m/d): saturated hydraulic conductivity + #KTHEFF(i) (m/d): unsaturated hydraulic conductivity + #*KTHVERT (m/d): idem, exchange between layers, capped at field capacity + #BCH(i) (-): pore size distribution factor of Clapp and Hornberger (1978) + #BCB(i) (-): Campbell's (1974) coefficient to calculate the relative, + # unsaturated hydraulic conductivity + #Pn (m): net liquid precipitation, reduced if WMIN not exceeded + #Q1 (m): direct or surface runoff + #Q1S (-): direct or surface runoff directly attributable to snow melt + #P0 (m): infiltration + #P(i) (m): percolation from layer(i) to layer(i+1) + #* + #* Note that here the scaling of the unsaturated hydraulic conductivity by that at field capacity + #* has been placed which earlier was included in the section where the soil hydrological fluxes (percolation) + #* were calculated. In order to allow for full saturation, the percolation from the second to the third + #* layer is already calculated here and added to the infiltration. + #* To ensure that scaling of k(thetaeff) by that value at field capacity for percolation and capillary rise of the first + #* layer does not affect the other results, the additional variable k(thetaeff) in the vertical direction over + #* the two soil layers is introduced. The capillary rise into this layer is no longer dependent on moisture but + #* primarily on the gradient. To this end, the new variables PSI(i), GRAD are introduced. + #* + THEFF1= max(0,S1_L[TYPE]/SC1[TYPE]); + THEFF2= max(0,S2_L[TYPE]/SC2[TYPE]); + + THEFF1= min(1.0, THEFF1); + THEFF2= min(1.0, THEFF2); + + PSI1= PSI_A1[TYPE]*max(0.01,THEFF1)**-BCH1[TYPE]; #* + PSI2= PSI_A2[TYPE]*max(0.01,THEFF2)**-BCH2[TYPE]; #* + GRAD= max(0,2*(PSI1-PSI2)/(Z1[TYPE]+Z2[TYPE])-1); #* + + KTHEFF1= max(0,THEFF1**BCB1[TYPE]*KS1[TYPE]); + KTHEFF2= max(0,THEFF2**BCB2[TYPE]*KS2[TYPE]); + + KTHEFF1= min(KTHEFF1, KS1[TYPE]); + KTHEFF2= min(KTHEFF2, KS2[TYPE]); + + KTHVERT= min(sqrt(KTHEFF1*KTHEFF2), + (KTHEFF1*KTHEFF2*KTHEFF1_FC[TYPE]*KTHEFF2_FC[TYPE])**0.25); #* + + P2_L[TYPE]= min(KTHEFF2,sqrt(KTHEFF2*KTHEFF2_FC[TYPE]))*Duration*timeslice(); #* + + W[TYPE]= max(0,S1_L[TYPE]+S2_L[TYPE]); + P0_L[TYPE]= Pn; + Pn= W[TYPE]+Pn; + Pn= Pn-max(WMIN[TYPE],W[TYPE]); + W[TYPE]= if(Pn<0,WMIN[TYPE]+Pn,max(W[TYPE],WMIN[TYPE])); + Pn= max(0,Pn); + DW= max(0,WMAX[TYPE]-W[TYPE]); + WFRAC= min(1,DW/WRANGE[TYPE]); + WFRACB= WFRAC**(1/(1+BCF[TYPE])); + + SATFRAC_L[TYPE] = if(WFRACB>0,1-WFRACB**BCF[TYPE],1); + + SATFRAC_L[TYPE] = min(1.0, SATFRAC_L[TYPE]); + SATFRAC_L[TYPE] = max(0.0, SATFRAC_L[TYPE]); + + WACT_L= (BCF[TYPE]+1)*WMAX[TYPE]-BCF[TYPE]*WMIN[TYPE]-(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB; + Q1_L[TYPE]= max(0,Pn-(WMAX[TYPE]+P2_L[TYPE]-W[TYPE])+ + if(Pn>=(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB, 0, + WRANGE[TYPE]*(WFRACB-Pn/((BCF[TYPE]+1)*WRANGE[TYPE]))**(BCF[TYPE]+1))); #* + + Q1_L[TYPE] = min(Q1_L[TYPE], P0_L[TYPE]); + + Q1S_L[TYPE]= min(1,DSCR)*Q1_L[TYPE]; + P0_L[TYPE]= P0_L[TYPE]-Q1_L[TYPE]; + + #-Actual bare soil evaporation and transpiration based on the remainder of the potential + # and limited to the available moisture content; top soil for ES, entire root zone for T + #RFW(i) (-): root fraction per layer, corrected to 100% + #WF(i) (-): weighing factor for fractioning transpiration per layer, + # based on total available moisture storage in soil, or else RFW + #ES_p (m): potential bare soil evaporation + #ES_a (m): actual bare soil evaporation + #T_p(i) (m): potential transpiration per layer + #T_a(i) (m): actual transpiration per layer + #FRACTA (-): fraction of actual over potential transpiration + + WF1= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW1[TYPE]*S1_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW1[TYPE]); + WF2= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW2[TYPE]*S2_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW2[TYPE]); + + FRACTA[TYPE]= (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-(1+BCF[TYPE])/BCF[TYPE]*WFRACB))/ + (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-WFRACB)); + FRACTA[TYPE]= (1-SATFRAC_L[TYPE])/(1+(max(0.01,FRACTA[TYPE])/THEFF_50[TYPE])**(-3*BCH_50[TYPE])); + + T1_p[TYPE]= WF1*T_p[TYPE]; + T2_p[TYPE]= max(0,T_p[TYPE]-T1_p[TYPE]); + + T_a1[TYPE]= FRACTA[TYPE]*T1_p[TYPE]; + T_a2[TYPE]= FRACTA[TYPE]*T2_p[TYPE]; + + T_a[TYPE]= T_a1[TYPE]+T_a2[TYPE]; + + #-actual bare soil evaporation + ES_a[TYPE]= SATFRAC_L[TYPE]*min(ES_p[TYPE],KS1[TYPE]*Duration*timeslice())+ + (1-SATFRAC_L[TYPE])*min(ES_p[TYPE],KTHEFF1*Duration*timeslice()); + + #-Percolation, subsurface storm flow and capillary rise + #P(i) (m): percolation from layer(i) to layer(i+1) + #CR(i) (m): capillary rise into layer(i) #* + #Q2 (m): lateral drainage from second store: + # dependent on net recharge to saturated wedge + # and centroid lag (Sloan and Moore, 1984) + # simplified by considering drainable pore space only + #RQ2 (m): recharge adding to or drawing from saturated wedge + #-fluxes + #* + #* Note that here the sequence of calculation has been reversed. First, the direct runoff + #* and the infiltration are modified by the amount of infiltration that is in excess of + #* the infiltration capacity. Next, the percolation from the first into the second layer is + #* computed as the flux due to the vertical unsaturated hydraulic conductivity over the two layers + #* this flux can only drain the layer to field capacity when the latyer is wet; infiltration in + #* excess to the storage capacity of layer 1 is passed on to the second layer. If the second layer + #* becomes saturated, the excess water is passed back to the first layer by means of the percolation + #* which may become negative in extreme cases (gain in storage in layer 1 due to return flow). + #* This was already included in the model but the return flow not assigned to a particular flux. + #* The capillary rise from the second to the first layer has been modified to consider the + #* gradient and the vertical unsaturated hydraulic conductivity. + #* + Q1_L[TYPE]= Q1_L[TYPE]+max(0,P0_L[TYPE]-KS1[TYPE]*Duration*timeslice()); + P0_L[TYPE]= min(P0_L[TYPE],KS1[TYPE]*Duration*timeslice()); + P1_L[TYPE]= KTHVERT*Duration*timeslice(); #* + P1_L[TYPE]= if(THEFF1 > THEFF1_FC[TYPE],min(max(0,THEFF1-THEFF1_FC[TYPE])*SC1[TYPE], + P1_L[TYPE]),P1_L[TYPE])+max(0,P0_L[TYPE]-(SC1[TYPE]-S1_L[TYPE])); #* + CR1_L[TYPE]= min(max(0,THEFF1_FC[TYPE]-THEFF1)*SC1[TYPE], + KTHVERT*GRAD*Duration*timeslice()); #* + CR2_L[TYPE]= 0.5*(SATFRAC_L[TYPE]+CRFRAC)*min((1-THEFF2)*sqrt(KS2[TYPE]*KTHEFF2)*Duration*timeslice(), + max(0,THEFF2_FC[TYPE]-THEFF2)*SC2[TYPE]); + + RQ2= P2_IMP[TYPE]*(P1_L[TYPE]+CR2_L[TYPE]-(P2_L[TYPE]+CR1_L[TYPE])); + Q2_L[TYPE]= max(TCL[TYPE]*RQ2+(1-TCL[TYPE])*Q2_L[TYPE],0); + #-water balance: scaled fluxes and new states + # first layer + ADJUST= ES_a[TYPE]+T_a1[TYPE]+P1_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,(max(0,S1_L[TYPE]+P0_L[TYPE]))/ADJUST),0); + ES_a[TYPE]= ADJUST*ES_a[TYPE]; + T_a1[TYPE]= ADJUST*T_a1[TYPE]; + P1_L[TYPE]= ADJUST*P1_L[TYPE]; + # second layer + ADJUST= T_a2[TYPE]+P2_L[TYPE]+Q2_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,max(S2_L[TYPE]+P1_L[TYPE],0)/ADJUST),0); + T_a2[TYPE]= ADJUST*T_a2[TYPE]; + P2_L[TYPE]= ADJUST*P2_L[TYPE]; + report (rep1) Q2_L[TYPE]= ADJUST*Q2_L[TYPE]; + + #CR2_L[TYPE] = min(VEGFRAC[TYPE]*S3,CR2_L[TYPE]); + CR2_L[TYPE] = min(S3,CR2_L[TYPE]); # Edwin modified this line (as we don't have to reduce CR2_L with VEGFRAC) + + CR1_L[TYPE] = min(max(0,S2_L[TYPE]+P1_L[TYPE]-(T_a2[TYPE]+P2_L[TYPE]+Q2_L[TYPE])),CR1_L[TYPE]); + S2_L[TYPE] = max(0,S2_L[TYPE]+P1_L[TYPE]+CR2_L[TYPE]- + (P2_L[TYPE]+Q2_L[TYPE]+CR1_L[TYPE]+T_a2[TYPE])); + + P1_L[TYPE] = P1_L[TYPE]-max(0,S2_L[TYPE]-SC2[TYPE]); #* + S1_L[TYPE] = max(0,S1_L[TYPE]+P0_L[TYPE]+CR1_L[TYPE]- + (P1_L[TYPE]+T_a1[TYPE]+ES_a[TYPE])); #* + + report (rep1) S2_L[TYPE]= min(S2_L[TYPE],SC2[TYPE]); + + Q1_L[TYPE] = Q1_L[TYPE]+max(0,S1_L[TYPE]-SC1[TYPE]); + report (rep1) S1_L[TYPE]= min(S1_L[TYPE],SC1[TYPE]); + + #-total actual evapotranspiration + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]+T_a1[TYPE]+T_a2[TYPE]; + + #-adding local fluxes and states relative to vegetation fractions + # as a function of RTN to correct for vegetation presence + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + ETPOT= ETPOT+VEGFRAC[TYPE]*ET_p[TYPE]; + EACT= EACT+VEGFRAC[TYPE]*EACT_L[TYPE]; + ESPOT= ESPOT+VEGFRAC[TYPE]*ES_p[TYPE]; + ESACT= ESACT+VEGFRAC[TYPE]*ES_a[TYPE]; + T1POT= T1POT+VEGFRAC[TYPE]*WF1*T_p[TYPE]; + T1ACT= T1ACT+VEGFRAC[TYPE]*T_a1[TYPE]; + T2POT= T2POT+VEGFRAC[TYPE]*WF2*T_p[TYPE]; + T2ACT= T2ACT+VEGFRAC[TYPE]*T_a2[TYPE]; + SATFRAC= SATFRAC+VEGFRAC[TYPE]*SATFRAC_L[TYPE]; + WACT= WACT+VEGFRAC[TYPE]*WACT_L; + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + P0= P0+VEGFRAC[TYPE]*P0_L[TYPE]; + P1= P1+VEGFRAC[TYPE]*P1_L[TYPE]; + P2= P2+VEGFRAC[TYPE]*P2_L[TYPE]; + CR1= CR1+VEGFRAC[TYPE]*CR1_L[TYPE]; + CR2= CR2+VEGFRAC[TYPE]*CR2_L[TYPE]; + Q1= Q1+VEGFRAC[TYPE]*Q1_L[TYPE]; + Q1S= Q1S+VEGFRAC[TYPE]*Q1S_L[TYPE]; + Q2= Q2+VEGFRAC[TYPE]*Q2_L[TYPE]; + } + +#--------------------------- +#Overall states upper stores +#--------------------------- + report (rep2) INTS = INTS; + report (rep2) P0 = P0; + report (rep2) SC = SC; + report (rep2) SCF = SCF; + SATFRAC= SATFRAC; +#report (rep2) WACT = WACT; + WACT = WACT; + report (rep2) S1 = S1; + report (rep2) S2 = S2; + +#--------------------------- +#Overall fluxes upper stores +#--------------------------- + ETPOT= ETPOT; + ESPOT= ESPOT; + report (rep2) ESACT = ESACT; + T1POT= T1POT; + report (rep2) T1ACT = T1ACT; + T2POT= T2POT; + report (rep2) T2ACT = T2ACT; + report (rep2) EACT = EACT; + report (rep2) T_ACT = T1ACT + T2ACT; + + EFRAC= if(ETPOT>0,EACT/ETPOT,1); + P1= P1; + report (rep2) Q1 = Q1; + P2= P2; + Q1S= Q1S; + report (rep2) Q2= Q2; + CR1= CR1; + CR2= CR2; + +#-------------------------- +#Overall fluxes third store +#-------------------------- +#Third reservoir +#R3 (m): groundwater recharge +#R3AVG (m): average recharge +#S3 (m): storage in third store, updated with current fluxes +#Q3 (m): discharge from third reservoir, based on storage previous timestep + report (rep2) R3 = P2-CR2; + R3CUM= R3CUM+R3; + report (rep1) R3AVG = R3CUM/time(); + ABSTR_S3= min(POTABSTR_S3,S3); + S3= max(0,S3+P2-(ABSTR_S3+CR2)); + report (rep2) Q3 = min(S3,KQ3*S3*Duration*timeslice()); + report (rep2) S3 = max(0,S3-Q3); + +#----------------------------- +#Channel storage and discharge +#----------------------------- +#QLOC (m): local discharge +#QCHANNEL (m3.s-1): channel discharge +#QAVG (m3.s-1): channel discharge, averaged per year + report (rep2) QLOC= Q1+Q2+Q3; + QLOC = (1-FRACWAT)*QLOC+FRACWAT*QW; +#report (rep2) QCHANNEL= max(0,catchmenttotal(QLOC*CELLAREA,LDD)/(3600*24*Duration*timeslice())); + QCHANNEL= max(0,catchmenttotal(QLOC*CELLAREA,LDD)/(3600*24*Duration*timeslice())); + QCUM= QCUM+QCHANNEL; + report (rep1) QAVG= QCUM/time(); + +#------------ +# Water balance and budget check +#------------ +#-update of monthly water balance components and budget check + report (rep3) PRECMON= PRECMON+PRPTOT; + report (rep3) ETPMON= ETPMON+EVAP; + report (rep3) QWMON= QWMON+QW; + report (rep3) Q1MON= Q1MON+Q1; + report (rep3) Q2MON= Q2MON+Q2; + report (rep3) Q3MON= Q3MON+Q3; + report (rep3) EWATMON= EWATMON+EWAT; + report (rep3) EACTMON= EACTMON+EACT; + report (rep3) ESACTMON= ESACTMON+ESACT; + report (rep3) TACTMON= TACTMON+T1ACT+T2ACT; + TIMERESET= boolean(0); + TIMERESET= if(time() == $1,boolean(1),TIMERESET); + TIMERESET= if(time() == $2,boolean(1),TIMERESET); + TIMERESET= if(time() == $3,boolean(1),TIMERESET); + TIMERESET= if(time() == $4,boolean(1),TIMERESET); + TIMERESET= if(time() == $5,boolean(1),TIMERESET); + TIMERESET= if(time() == $6,boolean(1),TIMERESET); + TIMERESET= if(time() == $7,boolean(1),TIMERESET); + TIMERESET= if(time() == $8,boolean(1),TIMERESET); + TIMERESET= if(time() == $9,boolean(1),TIMERESET); + TIMERESET= if(time() == $10,boolean(1),TIMERESET); + TIMERESET= if(time() == $11,boolean(1),TIMERESET); + TIMERESET= if(time() == $12,boolean(1),TIMERESET); + PRECMON= if(TIMERESET,scalar(0),PRECMON); + ETPMON= if(TIMERESET,scalar(0),ETPMON); + QWMON= if(TIMERESET,scalar(0),QWMON); + Q1MON= if(TIMERESET,scalar(0),Q1MON); + Q2MON= if(TIMERESET,scalar(0),Q2MON); + Q3MON= if(TIMERESET,scalar(0),Q3MON); + EWATMON= if(TIMERESET,scalar(0),EWATMON); + EACTMON= if(TIMERESET,scalar(0),EACTMON); + ESACTMON= if(TIMERESET,scalar(0),ESACTMON); + TACTMON= if(TIMERESET,scalar(0),TACTMON); +#-budget check +#STOT_ACT (km3) total active storage (e.g, excluding snow cover) to decide whether equilibrium has been +# achieved (also included STOT_AVG, average total storage in (m) for soil, +# which excludes snow accumulation) +#MBE (m): local mass balance error +#MBR (-): total mass balance error per catchment, relative to total input + PTOT= PTOT+PRPTOT; + report (rep1) ETOT= ETOT+(FRACWAT*EWAT+(1-FRACWAT)*EACT); + QTOT= QTOT+QLOC; + SLOC= (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + report (rep1) MBE= PTOT+SLOCINI-(ETOT+QTOT+SLOC); + report (rep1) STOT_ACT= if(LANDMASK,1E-9,1E-9)*maptotal((1-FRACWAT)*CELLAREA*(S1+S2+S3+INTS)); + STOT_CUM= STOT_CUM+(S1+S2+S3); + report (rep1) STOT_AVG= STOT_CUM/time(); + + INTOT= catchmenttotal(1E-9*CELLAREA*(SLOCINI+PTOT),LDD); + OUTTOT= catchmenttotal(1E-9*CELLAREA*(POTABSTR_S0+ABSTR_S3+ETOT+QTOT+SLOC),LDD); + report (rep1) MBR= 1-if(INTOT>0,(INTOT-OUTTOT)/INTOT,0); +#report (rep1) MBRTSS= timeoutput(STATIONS,MBR); +#report (rep1) MBRMONTSS= timeoutput(MONITORSTATIONS,MBR); + +#-report of on total volumes as timeseries per catchment +#report (rep1) PTOTTSS = timeoutput(STATIONS,catchmenttotal(1E-9*CELLAREA*(SLOCINI+PTOT),LDD)); +#report (rep1) ETOTTSS = timeoutput(STATIONS,catchmenttotal(1E-9*CELLAREA*ETOT,LDD)); +#report (rep1) QTOTTSS = timeoutput(STATIONS,catchmenttotal(1E-9*CELLAREA*QTOT,LDD)); +#report (rep1) STOTTSS = timeoutput(STATIONS,catchmenttotal(1E-9*CELLAREA*SLOC,LDD)); + +#------------ +#Reporting timeseries +#-------------------- +#report (rep1) SCTSS = timeoutput(MONITORSTATIONS,SC+SCF); +#report (rep1) INTSTSS = timeoutput(MONITORSTATIONS,INTS); +#report (rep1) EACTTSS = timeoutput(MONITORSTATIONS,EACT); +#report (rep1) S1TSS = timeoutput(MONITORSTATIONS,S1); +#report (rep1) S2TSS = timeoutput(MONITORSTATIONS,S2); +#report (rep1) S3TSS = timeoutput(MONITORSTATIONS,S3); +#report (rep1) Q1TSS = timeoutput(MONITORSTATIONS,Q1); +#report (rep1) Q1STSS = timeoutput(MONITORSTATIONS,Q1S); +#report (rep1) Q2TSS = timeoutput(MONITORSTATIONS,Q2); +#report (rep1) Q3TSS = timeoutput(MONITORSTATIONS,Q3); +#report (rep1) QCHANNELTSS = timeoutput(STATIONS,QCHANNEL); + +#-------------------- +#Temporary Reports +#-------------------- +#report (rep1) results\relstorsoil.tss= timeoutput(MONITORSTATIONS,(S1+S2)/WMAX[SHORT]); +#report (rep1) results\psi1.tss= timeoutput(MONITORSTATIONS,PSI1); +#report (rep1) results\psi2.tss= timeoutput(MONITORSTATIONS,PSI2); +#report (rep1) results\grad.tss= timeoutput(MONITORSTATIONS,GRAD); +#report (rep1) results\theff1.tss= timeoutput(MONITORSTATIONS,S1/SC1[SHORT]); +#report (rep1) results\theff2.tss= timeoutput(MONITORSTATIONS,S2/SC2[SHORT]); +#report (rep1) results\cr1.tss= timeoutput(MONITORSTATIONS,CR1); +#report (rep1) results\cr2.tss= timeoutput(MONITORSTATIONS,CR2); +#report (rep2) results\th1x= S1/SC1[SHORT]; +#report (rep2) results\th2x= S2/SC2[SHORT]; diff --git a/model/pcrglobwb_v1/pcrglobwb_version1.0_edwinVersion_finalize.txt b/model/pcrglobwb_v1/pcrglobwb_version1.0_edwinVersion_finalize.txt new file mode 100755 index 000000000..e5b2cdba8 --- /dev/null +++ b/model/pcrglobwb_v1/pcrglobwb_version1.0_edwinVersion_finalize.txt @@ -0,0 +1,991 @@ +#PCRGLOB-WB: run oldcalc -f pcrglobwb_v1.1.txt 365 10 +#Rens van Beek, Dept. Physical Geography, Utrecht University, 9/11/2005 +#Basic water balance model, thus omitting routing and water temperature +#-with 2 surface covers (tall and short vegetation) and 3 layers of soil compartment +#-includes surface runoff and soil evaporation based on the improved Arno scheme +# of Hagemann and Gates (2003) +#-climate input based on CRU data downscaled with ERA-40 daily surface fields +#-change made to script regarding fractioning of soil evaporation and transpiration +# and reports on fraction of EACT over EPOT included on 20/08/2008 +# NOTE: WS... for reducing bare soil evaporation is obsolete as a result of changes +# Updates made to root fractions (evapotranspiration parameters dependent on relative +# root fractions RFW rather than on absolute fractions RFRAC) and CR2 limited to parameterized +# storage capacity of second layer rather than on porosity in root zone (17/11/2008) +# Capillary rise is restricted to the fractional area influenced by the groundwater, CRFRAC +# 20/04/2011: Soil moisture scheme has been changed to allow for full saturation of the soil layers +# by including percolation over the contact between the second to third layer to the infiltration; +# both percolation and capillary rise over the first and second layer has been made dependent on +# the square root of k(theta_eff) to include the effect of less pervious layers; +# to limit recursive drying and wetting of the first layer by percolation to and capillary rise from +# the second, drainage from the first layer is restricted to water in excess of field capacity +# under wet conditions (water in excess of field capacity) and capillary rise from the second to +# first layer is based on the gradient rather than on the difference in relative degree of saturation +# alone and is capped to maximum field capacity; see #* for comments on the changes +# Modification 28/06/2012: minor issue with precipitation partitioning following interception solved +# Modification 17/12/2012: water balance calculation modified to return monthly totals + +# 3 Aug 2015: Edwin modified the following (for the simplification of debugging purpose) +# - FRACWAT = 0.0 and KC_WATSTACK = 0.0 (for the simplification of debugging process) +# - Reinstating B_ORO (so that it's consistent with Van Beek et al, 2011) +# - WMAX = SC1 + SC2 (instead of reading from file) +# - CR2_L[TYPE] = min(S3,CR2_L[TYPE]) (instead of CR2_L[TYPE]= min(VEGFRAC[TYPE]*S3,CR2_L[TYPE] as we don't have to reduce it with VEGFRAC) +# - Fixing BCH_50 (now it uses BCH_50[TYPE] instead of BCH_50) +# - Constrain that 0.0 <= SATFRAC_L =<= 1.0 +# - Evaporation from intercepted water <= T_p[TYPE] + + + +binding + +# Maps & TSS - input +###################################################################################################### +###################################################################################################### + + +# General +###################################################################################################### + + Duration = scalar(1); # timestep in days + LANDMASK = maps\catclone.map; # clone map representing landmask of earth surface + CELLAREA = maps\cellarea30.map; # surface (m2) of cell covered by total land surface + + +# Surface water +###################################################################################################### + + LDD = maps\lddsound_30min.map; # local drainage direction map + +# FRACWAT = maps\glwd130m_fracw.map; # fraction of cell area covered by fresh water + FRACWAT = scalar(0); # set to zero for debugging purpose + +# KC_WATSTACK = maps\kc_wat; # composite crop factor for channels and wetlands or lakes + KC_WATSTACK = scalar(0.0); + + +# Groundwater +###################################################################################################### + + KQ3 = maps\globalalpha.map; # recession coefficient for store 3 (day-1): drainage + SPECYIELD3 = maps\specificyield.map; # specific yield for aquifer + DZS3INFLUENCED = scalar(5.0); # additional zone influenced by groundwater + + DZREL0001 = maps\hydro1k_dzrel0001.map; # maps of relative elevation above floodplain, in percent + DZREL0005 = maps\hydro1k_dzrel0005.map; + DZREL0010 = maps\hydro1k_dzrel0010.map; + DZREL0020 = maps\hydro1k_dzrel0020.map; + DZREL0030 = maps\hydro1k_dzrel0030.map; + DZREL0040 = maps\hydro1k_dzrel0040.map; + DZREL0050 = maps\hydro1k_dzrel0050.map; + DZREL0060 = maps\hydro1k_dzrel0060.map; + DZREL0070 = maps\hydro1k_dzrel0070.map; + DZREL0080 = maps\hydro1k_dzrel0080.map; + DZREL0090 = maps\hydro1k_dzrel0090.map; + DZREL0100 = maps\hydro1k_dzrel0100.map; + + +# Meteo +###################################################################################################### +# Climatic input - values in m and degC per day + + PRPSTACK = maps\meteo\pr; # map stack of daily precipitation rates (m/day) + TASTACK = maps\meteo\ta; # map stack of average daily temperature (degC) + EVAPSTACK = maps\meteo\e0p; # map stack of daily reference potential evapotranspiration rates (m/day) + + + +# Vegetation parameters per cover type +###################################################################################################### + + COVERTYPE = [ + SHORT = sv, + TALL = tv]; # array of cover type: 1) short, 2) tall + COVERTABLE = maps\param_permafrost_edwinVersion.tbl; # table with parameterization per cover type + + VEGFRAC[COVERTYPE] = index(COVERTABLE); # subdivision in cover type + + CF_SHORTSTACK = maps\cover_fraction\cv_s; # fractional vegetation cover (-) per vegetation type + CF_TALLSTACK = maps\cover_fraction\cv_t; + + SMAX_SHORTSTACK = maps\interception_capacity_input\smax_s; # interception storage (m) per vegetation type + SMAX_TALLSTACK = maps\interception_capacity_input\smax_t; + + KC_SHORTSTACK = maps\crop_coefficient\kc_s; # crop factor (-) per vegetation type + KC_TALLSTACK = maps\crop_coefficient\kc_t; + + +# Minimum bare soil crop factor (-) +###################################################################################################### + + KCMIN = scalar(0.2); # used to separate soil evaporation from transpiration + + +# Snow routine parameters: constants +###################################################################################################### + + TT = scalar(0.0); # threshold temperature for freezing/thawing (degC) + CFMAX = scalar(0.0025); # degree-day factor (m??C-1?d-1) was: 0.0055 + SFCF = scalar(1.00); # snowfall correction factor (-) + CWH = scalar(0.10); # water holding capacity snow cover (-) + CFR = scalar(0.05); # refreezing coefficient (-) + + +# Topographical parameters +###################################################################################################### + + LSLOPE = maps\globalbcat.map; # slope length (m) + TANSLOPE = maps\globalgradslope.map; # gradient of slope (m/m) + B_ORO = maps\globalboro.map; # shape coefficient related to orography + + +# Soil parameters per cover type and layer (i) +###################################################################################################### + + THETASAT1[COVERTYPE] = index(COVERTABLE); # saturated volumetric moisture content (m3.m-3) + THETASAT2[COVERTYPE] = index(COVERTABLE); # first and second layer + THETARES1[COVERTYPE] = index(COVERTABLE); # residual volumetric moisture content (m3.m-3) + THETARES2[COVERTYPE] = index(COVERTABLE); # first and second layer + KS1[COVERTYPE] = index(COVERTABLE); # saturated hydraulic conductivity (m.day-1) + KS2[COVERTYPE] = index(COVERTABLE); # first and second layer + PSI_A1[COVERTYPE] = index(COVERTABLE); # air entry value (m) according to SWRC of Clapp & Hornberger (1978) + PSI_A2[COVERTYPE] = index(COVERTABLE); # first and second layer + BCH1[COVERTYPE] = index(COVERTABLE); # Pore size distribution parameter according to Clapp and Hornberger (1978) + BCH2[COVERTYPE] = index(COVERTABLE); # first and second layer + Z1[COVERTYPE] = index(COVERTABLE); # depth of first store + Z2[COVERTYPE] = index(COVERTABLE); # depth of second store + RFRAC1[COVERTYPE] = index(COVERTABLE); # root fraction per soil layer + RFRAC2[COVERTYPE] = index(COVERTABLE); # first and second layer + +#SC1[COVERTYPE] = index(COVERTABLE); # total storage per layer and for the entire soil profile +#SC2[COVERTYPE] = index(COVERTABLE); +#WMAX[COVERTYPE] = index(COVERTABLE); + + MINFRAC[COVERTYPE] = index(COVERTABLE); # ratio of min soil depth over average soil depth + MAXFRAC[COVERTYPE] = index(COVERTABLE); # ratio of max soil depth over average soil depth + P2_IMP[COVERTYPE] = index(COVERTABLE); # fractional area where percolation to groundwater store is impeded + + +# overall +###################################################################################################### + PSI_FC = scalar(1.00); # matric suction at field capacity (m) + PSI_50 = scalar(3.33); # matric suction at which transpiration is halved (m) + BCH_ADD = scalar(3); # addition for kr-relationship of Clapp & Hornberger (1978; default 3) + + +# STATIONS = maps\grdc_stations.map; # ID of gauging stations +# MONITORSTATIONS = maps\hol_climatelocs.map; # locations to monitor soil behaviour, one per climate zone #** + + +# Water consumption: abstractions in m3 per day from the open water and groundwater store + POTABSTR_S0 = scalar(0); # from open water surface (m3/d) + POTABSTR_S3 = scalar(0); # from groundwater store (m3/d) + + +# Initial storages for local variables, cell averages reported by default +########################################################################################################################## + SC_INI[COVERTYPE] = index(COVERTABLE); # initial snow cover (m) + SCF_INI[COVERTYPE] = index(COVERTABLE); # initial liquid water stored in snow cover (m) + INTS_INI[COVERTYPE] = index(COVERTABLE); # initial interception storage (m) + S1_INI[COVERTYPE] = index(COVERTABLE); # initial storage in upper store (m) + S2_INI[COVERTYPE] = index(COVERTABLE); # initial storage in second store (m) + Q2_INI[COVERTYPE] = index(COVERTABLE); # initial drainage from second store (m) + S3_INI = maps\initials\storGroundwater_initial.map; # initial storage in lower store (m) + + + +# Maps & TSS - output +########################################################################################################################## + + # forcing variables (re-written) + + prp_input = oldcalc_results\pr; # precipitation (m/day) + ta_input = oldcalc_results\ta; # temperature (degree C) + e0p_input = oldcalc_results\e0p; # reference potential evaporation (m/day) + + + SC = oldcalc_results\snowcov; # snow cover (m) + SC_L = oldcalc_results\sc; # idem, local value + SCF = oldcalc_results\snowliq; # liquid water stored in snow cover (m) + SCF_L = oldcalc_results\scf; # idem, local value + SCTSS = oldcalc_results\snowtot.tss; # total snow storage in equivalent water height (m) + + INTS = oldcalc_results\intstor; # interception storage (m) + INTS_L = oldcalc_results\ints; # idem, local value + INTSTSS = oldcalc_results\ints.tss; # as above, timeseries + + EACT = oldcalc_results\eact; # actual evapotranspiration (m) + EACTTSS = oldcalc_results\eact.tss; # as above, timeseries + ETPOT = oldcalc_results\etpot; # total potential evapotranspiration (m) + EFRAC = oldcalc_results\efrac; # fraction of actual over potential evapotranspiration (-) + ESPOT = oldcalc_results\espot; # potential soil evaporation (m) + ESACT = oldcalc_results\esact; # actual soil evaporation (m) + EWAT = oldcalc_results\ewat; # potential evaporation over open water + + T1POT = oldcalc_results\t1pot; # potential transpiration drawn from first soil layer (m) + T1ACT = oldcalc_results\tactUpp; # idem, actual + + T2POT = oldcalc_results\t2pot; # potential transpiration drawn from second soil layer (m) + T2ACT = oldcalc_results\tactLow; # idem, actual + + T_ACT = oldcalc_results\tact; # total transpiration from the entire layers + + INT_EVAP = oldcalc_results\int_evap; # evaporation from intercepted water + SCF_EVAP = oldcalc_results\scf_evap; # evaporation from snow free water + + SATFRAC = oldcalc_results\satf; # fraction saturated area (-) + WACT = oldcalc_results\wact; # actual water storage within root zone (m) + + CRFRAC = oldcalc_results\crfrac; # fraction of soil surface influenced by capillary rise + + P0 = oldcalc_results\infl; # infiltration + + P1 = oldcalc_results\p1x; # percolation from first layer + P2 = oldcalc_results\p2x; # percolation from second layer + CR1 = oldcalc_results\cr1x; # capillary rise from first layer + CR2 = oldcalc_results\cr2x; # capilary rise from second layer + + Q1 = oldcalc_results\qDr; # direct runoff (m) + Q1TSS = oldcalc_results\q1.tss; # idem, timeseries + Q1S = oldcalc_results\q1s; # direct runoff attributable to snow melt (m) + Q1STSS = oldcalc_results\q1snow.tss; # idem, timeseries + + Q2 = oldcalc_results\qSf; # runoff from second store (flow) (m) + Q2_L = oldcalc_results\q2; # idem, local value + + Q2TSS = oldcalc_results\q2.tss; # idem, timeseries + + Q3 = oldcalc_results\qBf; # runoff from lower store (base flow) (m) + Q3TSS = oldcalc_results\q3.tss; # idem, timeseries + + QLOC = oldcalc_results\qLoc; # specific runoff (m) + + S1 = oldcalc_results\sUpp; # storage in upper store (m) + S1_L = oldcalc_results\s1; # idem, local value + S1TSS = oldcalc_results\stor1.tss; # as above, timeseries + + S2 = oldcalc_results\sLow; # storage in second store (m) + S2_L = oldcalc_results\s2; # idem, local value + S2TSS = oldcalc_results\stor2.tss; # as above, timeseries + + R3 = oldcalc_results\rch; # recharge to third store + R3AVG = oldcalc_results\r3_avg.map; # average recharge to the third, groundwater store (m) + + S3 = oldcalc_results\sGw; # storage in lower store (m) + S3TSS = oldcalc_results\stor3.tss; # as above, timeseries + + QW = oldcalc_results\qw; # change in storage of freshwater surface + + + # channel discharge has been retained as check but is not used + QAVG = oldcalc_results\qaverage.map; # channel discharge - annual average (m/s) + QCHANNEL = oldcalc_results\qc; # channel discharge - daily value + QCHANNELTSS = oldcalc_results\qchannel.tss; # timeseries of total discharge (m/s) + + + # water balance components and budget check included here + + # - monthly water balance fluxes in m waterslice per unit surface area of pertinent type (water, land) per month + + PRECMON = oldcalc_results\precmon; # total precipitation over unit area + ETPMON = oldcalc_results\etpmon; # total potential evapotranspiration over unit land area (crop specific evapotranspiration) + + QWMON = oldcalc_results\qwmon; # change in storage of freshwater surface over water surface + Q1MON = oldcalc_results\q1mon; # runoff over land surface from first, top store + Q2MON = oldcalc_results\q2mon; # runoff over land surface from second store + Q3MON = oldcalc_results\q3mon; # runoff over land surface from third, groundwater store + EWATMON = oldcalc_results\ewatmon; # total potential evaporation over water surface + EACTMON = oldcalc_results\eactmon; # total actual evapotranspiration over land surface + ESACTMON = oldcalc_results\esactmon; # actual evaporation from the soil surface + TACTMON = oldcalc_results\tactmon; # actual transpiration from the soil + + + # - budget check + + PTOTTSS = oldcalc_results\ptot.tss; # total cumulative rainfall and initial accumulated storage (km3) + ETOT = oldcalc_results\etot.map; # total cumulative actual evapotranspiration (m) + ETOTTSS = oldcalc_results\etot.tss; # idem, as timeseries (km3) + QTOTTSS = oldcalc_results\qtot.tss; # total cumulative discharge (km3) + STOTTSS = oldcalc_results\stot.tss; # total accumulated storage (km3) + STOT_ACT = oldcalc_results\stot.map; # total active storage (km3) + STOT_AVG = oldcalc_results\stotavg.map; # average soil storage (m) + MBE = oldcalc_results\mbe.map; # absolute local mass balance error (m) + MBR = oldcalc_results\mbcheck.map; # relative, local mass balance error (-) + MBRTSS = oldcalc_results\mbcheck.tss; # idem, as time series at (selected) outlets + MBRMONTSS = oldcalc_results\mbcheck_selected.tss; # idem, as time series at (selected) monitoring stations #** + +areamap + LANDMASK; + +timer + 1 $12 1; + rep1 = endtime; # times to report TSS and initial maps + rep2 = 1+1..endtime; # times to report soil states and fluxes (default: daily) +#rep2 = $15+$15..endtime; # times to report soil states and fluxes + rep3 = $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12; # times to report monthly updates of water balance components + +initial + +#Initialization, dependent on COVERTYPE +#Initial storages + SC= scalar(0); + SCF= scalar(0); + INTS= scalar(0); + S1= scalar(0); + S2= scalar(0); + S3= S3_INI; + + foreach TYPE in COVERTYPE{ + + #Initial storages + #-states and fluxes per vegetation type + SC_L[TYPE]= SC_INI[TYPE]; #initial snow cover (m) + SCF_L[TYPE]= SCF_INI[TYPE]; #initial liquid water stored in snow cover (m) + INTS_L[TYPE]= INTS_INI[TYPE]; #initial interception storage (m) + S1_L[TYPE]= S1_INI[TYPE]; #initial storage in upper store (m) + S2_L[TYPE]= S2_INI[TYPE]; #initial storage in second store (m) + Q2_L[TYPE]= Q2_INI[TYPE]; #initial drainage from second store (m) + + #-total storages + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + + #-soil parameters + + BCB1[TYPE]= 2*BCH1[TYPE]+BCH_ADD; #Campbell's (1974) coefficient to calculate the relative, + BCB2[TYPE]= 2*BCH2[TYPE]+BCH_ADD; #unsaturated hydraulic conductivity + + #degree of saturation at field capacity for first and second layer + #and corresponding unstaturated hydraulic conductivity + THEFF1_FC[TYPE]= (PSI_FC/PSI_A1[TYPE])**(-1/BCH1[TYPE]); + KTHEFF1_FC[TYPE]= max(0,THEFF1_FC[TYPE]**BCB1[TYPE]*KS1[TYPE]); + THEFF2_FC[TYPE]= (PSI_FC/PSI_A2[TYPE])**(-1/BCH2[TYPE]); + KTHEFF2_FC[TYPE]= max(0,THEFF2_FC[TYPE]**BCB2[TYPE]*KS2[TYPE]); + + #centroid-lag for constant drainable pore space (day), + #rewritten to fractions given the duration of one timestep + TCL[TYPE]= Duration*(2*KS2[TYPE]*TANSLOPE)/(LSLOPE*(1-THEFF2_FC[TYPE])*(THETASAT2[TYPE]-THETARES2[TYPE])); + TCL[TYPE]= max(0.0, TCL[TYPE]); + + #-storage parameters related to Improved Arno Scheme + + SC1[TYPE] = Z1[TYPE] * (THETASAT1[TYPE] - THETARES1[TYPE]); + SC2[TYPE] = Z2[TYPE] * (THETASAT2[TYPE] - THETARES2[TYPE]); + + # storage in top soil limiting bare soil evapotranspiration + WSMAX[TYPE] = SC1[TYPE]; + WMAX[TYPE] = SC1[TYPE] + SC2[TYPE]; + + # minimum storage capacity set to fraction of mean total + WMIN[TYPE] = MINFRAC[TYPE]*WMAX[TYPE]; + WSMIN[TYPE] = MINFRAC[TYPE]*WSMAX[TYPE]; + + # range in storage capacity + WRANGE[TYPE]= WMAX[TYPE]-WMIN[TYPE]; + WSRANGE[TYPE]= WSMAX[TYPE]-WSMIN[TYPE]; + + # shape coefficient for distribution of maximum storage capacity, maximum set to fraction of total + BCF[TYPE] = max(0.001,(MAXFRAC[TYPE]-1)/(1-MINFRAC[TYPE])+B_ORO-0.01); + + # weighed root fractions + RFW1[TYPE] = if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0, + min(1.0,RFRAC1[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + RFW2[TYPE] = if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0.0, + min(1.0,RFRAC2[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + + # average degree of saturation at which actual transpiration is halved + + THEFF_50[TYPE] = if( (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]) > 0, + (SC1[TYPE]*RFW1[TYPE]*(PSI_50/PSI_A1[TYPE])**(-1/BCH1[TYPE])+ + SC2[TYPE]*RFW2[TYPE]*(PSI_50/PSI_A2[TYPE])**(-1/BCH2[TYPE]))/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5); + + BCH_50[TYPE] = if( (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]) > 0,(SC1[TYPE]*RFW1[TYPE]*BCH1[TYPE]+SC2[TYPE]*RFW2[TYPE]*BCH2[TYPE])/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5*(BCH1[TYPE]+BCH2[TYPE])); + +} + +# cumulative of monthly water balance + PRECMON = scalar(0); + ETPMON = scalar(0); + QWMON = scalar(0); + Q1MON = scalar(0); + Q2MON = scalar(0); + Q3MON = scalar(0); + EWATMON = scalar(0); + EACTMON = scalar(0); + ESACTMON = scalar(0); + TACTMON = scalar(0); + +# cumulative fluxes for average discharge and budget check + QCUM = scalar(0); + R3CUM = scalar(0); + STOT_CUM = scalar(0); + SLOCINI = (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + PTOT = scalar(0); + ETOT = scalar(0); + QTOT = scalar(0); + +# check on meteo generated + PTEST= scalar(0); + TTEST= scalar(0); + ETEST= scalar(0); + +dynamic + +#---------------- +# Meteo +#---------------- +#Meteorological input as total/average per time step +# TA (?C): average temperature +# EVAP (m): reference potential evapotranspiration +# EWAT (m): as above, imposed on water surface +# PRP (m): liquid precipitation +# SNOW (m): snow in water equivalent +# PRPTOT (m): total precipitation + + +# precipitation + + PRPTOT = max(0.,timeinput(PRPSTACK))*Duration*timeslice(); + +report (rep2) prp_input = PRPTOT; # precipitation (m/day) + +# temperature + + TA= timeinput(TASTACK); + +report (rep2) ta_input = TA; # temperature (degree C) + +# partitioning rain and snow and converting evapotransiration + + SNOW = if(TA0,PRP/PRPTOT,0))); #** + + PRP = max(0,PRP-SNOW); #** + EACT_L[TYPE] = min(INTS_L[TYPE],(T_p[TYPE]*if(ICC[TYPE]>0,INTS_L[TYPE]/ICC[TYPE],0)**(2/3))); + + EACT_L[TYPE] = min(T_p[TYPE], EACT_L[TYPE]); + + INT_EVAP_L = EACT_L[TYPE]; # evaporation from intercepted water + + report (rep1) INTS_L[TYPE] = INTS_L[TYPE]-EACT_L[TYPE]; + T_p[TYPE] = max(0,T_p[TYPE]-EACT_L[TYPE]); + + #-Snow accumulation and melt + #SC (m): snow cover + #SCF (m): free water stored in snow cover + #DSC (m): change in snow cover, - melt, + gain in snow or refreezing (CFR) + #Pn (m): net liquid water transferred to soil + #DSCR (m): relative contribution of snow melt to net liquid water transfer + #ES_a (m): actual bare soil evaporation, + # here used to subtract any evaporation from liquid phase of snow cover + + DSC[TYPE] = if(TA<=TT,CFR*SCF_L[TYPE],-min(SC_L[TYPE],max(TA-TT,0)*CFMAX*Duration*timeslice())); + SC_L[TYPE] = max(0.0, SC_L[TYPE] + SNOW + DSC[TYPE]); + + SCF_L[TYPE] = SCF_L[TYPE] - DSC[TYPE] + PRP; + + Pn = max(0,SCF_L[TYPE]- CWH*SC_L[TYPE]); + + DSCR = if(Pn>0,max(-DSC[TYPE],0)/Pn,0); + + SCF_L[TYPE]= max(0,SCF_L[TYPE]-Pn); + ES_a[TYPE]= min(SCF_L[TYPE],ES_p[TYPE]); + report (rep1) SCF_L[TYPE]= SCF_L[TYPE]-ES_a[TYPE]; + ES_p[TYPE]= max(0,ES_p[TYPE]-ES_a[TYPE]); + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]; + + SCF_EVAP_L = ES_a[TYPE]; # evaporation from snow free water + + #-Direct runoff and infiltration based on improved Arno scheme + # partial runoff when not entirely saturated (condition 1), else complete saturation excess + #BCF (-): b coefficient of soil water storage capacity distribution + #WMIN, WMAX (m): root zone water storage capacity, area-averaged values + #W (m): actual water storage in root zone + #WRANGE, DW, + #WFRAC (m): computation steps to ease runoff calculation, resp. + # (WMAX-WMIN), (WMAX-W) and DW/WRANGE + # WFRAC capped at 1 + #WFRACB (nd): DW/WRANGE raised to the power (1/(b+1)) + #SATFRAC (-): fractional saturated area + #WACT (m): actual water storage within rootzone + #THEFF(i) (-): effective degree of saturation + # + #-Saturated and unsaturated hydraulic conductivity, matric suction and gradient + #*PSI(i) (m): matric suction in layer(i) + #*GRAD (-): gradient for capillary rise + #KS(i) (m/d): saturated hydraulic conductivity + #KTHEFF(i) (m/d): unsaturated hydraulic conductivity + #*KTHVERT (m/d): idem, exchange between layers, capped at field capacity + #BCH(i) (-): pore size distribution factor of Clapp and Hornberger (1978) + #BCB(i) (-): Campbell's (1974) coefficient to calculate the relative, + # unsaturated hydraulic conductivity + #Pn (m): net liquid precipitation, reduced if WMIN not exceeded + #Q1 (m): direct or surface runoff + #Q1S (-): direct or surface runoff directly attributable to snow melt + #P0 (m): infiltration + #P(i) (m): percolation from layer(i) to layer(i+1) + #* + #* Note that here the scaling of the unsaturated hydraulic conductivity by that at field capacity + #* has been placed which earlier was included in the section where the soil hydrological fluxes (percolation) + #* were calculated. In order to allow for full saturation, the percolation from the second to the third + #* layer is already calculated here and added to the infiltration. + #* To ensure that scaling of k(thetaeff) by that value at field capacity for percolation and capillary rise of the first + #* layer does not affect the other results, the additional variable k(thetaeff) in the vertical direction over + #* the two soil layers is introduced. The capillary rise into this layer is no longer dependent on moisture but + #* primarily on the gradient. To this end, the new variables PSI(i), GRAD are introduced. + #* + THEFF1= max(0,S1_L[TYPE]/SC1[TYPE]); + THEFF2= max(0,S2_L[TYPE]/SC2[TYPE]); + + THEFF1= min(1.0, THEFF1); + THEFF2= min(1.0, THEFF2); + + PSI1= PSI_A1[TYPE]*max(0.01,THEFF1)**-BCH1[TYPE]; #* + PSI2= PSI_A2[TYPE]*max(0.01,THEFF2)**-BCH2[TYPE]; #* + + GRAD= max(0,2*(PSI1-PSI2)/(Z1[TYPE]+Z2[TYPE])-1); #* + + KTHEFF1= max(0,THEFF1**BCB1[TYPE]*KS1[TYPE]); + KTHEFF2= max(0,THEFF2**BCB2[TYPE]*KS2[TYPE]); + + KTHEFF1= min(KTHEFF1, KS1[TYPE]); + KTHEFF2= min(KTHEFF2, KS2[TYPE]); + + KTHVERT= min(sqrt(KTHEFF1*KTHEFF2), + (KTHEFF1*KTHEFF2*KTHEFF1_FC[TYPE]*KTHEFF2_FC[TYPE])**0.25); #* + + P2_L[TYPE]= min(KTHEFF2,sqrt(KTHEFF2*KTHEFF2_FC[TYPE]))*Duration*timeslice(); #* + + W[TYPE]= max(0,S1_L[TYPE]+S2_L[TYPE]); + P0_L[TYPE]= Pn; + Pn= W[TYPE]+Pn; + Pn= Pn-max(WMIN[TYPE],W[TYPE]); + W[TYPE]= if(Pn<0,WMIN[TYPE]+Pn,max(W[TYPE],WMIN[TYPE])); + Pn= max(0,Pn); + DW= max(0,WMAX[TYPE]-W[TYPE]); + WFRAC= min(1,DW/WRANGE[TYPE]); + WFRACB= WFRAC**(1/(1+BCF[TYPE])); + + SATFRAC_L[TYPE] = if(WFRACB>0,1-WFRACB**BCF[TYPE],1); + + SATFRAC_L[TYPE] = min(1.0, SATFRAC_L[TYPE]); + SATFRAC_L[TYPE] = max(0.0, SATFRAC_L[TYPE]); + + WACT_L= (BCF[TYPE]+1)*WMAX[TYPE]-BCF[TYPE]*WMIN[TYPE]-(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB; + Q1_L[TYPE]= max(0,Pn-(WMAX[TYPE]+P2_L[TYPE]-W[TYPE])+ + if(Pn>=(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB, 0, + WRANGE[TYPE]*(WFRACB-Pn/((BCF[TYPE]+1)*WRANGE[TYPE]))**(BCF[TYPE]+1))); #* + + Q1_L[TYPE] = min(Q1_L[TYPE], P0_L[TYPE]); + + Q1S_L[TYPE]= min(1,DSCR)*Q1_L[TYPE]; + P0_L[TYPE]= P0_L[TYPE]-Q1_L[TYPE]; + + #-Actual bare soil evaporation and transpiration based on the remainder of the potential + # and limited to the available moisture content; top soil for ES, entire root zone for T + #RFW(i) (-): root fraction per layer, corrected to 100% + #WF(i) (-): weighing factor for fractioning transpiration per layer, + # based on total available moisture storage in soil, or else RFW + #ES_p (m): potential bare soil evaporation + #ES_a (m): actual bare soil evaporation + #T_p(i) (m): potential transpiration per layer + #T_a(i) (m): actual transpiration per layer + #FRACTA (-): fraction of actual over potential transpiration + + WF1= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW1[TYPE]*S1_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW1[TYPE]); + WF2= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW2[TYPE]*S2_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW2[TYPE]); + + FRACTA[TYPE]= (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-(1+BCF[TYPE])/BCF[TYPE]*WFRACB))/ + (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-WFRACB)); + FRACTA[TYPE]= (1-SATFRAC_L[TYPE])/(1+(max(0.01,FRACTA[TYPE])/THEFF_50[TYPE])**(-3*BCH_50[TYPE])); + + T1_p[TYPE]= WF1*T_p[TYPE]; + T2_p[TYPE]= max(0,T_p[TYPE]-T1_p[TYPE]); + + T_a1[TYPE]= FRACTA[TYPE]*T1_p[TYPE]; + T_a2[TYPE]= FRACTA[TYPE]*T2_p[TYPE]; + + T_a[TYPE]= T_a1[TYPE]+T_a2[TYPE]; + + #-actual bare soil evaporation + ES_a[TYPE]= SATFRAC_L[TYPE]*min(ES_p[TYPE],KS1[TYPE]*Duration*timeslice())+ + (1-SATFRAC_L[TYPE])*min(ES_p[TYPE],KTHEFF1*Duration*timeslice()); + + #-Percolation, subsurface storm flow and capillary rise + #P(i) (m): percolation from layer(i) to layer(i+1) + #CR(i) (m): capillary rise into layer(i) #* + #Q2 (m): lateral drainage from second store: + # dependent on net recharge to saturated wedge + # and centroid lag (Sloan and Moore, 1984) + # simplified by considering drainable pore space only + #RQ2 (m): recharge adding to or drawing from saturated wedge + #-fluxes + #* + #* Note that here the sequence of calculation has been reversed. First, the direct runoff + #* and the infiltration are modified by the amount of infiltration that is in excess of + #* the infiltration capacity. Next, the percolation from the first into the second layer is + #* computed as the flux due to the vertical unsaturated hydraulic conductivity over the two layers + #* this flux can only drain the layer to field capacity when the latyer is wet; infiltration in + #* excess to the storage capacity of layer 1 is passed on to the second layer. If the second layer + #* becomes saturated, the excess water is passed back to the first layer by means of the percolation + #* which may become negative in extreme cases (gain in storage in layer 1 due to return flow). + #* This was already included in the model but the return flow not assigned to a particular flux. + #* The capillary rise from the second to the first layer has been modified to consider the + #* gradient and the vertical unsaturated hydraulic conductivity. + #* + Q1_L[TYPE]= Q1_L[TYPE]+max(0,P0_L[TYPE]-KS1[TYPE]*Duration*timeslice()); + P0_L[TYPE]= min(P0_L[TYPE],KS1[TYPE]*Duration*timeslice()); + P1_L[TYPE]= KTHVERT*Duration*timeslice(); #* + P1_L[TYPE]= if(THEFF1 > THEFF1_FC[TYPE],min(max(0,THEFF1-THEFF1_FC[TYPE])*SC1[TYPE], + P1_L[TYPE]),P1_L[TYPE])+max(0,P0_L[TYPE]-(SC1[TYPE]-S1_L[TYPE])); #* + CR1_L[TYPE]= min(max(0,THEFF1_FC[TYPE]-THEFF1)*SC1[TYPE], + KTHVERT*GRAD*Duration*timeslice()); #* + CR2_L[TYPE]= 0.5*(SATFRAC_L[TYPE]+CRFRAC)*min((1-THEFF2)*sqrt(KS2[TYPE]*KTHEFF2)*Duration*timeslice(), + max(0,THEFF2_FC[TYPE]-THEFF2)*SC2[TYPE]); + + RQ2= P2_IMP[TYPE]*(P1_L[TYPE]+CR2_L[TYPE]-(P2_L[TYPE]+CR1_L[TYPE])); + Q2_L[TYPE]= max(TCL[TYPE]*RQ2+(1-TCL[TYPE])*Q2_L[TYPE],0); + #-water balance: scaled fluxes and new states + # first layer + ADJUST= ES_a[TYPE]+T_a1[TYPE]+P1_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,(max(0,S1_L[TYPE]+P0_L[TYPE]))/ADJUST),0); + ES_a[TYPE]= ADJUST*ES_a[TYPE]; + T_a1[TYPE]= ADJUST*T_a1[TYPE]; + P1_L[TYPE]= ADJUST*P1_L[TYPE]; + # second layer + ADJUST= T_a2[TYPE]+P2_L[TYPE]+Q2_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,max(S2_L[TYPE]+P1_L[TYPE],0)/ADJUST),0); + T_a2[TYPE]= ADJUST*T_a2[TYPE]; + P2_L[TYPE]= ADJUST*P2_L[TYPE]; + report (rep1) Q2_L[TYPE]= ADJUST*Q2_L[TYPE]; + + #CR2_L[TYPE] = min(VEGFRAC[TYPE]*S3,CR2_L[TYPE]); + CR2_L[TYPE] = min(S3,CR2_L[TYPE]); # Edwin modified this line (as we don't have to reduce CR2_L with VEGFRAC) + + CR1_L[TYPE] = min(max(0,S2_L[TYPE]+P1_L[TYPE]-(T_a2[TYPE]+P2_L[TYPE]+Q2_L[TYPE])),CR1_L[TYPE]); + S2_L[TYPE] = max(0,S2_L[TYPE]+P1_L[TYPE]+CR2_L[TYPE]- + (P2_L[TYPE]+Q2_L[TYPE]+CR1_L[TYPE]+T_a2[TYPE])); + + P1_L[TYPE] = P1_L[TYPE]-max(0,S2_L[TYPE]-SC2[TYPE]); #* + S1_L[TYPE] = max(0,S1_L[TYPE]+P0_L[TYPE]+CR1_L[TYPE]- + (P1_L[TYPE]+T_a1[TYPE]+ES_a[TYPE])); #* + + report (rep1) S2_L[TYPE]= min(S2_L[TYPE],SC2[TYPE]); + + Q1_L[TYPE] = Q1_L[TYPE]+max(0,S1_L[TYPE]-SC1[TYPE]); + report (rep1) S1_L[TYPE]= min(S1_L[TYPE],SC1[TYPE]); + + #-total actual evapotranspiration + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]+T_a1[TYPE]+T_a2[TYPE]; + + #-adding local fluxes and states relative to vegetation fractions + # as a function of RTN to correct for vegetation presence + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + ETPOT= ETPOT+VEGFRAC[TYPE]*ET_p[TYPE]; + EACT= EACT+VEGFRAC[TYPE]*EACT_L[TYPE]; + ESPOT= ESPOT+VEGFRAC[TYPE]*ES_p[TYPE]; + ESACT= ESACT+VEGFRAC[TYPE]*ES_a[TYPE]; + T1POT= T1POT+VEGFRAC[TYPE]*WF1*T_p[TYPE]; + T1ACT= T1ACT+VEGFRAC[TYPE]*T_a1[TYPE]; + T2POT= T2POT+VEGFRAC[TYPE]*WF2*T_p[TYPE]; + T2ACT= T2ACT+VEGFRAC[TYPE]*T_a2[TYPE]; + SATFRAC= SATFRAC+VEGFRAC[TYPE]*SATFRAC_L[TYPE]; + WACT= WACT+VEGFRAC[TYPE]*WACT_L; + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + P0= P0+VEGFRAC[TYPE]*P0_L[TYPE]; + P1= P1+VEGFRAC[TYPE]*P1_L[TYPE]; + P2= P2+VEGFRAC[TYPE]*P2_L[TYPE]; + CR1= CR1+VEGFRAC[TYPE]*CR1_L[TYPE]; + CR2= CR2+VEGFRAC[TYPE]*CR2_L[TYPE]; + Q1= Q1+VEGFRAC[TYPE]*Q1_L[TYPE]; + Q1S= Q1S+VEGFRAC[TYPE]*Q1S_L[TYPE]; + Q2= Q2+VEGFRAC[TYPE]*Q2_L[TYPE]; + + INT_EVAP = INT_EVAP + VEGFRAC[TYPE]*INT_EVAP_L; + SCF_EVAP = SCF_EVAP + VEGFRAC[TYPE]*SCF_EVAP_L; + + } + +#--------------------------- +#Overall states upper stores +#--------------------------- + report (rep2) INTS = INTS; + report (rep2) P0 = P0; + report (rep2) SC = SC; + report (rep2) SCF = SCF; + SATFRAC= SATFRAC; +#report (rep2) WACT = WACT; + WACT = WACT; + report (rep2) S1 = S1; + report (rep2) S2 = S2; + +#--------------------------- +#Overall fluxes upper stores +#--------------------------- + ETPOT= ETPOT; + ESPOT= ESPOT; + report (rep2) ESACT = ESACT; + T1POT= T1POT; + report (rep2) T1ACT = T1ACT; + T2POT= T2POT; + report (rep2) T2ACT = T2ACT; + report (rep2) EACT = EACT; + report (rep2) T_ACT = T1ACT + T2ACT; + + report (rep2) INT_EVAP = INT_EVAP; + report (rep2) SCF_EVAP = SCF_EVAP; + + EFRAC= if(ETPOT>0,EACT/ETPOT,1); + P1= P1; + report (rep2) Q1 = Q1; + P2= P2; + Q1S= Q1S; + report (rep2) Q2= Q2; + CR1= CR1; + CR2= CR2; + +#-------------------------- +#Overall fluxes third store +#-------------------------- +#Third reservoir +#R3 (m): groundwater recharge +#R3AVG (m): average recharge +#S3 (m): storage in third store, updated with current fluxes +#Q3 (m): discharge from third reservoir, based on storage previous timestep + report (rep2) R3 = P2-CR2; + R3CUM= R3CUM+R3; + report (rep1) R3AVG = R3CUM/time(); + ABSTR_S3= min(POTABSTR_S3,S3); + S3= max(0,S3+P2-(ABSTR_S3+CR2)); + report (rep2) Q3 = min(S3,KQ3*S3*Duration*timeslice()); + report (rep2) S3 = max(0,S3-Q3); + +#----------------------------- +#Channel storage and discharge +#----------------------------- +#QLOC (m): local discharge +#QCHANNEL (m3.s-1): channel discharge +#QAVG (m3.s-1): channel discharge, averaged per year + report (rep2) QLOC= Q1+Q2+Q3; + QLOC = (1-FRACWAT)*QLOC+FRACWAT*QW; +#report (rep2) QCHANNEL= max(0,catchmenttotal(QLOC*CELLAREA,LDD)/(3600*24*Duration*timeslice())); + QCHANNEL= max(0,catchmenttotal(QLOC*CELLAREA,LDD)/(3600*24*Duration*timeslice())); + QCUM= QCUM+QCHANNEL; + report (rep1) QAVG= QCUM/time(); + +#------------ +# Water balance and budget check +#------------ +#-update of monthly water balance components and budget check + report (rep3) PRECMON= PRECMON+PRPTOT; + report (rep3) ETPMON= ETPMON+EVAP; + report (rep3) QWMON= QWMON+QW; + report (rep3) Q1MON= Q1MON+Q1; + report (rep3) Q2MON= Q2MON+Q2; + report (rep3) Q3MON= Q3MON+Q3; + report (rep3) EWATMON= EWATMON+EWAT; + report (rep3) EACTMON= EACTMON+EACT; + report (rep3) ESACTMON= ESACTMON+ESACT; + report (rep3) TACTMON= TACTMON+T1ACT+T2ACT; + TIMERESET= boolean(0); + TIMERESET= if(time() == $1,boolean(1),TIMERESET); + TIMERESET= if(time() == $2,boolean(1),TIMERESET); + TIMERESET= if(time() == $3,boolean(1),TIMERESET); + TIMERESET= if(time() == $4,boolean(1),TIMERESET); + TIMERESET= if(time() == $5,boolean(1),TIMERESET); + TIMERESET= if(time() == $6,boolean(1),TIMERESET); + TIMERESET= if(time() == $7,boolean(1),TIMERESET); + TIMERESET= if(time() == $8,boolean(1),TIMERESET); + TIMERESET= if(time() == $9,boolean(1),TIMERESET); + TIMERESET= if(time() == $10,boolean(1),TIMERESET); + TIMERESET= if(time() == $11,boolean(1),TIMERESET); + TIMERESET= if(time() == $12,boolean(1),TIMERESET); + PRECMON= if(TIMERESET,scalar(0),PRECMON); + ETPMON= if(TIMERESET,scalar(0),ETPMON); + QWMON= if(TIMERESET,scalar(0),QWMON); + Q1MON= if(TIMERESET,scalar(0),Q1MON); + Q2MON= if(TIMERESET,scalar(0),Q2MON); + Q3MON= if(TIMERESET,scalar(0),Q3MON); + EWATMON= if(TIMERESET,scalar(0),EWATMON); + EACTMON= if(TIMERESET,scalar(0),EACTMON); + ESACTMON= if(TIMERESET,scalar(0),ESACTMON); + TACTMON= if(TIMERESET,scalar(0),TACTMON); +#-budget check +#STOT_ACT (km3) total active storage (e.g, excluding snow cover) to decide whether equilibrium has been +# achieved (also included STOT_AVG, average total storage in (m) for soil, +# which excludes snow accumulation) +#MBE (m): local mass balance error +#MBR (-): total mass balance error per catchment, relative to total input + PTOT= PTOT+PRPTOT; + report (rep1) ETOT= ETOT+(FRACWAT*EWAT+(1-FRACWAT)*EACT); + QTOT= QTOT+QLOC; + SLOC= (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + report (rep1) MBE= PTOT+SLOCINI-(ETOT+QTOT+SLOC); + report (rep1) STOT_ACT= if(LANDMASK,1E-9,1E-9)*maptotal((1-FRACWAT)*CELLAREA*(S1+S2+S3+INTS)); + STOT_CUM= STOT_CUM+(S1+S2+S3); + report (rep1) STOT_AVG= STOT_CUM/time(); + + INTOT= catchmenttotal(1E-9*CELLAREA*(SLOCINI+PTOT),LDD); + OUTTOT= catchmenttotal(1E-9*CELLAREA*(POTABSTR_S0+ABSTR_S3+ETOT+QTOT+SLOC),LDD); + report (rep1) MBR= 1-if(INTOT>0,(INTOT-OUTTOT)/INTOT,0); +#report (rep1) MBRTSS= timeoutput(STATIONS,MBR); +#report (rep1) MBRMONTSS= timeoutput(MONITORSTATIONS,MBR); + +#-report of on total volumes as timeseries per catchment +#report (rep1) PTOTTSS = timeoutput(STATIONS,catchmenttotal(1E-9*CELLAREA*(SLOCINI+PTOT),LDD)); +#report (rep1) ETOTTSS = timeoutput(STATIONS,catchmenttotal(1E-9*CELLAREA*ETOT,LDD)); +#report (rep1) QTOTTSS = timeoutput(STATIONS,catchmenttotal(1E-9*CELLAREA*QTOT,LDD)); +#report (rep1) STOTTSS = timeoutput(STATIONS,catchmenttotal(1E-9*CELLAREA*SLOC,LDD)); + +#------------ +#Reporting timeseries +#-------------------- +#report (rep1) SCTSS = timeoutput(MONITORSTATIONS,SC+SCF); +#report (rep1) INTSTSS = timeoutput(MONITORSTATIONS,INTS); +#report (rep1) EACTTSS = timeoutput(MONITORSTATIONS,EACT); +#report (rep1) S1TSS = timeoutput(MONITORSTATIONS,S1); +#report (rep1) S2TSS = timeoutput(MONITORSTATIONS,S2); +#report (rep1) S3TSS = timeoutput(MONITORSTATIONS,S3); +#report (rep1) Q1TSS = timeoutput(MONITORSTATIONS,Q1); +#report (rep1) Q1STSS = timeoutput(MONITORSTATIONS,Q1S); +#report (rep1) Q2TSS = timeoutput(MONITORSTATIONS,Q2); +#report (rep1) Q3TSS = timeoutput(MONITORSTATIONS,Q3); +#report (rep1) QCHANNELTSS = timeoutput(STATIONS,QCHANNEL); + +#-------------------- +#Temporary Reports +#-------------------- +#report (rep1) results\relstorsoil.tss= timeoutput(MONITORSTATIONS,(S1+S2)/WMAX[SHORT]); +#report (rep1) results\psi1.tss= timeoutput(MONITORSTATIONS,PSI1); +#report (rep1) results\psi2.tss= timeoutput(MONITORSTATIONS,PSI2); +#report (rep1) results\grad.tss= timeoutput(MONITORSTATIONS,GRAD); +#report (rep1) results\theff1.tss= timeoutput(MONITORSTATIONS,S1/SC1[SHORT]); +#report (rep1) results\theff2.tss= timeoutput(MONITORSTATIONS,S2/SC2[SHORT]); +#report (rep1) results\cr1.tss= timeoutput(MONITORSTATIONS,CR1); +#report (rep1) results\cr2.tss= timeoutput(MONITORSTATIONS,CR2); +#report (rep2) results\th1x= S1/SC1[SHORT]; +#report (rep2) results\th2x= S2/SC2[SHORT]; diff --git a/model/pcrglobwb_v1/rens_master/pcr-glob_waterbalance_v1.0.modified_for_debugging.txt b/model/pcrglobwb_v1/rens_master/pcr-glob_waterbalance_v1.0.modified_for_debugging.txt new file mode 100755 index 000000000..144e48b58 --- /dev/null +++ b/model/pcrglobwb_v1/rens_master/pcr-glob_waterbalance_v1.0.modified_for_debugging.txt @@ -0,0 +1,841 @@ +#PCRGLOB-WB: run oldcalc -f pcrglobwb_v1.1.txt 365 10 +#Rens van Beek, Dept. Physical Geography, Utrecht University, 9/11/2005 +#Basic water balance model, thus omitting routing and water temperature +#-with 2 surface covers (tall and short vegetation) and 3 layers of soil compartment +#-includes surface runoff and soil evaporation based on the improved Arno scheme +# of Hagemann and Gates (2003) +#-climate input based on CRU data downscaled with ERA-40 daily surface fields +#-change made to script regarding fractioning of soil evaporation and transpiration +# and reports on fraction of EACT over EPOT included on 20/08/2008 +# NOTE: WS... for reducing bare soil evaporation is obsolete as a result of changes +# Updates made to root fractions (evapotranspiration parameters dependent on relative +# root fractions RFW rather than on absolute fractions RFRAC) and CR2 limited to parameterized +# storage capacity of second layer rather than on porosity in root zone (17/11/2008) +# Capillary rise is restricted to the fractional area influenced by the groundwater, CRFRAC +# 20/04/2011: Soil moisture scheme has been changed to allow for full saturation of the soil layers +# by including percolation over the contact between the second to third layer to the infiltration; +# both percolation and capillary rise over the first and second layer has been made dependent on +# the square root of k(theta_eff) to include the effect of less pervious layers; +# to limit recursive drying and wetting of the first layer by percolation to and capillary rise from +# the second, drainage from the first layer is restricted to water in excess of field capacity +# under wet conditions (water in excess of field capacity) and capillary rise from the second to +# first layer is based on the gradient rather than on the difference in relative degree of saturation +# alone and is capped to maximum field capacity; see #* for comments on the changes +# Modification 28/06/2012: minor issue with precipitation partitioning following interception solved + + +binding + +#Maps & TSS - input +#-General + Duration= $2; #timestep in days + LANDMASK= $3; #clone map representing landmask of earth surface + CELLAREA= $4; #surface (m2) of cell covered by total land surface + +#-Surface water + LDD= $5; #local drainage direction map + FRACWAT= $6; #fraction of cell area covered by fresh water [m2/m2] + KC_WATSTACK= $7; #composite crop factor for channels and wetlands or lakes + +#-Groundwater + KQ3= $8; #recession coefficient for store 3 (day-1): drainage + SPECYIELD3= $9; #specific yield for aquifer + DZS3INFLUENCED= $10; #additional zone influenced by groundwater + DZREL0001= $91; #maps of relative elevation above floodplain, in percent + DZREL0005= $92; + DZREL0010= $93; + DZREL0020= $94; + DZREL0030= $95; + DZREL0040= $96; + DZREL0050= $97; + DZREL0060= $98; + DZREL0070= $99; + DZREL0080= $100; + DZREL0090= $101; + DZREL0100= $102; + +#-Meteo +#-Precipitation [m/day], conversion constant and factor + PRPSTACK= $11; # input value + PRPCONSTANT= $12; # conversion constant, to get values as required + PRPFACTOR= $13; # conversion factor, to get values as required +#-Precipitation anomaly, multiplicative + PRPANOSTACK= $14; # input value + PRPANOCONSTANT= $15; # conversion constant, to get values as required + PRPANOFACTOR= $16; # conversion factor, to get values as required +#-Temperature [degC], conversion constant and factor + TASTACK= $17; + TACONSTANT= $18; + TAFACTOR= $19; +#-Temperature anomaly , additive + TAANOSTACK= $20; + TAANOCONSTANT= $21; + TAANOFACTOR= $22; +#-Reference potential evapotranspiration [m/day], conversion constant and factor + EVAPSTACK= $23; + EVAPCONSTANT= $24; + EVAPFACTOR= $25; +#-Reference potential evapotranspiration anomaly, multiplicative + EVAPANOSTACK= $26; + EVAPANOCONSTANT= $27; + EVAPANOFACTOR= $28; + +#-Vegetation parameters per cover type, interception and fractions read in per type (maximum 10 values) + COVERTYPE= [ + $31= $41, + $32= $42]; #array of cover type, e.g.: 1) short, 2) tall +#-fractional vegetation cover (m2/m2), interception storage (m per unit area) +# and crop factor per vegetation type + CFSTACK_01= $51; #-cover fraction + CFSTACK_02= $52; + CFSTACK_03= $53; + CFSTACK_04= $54; + CFSTACK_05= $55; + CFSTACK_06= $56; + CFSTACK_07= $57; + CFSTACK_08= $58; + CFSTACK_09= $59; + CFSTACK_10= $60; + SMAXSTACK_01= $61; #-interception, maximum canopy storage + SMAXSTACK_02= $62; + SMAXSTACK_03= $63; + SMAXSTACK_04= $64; + SMAXSTACK_05= $65; + SMAXSTACK_06= $66; + SMAXSTACK_07= $67; + SMAXSTACK_08= $68; + SMAXSTACK_09= $69; + SMAXSTACK_10= $70; + KCSTACK_01= $71; #-crop factor + KCSTACK_02= $72; + KCSTACK_03= $73; + KCSTACK_04= $74; + KCSTACK_05= $75; + KCSTACK_06= $76; + KCSTACK_07= $77; + KCSTACK_08= $78; + KCSTACK_09= $79; + KCSTACK_10= $80; +#-table with parameterization per cover type; all variables read as maps + COVERTABLE= $81; #table with parameterization per cover type +#-parameter values: vegetation fraction + VEGFRAC[COVERTYPE]= index(COVERTABLE); #subdivision in cover type +#-parameter values: snow module + TT[COVERTYPE]= index(COVERTABLE); #threshold temperature for freezing/thawing (?C) + CFMAX[COVERTYPE]= index(COVERTABLE); #degree-day factor (m??C-1?d-1) was: 0.0055 + SFCF[COVERTYPE]= index(COVERTABLE); #snowfall correction factor (-) + CWH[COVERTYPE]= index(COVERTABLE); #water holding capacity snow cover (-) + CFR[COVERTYPE]= index(COVERTABLE); #refreezing coefficient (-) +#-topographical parameters per cover type + LSLOPE[COVERTYPE]= index(COVERTABLE); #slope length (m) + TANSLOPE[COVERTYPE]= index(COVERTABLE); #gradient of slope (m/m) +#-soil parameters per cover type + PSI_FC[COVERTYPE]= index(COVERTABLE); #matric suction at field capacity (m) + PSI_50[COVERTYPE]= index(COVERTABLE); #matric suction at which transpiration is halved (m) + BCH_FACTOR[COVERTYPE]= index(COVERTABLE); #factor for kr-relationship of Clapp & Hornberger (1978; default 2) + BCH_ADD[COVERTYPE]= index(COVERTABLE); #addition for kr-relationship of Clapp & Hornberger (1978; default 3) + BCF[COVERTYPE]= index(COVERTABLE); #beta coefficient of the improved Arno scheme + MINFRAC[COVERTYPE]= index(COVERTABLE); #ratio of min soil depth over average soil depth + #MAXFRAC[COVERTYPE]= index(COVERTABLE); #ratio of max soil depth over average soil depth + P2_IMP[COVERTYPE]= index(COVERTABLE); #fractional area where percolation to groundwater store is impeded +#-soil parameters per cover type, constants and layer (i) + THETASAT1[COVERTYPE]= index(COVERTABLE); #saturated volumetric moisture content (m3.m-3) + THETASAT2[COVERTYPE]= index(COVERTABLE); #first and second layer + THETARES1[COVERTYPE]= index(COVERTABLE); #residual volumetric moisture content (m3.m-3) + THETARES2[COVERTYPE]= index(COVERTABLE); #first and second layer + KS1[COVERTYPE]= index(COVERTABLE); #saturated hydraulic conductivity (m.day-1) + KS2[COVERTYPE]= index(COVERTABLE); #first and second layer + PSI_A1[COVERTYPE]= index(COVERTABLE); #air entry value (m) according to SWRC of Clapp & Hornberger (1978) + PSI_A2[COVERTYPE]= index(COVERTABLE); #first and second layer + BCH1[COVERTYPE]= index(COVERTABLE); #pore size distribution parameter according to Clapp and Hornberger (1978) + BCH2[COVERTYPE]= index(COVERTABLE); #first and second layer + Z1[COVERTYPE]= index(COVERTABLE); #depth of first store + Z2[COVERTYPE]= index(COVERTABLE); #depth of second store + RFRAC1[COVERTYPE]= index(COVERTABLE); #root fraction per soil layer + RFRAC2[COVERTYPE]= index(COVERTABLE); #first and second layer +#-vegetation parameters per crop type + KCMIN[COVERTYPE]= index(COVERTABLE); #used to separate soil evaporation from transpiration +#Initial storages for local variables, cell averages reported by default + SC_INI[COVERTYPE]= index(COVERTABLE); #initial snow cover (m) + SCF_INI[COVERTYPE]= index(COVERTABLE); #initial liquid water stored in snow cover (m) + INTS_INI[COVERTYPE]= index(COVERTABLE); #initial interception storage (m) + S1_INI[COVERTYPE]= index(COVERTABLE); #initial storage in upper store (m) + S2_INI[COVERTYPE]= index(COVERTABLE); #initial storage in second store (m) + Q2_INI[COVERTYPE]= index(COVERTABLE); #initial drainage from second store (m) +#Initial storages for local variables, cell averages reported by default + S3_INI= $82; #initial storage in lower store (m) + +#Output: only maps are reported +#-representative for land cover dependent variables: note cover type is not needed to report local fluxes! +#-initial values + SC_L= $89\sc; #snow cover (m) + SCF_L= $89\scf; #liquid water stored in snow cover (m) + INTS_L= $89\ints; #interception storage (m) + Q2_L= $89\q2; #runoff from second store (flow) (m) + S1_L= $89\s1; #storage in upper store (m) + S2_L= $89\s2; #storage in second store (m) +#-optional output: see matches below for cell-based values + PRP_L= $89\prec; + TA_L= $89\temp; + ET_p= $89\epot; + THETA1_L= $89\th1; + THETA2_L= $89\th2; + THETAS_L= $89\ths; + W= $89\stors; + SATFRAC_L= $89\satf; + EACT_L= $89\eact; + ES_p= $89\espot; + ES_a= $89\esact; + T1_p= $89\t1pot; + T1_a= $89\t1act; + T2_p= $89\t2pot; + T2_a= $89\t2act; + T_p= $89\tpot; + T_a= $89\tact; + P0_L= $89\p0; + P1_L= $89\p1; + P2_L= $89\p2; + Q1_L= $89\q1; + CR1_L= $89\cr1; + CR2_L= $89\cr2; + +#-representative for total cell: meteo + PRPTOT= $89\prec; #total precipitiation (m/day) + TAVG= $89\temp; #average air temperature (degC) + EPOT= $89\epot; #total potential evapotranspiration (m) +#-representative for total cell: states + SC= $89\snowcov; #snow cover (m) + SCF= $89\snowliq; #liquid water stored in snow cover (m) + INTS= $89\intstor; #interception storage (m) + THETA1= $89\theta1x; #volumetric moisture content in the first soil (m3/m3) + THETA2= $89\theta2x; #volumetric moisture content in the second soil (m3/m3) + THETAS= $89\theta; #volumetric moisture content in soil column (m3/m3) + S1= $89\stor1x; #water storage in upper store (m) + S2= $89\stor2x; #water storage in second store (m) + SS= $89\stors; #total water storage in soil (m) + SATFRAC= $89\satf; #fraction saturated area (-) + CRFRAC= $89\crfrac; #fraction of soil surface influenced by capillary rise +#-representative for total cell: fluxes + EWAT= $89\ewat; #potential evaporation over open water + EACT= $89\eact; #actual evapotranspiration (m) + ESPOT= $89\espot; #potential soil evaporation (m) + ESACT= $89\esact; #actual soil evaporation (m) + T1POT= $89\t1pot; #potential transpiration drawn from first soil layer (m) + T1ACT= $89\t1act; #idem, actual + T2POT= $89\t2pot; #potential transpiration drawn from second soil layer (m) + T2ACT= $89\t2act; #idem, actual + TPOT= $89\tpot; #potential transpiration drawn from total soil layer (m) + TACT= $89\tact; #idem, actual + P0= $89\p0x; #infiltration to first layer (m/day) + P1= $89\p1x; #percolation from first layer (m/day) + P2= $89\p2x; #percolation from second layer (m/day) + CR1= $89\cr1x; #capillary rise to first layer (m/day) + CR2= $89\cr2x; #capilary rise to second layer (m/day) + Q1= $89\q1x; #direct runoff (m) + Q2= $89\q2x; #runoff from second store (flow) (m) + Q3= $89\q3x; #runoff from lower store (base flow) (m) + QLOC= $89\qloc; #specific runoff (m) + R3= $89\r3x; #recharge to third store + S3= $89\stor3x; #storage in lower store (m) + QWAT= $89\qwat; #change in storage of freshwater surface + QAVG= $89\qaverage.map;#channel discharge - annual average (m/s) +#budget check + MBE= $89\mbe.map; #absolute local mass balance error (m) + MBR= $89\mbcheck.map; #relative, local mass balance error (-) + +areamap + LANDMASK; + +timer + 1 $1 1; + rep1= endtime; #times to report TSS and initial maps + rep2= 1+1..endtime; #times to report soil states and fluxes + + +initial + +#Patching LDD + LDD= if(LANDMASK,cover(LDD,5)); + +#Initialization, dependent on COVERTYPE +#Initial storages + SC= scalar(0); + SCF= scalar(0); + INTS= scalar(0); + S1= scalar(0); + S2= scalar(0); + S3= S3_INI; + + foreach TYPE in COVERTYPE{ + #Initial storages + #-states and fluxes per vegetation type + SC_L[TYPE]= SC_INI[TYPE]; #initial snow cover (m) + SCF_L[TYPE]= SCF_INI[TYPE]; #initial liquid water stored in snow cover (m) + INTS_L[TYPE]= INTS_INI[TYPE]; #initial interception storage (m) + S1_L[TYPE]= S1_INI[TYPE]; #initial storage in upper store (m) + S2_L[TYPE]= S2_INI[TYPE]; #initial storage in second store (m) + Q2_L[TYPE]= Q2_INI[TYPE]; #initial drainage from second store (m) + #-total storages + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + + #-soil parameters + BCB1[TYPE]= BCH_FACTOR[TYPE]*BCH1[TYPE]+BCH_ADD[TYPE]; #Campbell's (1974) coefficient to calculate the relative, + BCB2[TYPE]= BCH_FACTOR[TYPE]*BCH2[TYPE]+BCH_ADD[TYPE]; #unsaturated hydraulic conductivity + #degree of saturation at field capacity for first and second layer + #and corresponding unstaturated hydraulic conductivity + THEFF1_FC[TYPE]= (PSI_FC[TYPE]/PSI_A1[TYPE])**(-1/BCH1[TYPE]); + KTHEFF1_FC[TYPE]= max(0,THEFF1_FC[TYPE]**BCB1[TYPE]*KS1[TYPE]); + THEFF2_FC[TYPE]= (PSI_FC[TYPE]/PSI_A2[TYPE])**(-1/BCH2[TYPE]); + KTHEFF2_FC[TYPE]= max(0,THEFF2_FC[TYPE]**BCB2[TYPE]*KS2[TYPE]); + #centroid-lag for constant drainable pore space (day), + #rewritten to fractions given the duration of one timestep + TCL[TYPE]= Duration*(2*KS2[TYPE]*TANSLOPE[TYPE])/(LSLOPE[TYPE]*(1-THEFF2_FC[TYPE])*(THETASAT2[TYPE]-THETARES2[TYPE])); + #-storage parameters related to Improved Arno Scheme + #-total active water storage capacity over first and second layer and total soil profile (m) + SC1[TYPE]= Z1[TYPE]*(THETASAT1[TYPE]-THETARES1[TYPE]); + SC2[TYPE]= Z2[TYPE]*(THETASAT2[TYPE]-THETARES2[TYPE]); + WMAX[TYPE]= SC1[TYPE]+SC2[TYPE]; + # storage in top soil limiting bare soil evapotranspiration + WSMAX[TYPE]= SC1[TYPE]; + #minimum storage capacity set to fraction of mean total + WMIN[TYPE]= MINFRAC[TYPE]*WMAX[TYPE]; + WSMIN[TYPE]= MINFRAC[TYPE]*WSMAX[TYPE]; + #range in storage capacity + WRANGE[TYPE]= WMAX[TYPE]-WMIN[TYPE]; + WSRANGE[TYPE]= WSMAX[TYPE]-WSMIN[TYPE]; + #weighed root fractions + RFW1[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0, + min(1.0,RFRAC1[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + RFW2[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0.0, + min(1.0,RFRAC2[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + #average degree of saturation at which actual transpiration is halved + THEFF_50[TYPE]= if(RFW1[TYPE]+RFW2[TYPE] > 0, + (SC1[TYPE]*RFW1[TYPE]*(PSI_50[TYPE]/PSI_A1[TYPE])**(-1/BCH1[TYPE])+ + SC2[TYPE]*RFW2[TYPE]*(PSI_50[TYPE]/PSI_A2[TYPE])**(-1/BCH2[TYPE]))/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5); + BCH_50[TYPE]= if(RFW1[TYPE]+RFW2[TYPE] > 0,(SC1[TYPE]*RFW1[TYPE]*BCH1[TYPE]+SC2[TYPE]*RFW2[TYPE]*BCH2[TYPE])/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5*(BCH1[TYPE]+BCH2[TYPE])); +} + +#-cumulative fluxes for average discharge and budget check + QCUM= scalar(0); + STOT_CUM= scalar(0); + SLOCINI= (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + PTOT= scalar(0); + ETOT= scalar(0); + QTOT= scalar(0); + +dynamic +#---------------- +# Meteo +#---------------- +#Meteorological input as total/average per time step +# PRPORG (m): total precipitation from original forcing +# TA (?C): average temperature +# EVAP (m): reference potential evapotranspiration + PRPORG= PRPCONSTANT+PRPFACTOR* + timeinput(PRPSTACK); + PRPANO= PRPANOCONSTANT+PRPANOFACTOR* + timeinputsparse(PRPANOSTACK); + PRPORG= max(0.,PRPANO*PRPORG)*Duration*timeslice(); + TA= TACONSTANT+TAFACTOR*timeinput(TASTACK); + TAANO= TAANOCONSTANT+TAANOFACTOR* + timeinputsparse(TAANOSTACK); + TA= TAANO+TA; + TA= TA+20; #! + EVAP= EVAPCONSTANT+EVAPFACTOR* + timeinput(EVAPSTACK); + EVAPANO= EVAPANOCONSTANT+EVAPANOFACTOR* + timeinputsparse(EVAPANOSTACK); + EVAP= 0*max(0.,EVAPANO*EVAP)*Duration*timeslice(); #! + +#---------------- +# Land surface +#---------------- +#Current approximate height of groundwater table and corresponding reach of cell under +# influence of capillary rise + DZS3= S3/SPECYIELD3+DZS3INFLUENCED; + CRFRAC= min(1.0,1.0-(DZREL0100-DZS3)*0.1/max(1e-3,DZREL0100-DZREL0090)); + CRFRAC= if(DZS30,PTF_L/PRP_L[TYPE],0)); #** + PTF_L= max(0,PTF_L-SNOW_L); #** + EACT_L[TYPE]= min(INTS_L[TYPE],(T_p[TYPE]*if(ICC[TYPE]>0,INTS_L[TYPE]/ICC[TYPE],0)**(2/3))); + INTS_L[TYPE]= INTS_L[TYPE]-EACT_L[TYPE]; + T_p[TYPE]= max(0,T_p[TYPE]-EACT_L[TYPE]); + + #-Snow accumulation and melt + #SC (m): snow cover + #SCF (m): free water stored in snow cover + #DSC (m): change in snow cover, - melt, + gain in snow or refreezing (CFR) + #Pn (m): net liquid water transferred to soil + #DSCR (m): relative contribution of snow melt to net liquid water transfer + #ES_a (m): actual bare soil evaporation, + # here used to subtract any evaporation from liquid phase of snow cover + DSC[TYPE]= if(TA_L[TYPE]<=TT[TYPE],CFR[TYPE]*SCF_L[TYPE],-min(SC_L[TYPE],max(TA_L[TYPE]-TT[TYPE],0)*CFMAX[TYPE]*Duration*timeslice())); + SC_L[TYPE]= SC_L[TYPE]+DSC[TYPE]+SNOW_L; + SCF_L[TYPE]= SCF_L[TYPE]-DSC[TYPE]+PTF_L; + Pn= max(0,SCF_L[TYPE]-CWH[TYPE]*SC_L[TYPE]); + DSCR= if(Pn>0,max(-DSC[TYPE],0)/Pn,0); + SCF_L[TYPE]= max(0,SCF_L[TYPE]-Pn); + ES_a[TYPE]= min(SCF_L[TYPE],ES_p[TYPE]); + SCF_L[TYPE]= SCF_L[TYPE]-ES_a[TYPE]; + ES_p[TYPE]= max(0,ES_p[TYPE]-ES_a[TYPE]); + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]; + + #-Direct runoff and infiltration based on improved Arno scheme + # partial runoff when not entirely saturated (condition 1), else complete saturation excess + #BCF (-): b coefficient of soil water storage capacity distribution + #WMIN, WMAX (m): root zone water storage capacity, area-averaged values + #W (m): actual water storage in root zone + #WRANGE, DW, + #WFRAC (m): computation steps to ease runoff calculation, resp. + # (WMAX-WMIN), (WMAX-W) and DW/WRANGE + # WFRAC capped at 1 + #WFRACB (nd): DW/WRANGE raised to the power (1/(b+1)) + #SATFRAC (-): fractional saturated area + #WACT (m): actual water storage within rootzone + #THEFF(i) (-): effective degree of saturation + # + #-Saturated and unsaturated hydraulic conductivity, matric suction and gradient + #*PSI(i) (m): matric suction in layer(i) + #*GRAD (-): gradient for capillary rise + #KS(i) (m/d): saturated hydraulic conductivity + #KTHEFF(i) (m/d): unsaturated hydraulic conductivity + #*KTHVERT (m/d): idem, exchange between layers, capped at field capacity + #BCH(i) (-): pore size distribution factor of Clapp and Hornberger (1978) + #BCB(i) (-): Campbell's (1974) coefficient to calculate the relative, + # unsaturated hydraulic conductivity + #Pn (m): net liquid precipitation, reduced if WMIN not exceeded + #Q1 (m): direct or surface runoff + #Q1S (-): direct or surface runoff directly attributable to snow melt + #P0 (m): infiltration + #P(i) (m): percolation from layer(i) to layer(i+1) + #* + #* Note that here the scaling of the unsaturated hydraulic conductivity by that at field capacity + #* has been placed which earlier was included in the section where the soil hydrological fluxes (percolation) + #* were calculated. In order to allow for full saturation, the percolation from the second to the third + #* layer is already calculated here and added to the infiltration. + #* To ensure that scaling of k(thetaeff) by that value at field capacity for percolation and capillary rise of the first + #* layer does not affect the other results, the additional variable k(thetaeff) in the vertical direction over + #* the two soil layers is introduced. The capillary rise into this layer is no longer dependent on moisture but + #* primarily on the gradient. To this end, the new variables PSI(i), GRAD are introduced. + #* + THEFF1_L= max(0,S1_L[TYPE]/SC1[TYPE]); + THEFF2_L= max(0,S2_L[TYPE]/SC2[TYPE]); + PSI1= PSI_A1[TYPE]*max(0.01,THEFF1_L)**-BCH1[TYPE]; #* + PSI2= PSI_A2[TYPE]*max(0.01,THEFF2_L)**-BCH2[TYPE]; #* + GRAD= max(0,2*(PSI1-PSI2)/(Z1[TYPE]+Z2[TYPE])-1); #* + KTHEFF1= max(0,THEFF1_L**BCB1[TYPE]*KS1[TYPE]); + KTHEFF2= max(0,THEFF2_L**BCB2[TYPE]*KS2[TYPE]); + KTHVERT= min(sqrt(KTHEFF1*KTHEFF2), + (KTHEFF1*KTHEFF2*KTHEFF1_FC[TYPE]*KTHEFF2_FC[TYPE])**0.25); #* + P2_L[TYPE]= min(KTHEFF2,sqrt(KTHEFF2*KTHEFF2_FC[TYPE]))*Duration*timeslice(); #* + W[TYPE]= max(0,S1_L[TYPE]+S2_L[TYPE]); + P0_L[TYPE]= Pn; + Pn= W[TYPE]+Pn; + Pn= Pn-max(WMIN[TYPE],W[TYPE]); + W[TYPE]= if(Pn<0,WMIN[TYPE]+Pn,max(W[TYPE],WMIN[TYPE])); + Pn= max(0,Pn); + DW= max(0,WMAX[TYPE]-W[TYPE]); + WFRAC= min(1,DW/WRANGE[TYPE]); + WFRACB= WFRAC**(1/(1+BCF[TYPE])); + SATFRAC_L[TYPE]= if(WFRACB>0,1-WFRACB**BCF[TYPE],1.0); + WACT_L= (BCF[TYPE]+1)*WMAX[TYPE]-BCF[TYPE]*WMIN[TYPE]-(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB; + Q1_L[TYPE]= 0*max(0,Pn-(WMAX[TYPE]+P2_L[TYPE]-W[TYPE])+ + if(Pn>=(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB, 0, + WRANGE[TYPE]*(WFRACB-Pn/((BCF[TYPE]+1)*WRANGE[TYPE]))**(BCF[TYPE]+1))); #* #! + Q1S_L[TYPE]= min(1,DSCR)*Q1_L[TYPE]; + P0_L[TYPE]= P0_L[TYPE]-Q1_L[TYPE]; + + #-Actual bare soil evaporation and transpiration based on the remainder of the potential + # and limited to the available moisture content; top soil for ES, entire root zone for T + #RFW(i) (-): root fraction per layer, corrected to 100% + #WF(i) (-): weighing factor for fractioning transpiration per layer, + # based on total available moisture storage in soil, or else RFW + #ES_p (m): potential bare soil evaporation + #ES_a (m): actual bare soil evaporation + #T_p(i) (m): potential transpiration per layer + #T_a(i) (m): actual transpiration per layer + #FRACTA (-): fraction of actual over potential transpiration + WF1= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW1[TYPE]*S1_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW1[TYPE]); + WF2= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW2[TYPE]*S2_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW2[TYPE]); + FRACTA[TYPE]= (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-(1+BCF[TYPE])/BCF[TYPE]*WFRACB))/ + (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-WFRACB)); + FRACTA[TYPE]= (1-SATFRAC_L[TYPE])/(1+(max(0.01,FRACTA[TYPE])/THEFF_50[TYPE])**(-3*BCH_50[TYPE])); + T1_p[TYPE]= WF1*T_p[TYPE]; + T2_p[TYPE]= max(0,T_p[TYPE]-T1_p[TYPE]); + T1_a[TYPE]= FRACTA[TYPE]*T1_p[TYPE]; + T2_a[TYPE]= FRACTA[TYPE]*T2_p[TYPE]; + T_a[TYPE]= T1_a[TYPE]+T2_a[TYPE]; + #-actual bare soil evaporation + ES_a[TYPE]= SATFRAC_L[TYPE]*min(ES_p[TYPE],KS1[TYPE]*Duration*timeslice())+ + (1-SATFRAC_L[TYPE])*min(ES_p[TYPE],KTHEFF1*Duration*timeslice()); + + #-Percolation, subsurface storm flow and capillary rise + #P(i) (m): percolation from layer(i) to layer(i+1) + #CR(i) (m): capillary rise into layer(i) #* + #Q2 (m): lateral drainage from second store: + # dependent on net recharge to saturated wedge + # and centroid lag (Sloan and Moore, 1984) + # simplified by considering drainable pore space only + #RQ2 (m): recharge adding to or drawing from saturated wedge + #-fluxes + #* + #* Note that here the sequence of calculation has been reversed. First, the direct runoff + #* and the infiltration are modified by the amount of infiltration that is in excess of + #* the infiltration capacity. Next, the percolation from the first into the second layer is + #* computed as the flux due to the vertical unsaturated hydraulic conductivity over the two layers + #* this flux can only drain the layer to field capacity when the latyer is wet; infiltration in + #* excess to the storage capacity of layer 1 is passed on to the second layer. If the second layer + #* becomes saturated, the excess water is passed back to the first layer by means of the percolation + #* which may become negative in extreme cases (gain in storage in layer 1 due to return flow). + #* This was already included in the model but the return flow not assigned to a particular flux. + #* The capillary rise from the second to the first layer has been modified to consider the + #* gradient and the vertical unsaturated hydraulic conductivity. + #* + Q1_L[TYPE]= Q1_L[TYPE]+max(0,P0_L[TYPE]-KS1[TYPE]*Duration*timeslice()); + P0_L[TYPE]= min(P0_L[TYPE],KS1[TYPE]*Duration*timeslice()); + P1_L[TYPE]= KTHVERT*Duration*timeslice(); #* + P1_L[TYPE]= if(THEFF1_L > THEFF1_FC[TYPE],min(max(0,THEFF1_L-THEFF1_FC[TYPE])*SC1[TYPE], + P1_L[TYPE]),P1_L[TYPE])+max(0,P0_L[TYPE]-(SC1[TYPE]-S1_L[TYPE])); #* + CR1_L[TYPE]= 0*min(max(0,THEFF1_FC[TYPE]-THEFF1_L)*SC1[TYPE], + KTHVERT*GRAD*Duration*timeslice()); #* #! + CR2_L[TYPE]= 0*0.5*(SATFRAC_L[TYPE]+CRFRAC)*min((1-THEFF2_L)*sqrt(KS2[TYPE]*KTHEFF2)*Duration*timeslice(), + max(0,THEFF2_FC[TYPE]-THEFF2_L)*SC2[TYPE]); #! + RQ2= P2_IMP[TYPE]*(P1_L[TYPE]+CR2_L[TYPE]-(P2_L[TYPE]+CR1_L[TYPE])); + Q2_L[TYPE]= max(TCL[TYPE]*RQ2+(1-TCL[TYPE])*Q2_L[TYPE],0); + #-water balance: scaled fluxes and new states + # first layer + ADJUST= ES_a[TYPE]+T1_a[TYPE]+P1_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,(max(0,S1_L[TYPE]+P0_L[TYPE]))/ADJUST),0); + ES_a[TYPE]= ADJUST*ES_a[TYPE]; + T1_a[TYPE]= ADJUST*T1_a[TYPE]; + P1_L[TYPE]= ADJUST*P1_L[TYPE]; + # second layer + ADJUST= T2_a[TYPE]+P2_L[TYPE]+Q2_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,max(S2_L[TYPE]+P1_L[TYPE],0)/ADJUST),0); + T2_a[TYPE]= ADJUST*T2_a[TYPE]; + P2_L[TYPE]= ADJUST*P2_L[TYPE]; + Q2_L[TYPE]= ADJUST*Q2_L[TYPE]; + CR2_L[TYPE]= min(VEGFRAC[TYPE]*S3,CR2_L[TYPE]); + CR1_L[TYPE]= min(max(0,S2_L[TYPE]+P1_L[TYPE]-(T2_a[TYPE]+P2_L[TYPE]+Q2_L[TYPE])),CR1_L[TYPE]); + S2_L[TYPE]= max(0,S2_L[TYPE]+P1_L[TYPE]+CR2_L[TYPE]- + (P2_L[TYPE]+Q2_L[TYPE]+CR1_L[TYPE]+T2_a[TYPE])); + P1_L[TYPE]= P1_L[TYPE]-max(0,S2_L[TYPE]-SC2[TYPE]); #* + S1_L[TYPE]= max(0,S1_L[TYPE]+P0_L[TYPE]+CR1_L[TYPE]- + (P1_L[TYPE]+T1_a[TYPE]+ES_a[TYPE])); #* + S2_L[TYPE]= min(S2_L[TYPE],SC2[TYPE]); + Q1_L[TYPE]= Q1_L[TYPE]+max(0,S1_L[TYPE]-SC1[TYPE]); + S1_L[TYPE]= min(S1_L[TYPE],SC1[TYPE]); + #-total actual evapotranspiration + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]+T1_a[TYPE]+T2_a[TYPE]; + + #-update volumetric moisture content (m3/m3) + # THETA1_L : volumetric moisture content in the first soil layer (m3/m3) + # THETA2_L : volumetric moisture content in the second soil layer (m3/m3) + # THETAS_L : volumetric moisture content in the total soil layer (m3/m3) + # W : total water content in the soil layer (m) + THETA1_L[TYPE]= THETARES1[TYPE]+(THETASAT1[TYPE]-THETARES1[TYPE])*max(0,S1_L[TYPE]/SC1[TYPE]); + THETA2_L[TYPE]= THETARES1[TYPE]+(THETASAT1[TYPE]-THETARES1[TYPE])*max(0,S2_L[TYPE]/SC2[TYPE]); + THETAS_L[TYPE]= (Z1[TYPE]*THETA1_L[TYPE]+Z2[TYPE]*THETA2_L[TYPE])/max(0.001,Z1[TYPE]+Z2[TYPE]); + W[TYPE]= max(0,S1_L[TYPE]+S2_L[TYPE]); + + #-adding local fluxes and states relative to vegetation fractions + # as a function of RTN to correct for vegetation presence + PRPTOT= PRPTOT+VEGFRAC[TYPE]*PRP_L[TYPE]; + TAVG= TAVG+VEGFRAC[TYPE]*TA_L[TYPE]; + EPOT= EPOT+VEGFRAC[TYPE]*ET_p[TYPE]; + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + EACT= EACT+VEGFRAC[TYPE]*EACT_L[TYPE]; + ESPOT= ESPOT+VEGFRAC[TYPE]*ES_p[TYPE]; + ESACT= ESACT+VEGFRAC[TYPE]*ES_a[TYPE]; + T1POT= T1POT+VEGFRAC[TYPE]*T1_p[TYPE]; + T1ACT= T1ACT+VEGFRAC[TYPE]*T1_a[TYPE]; + T2POT= T2POT+VEGFRAC[TYPE]*T2_p[TYPE]; + T2ACT= T2ACT+VEGFRAC[TYPE]*T2_a[TYPE]; + TPOT= T1POT+T2POT; + TACT= T1ACT+T2ACT; + SATFRAC= SATFRAC+VEGFRAC[TYPE]*SATFRAC_L[TYPE]; + WACT= WACT+VEGFRAC[TYPE]*WACT_L; + THETA1= THETA1+VEGFRAC[TYPE]*THETA1_L[TYPE]; + THETA2= THETA2+VEGFRAC[TYPE]*THETA2_L[TYPE]; + THETAS= THETAS+VEGFRAC[TYPE]*THETAS_L[TYPE]; + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + SS= SS+VEGFRAC[TYPE]*W[TYPE]; + P0= P0+VEGFRAC[TYPE]*P0_L[TYPE]; + P1= P1+VEGFRAC[TYPE]*P1_L[TYPE]; + P2= P2+VEGFRAC[TYPE]*P2_L[TYPE]; + CR1= CR1+VEGFRAC[TYPE]*CR1_L[TYPE]; + CR2= CR2+VEGFRAC[TYPE]*CR2_L[TYPE]; + Q1= Q1+VEGFRAC[TYPE]*Q1_L[TYPE]; + Q1S= Q1S+VEGFRAC[TYPE]*Q1S_L[TYPE]; + Q2= Q2+VEGFRAC[TYPE]*Q2_L[TYPE]; + + #-report values per land cover type + #-initial and possible output + report (rep2) SC_L[TYPE]= SC_L[TYPE]; + report (rep2) SCF_L[TYPE]= SCF_L[TYPE]; + report (rep2) INTS_L[TYPE]= INTS_L[TYPE]; + report (rep2) S1_L[TYPE]= S1_L[TYPE]; + report (rep2) S2_L[TYPE]= S2_L[TYPE]; + #-possible output only + report (rep2) PRP_L[TYPE]= PRP_L[TYPE]; + report (rep2) TA_L[TYPE]= TA_L[TYPE]; + report (rep2) ET_p[TYPE]= ET_p[TYPE]; + report (rep2) THETA1_L[TYPE]= THETA1_L[TYPE]; + report (rep2) THETA2_L[TYPE]= THETA2_L[TYPE]; + report (rep2) THETAS_L[TYPE]= THETAS_L[TYPE]; + report (rep2) W[TYPE]= W[TYPE]; + report (rep2) SATFRAC_L[TYPE]= SATFRAC_L[TYPE]; + report (rep2) ES_p[TYPE]= ES_p[TYPE]; + report (rep2) ES_a[TYPE]= ES_a[TYPE]; + report (rep2) T1_p[TYPE]= T1_p[TYPE]; + report (rep2) T1_a[TYPE]= T1_a[TYPE]; + report (rep2) T2_p[TYPE]= T2_p[TYPE]; + report (rep2) T2_a[TYPE]= T2_a[TYPE]; + report (rep2) T_p[TYPE]= T_p[TYPE]; + report (rep2) T_a[TYPE]= T_a[TYPE]; + report (rep2) P0_L[TYPE]= P0_L[TYPE]; + report (rep2) P1_L[TYPE]= P1_L[TYPE]; + report (rep2) P2_L[TYPE]= P2_L[TYPE]; + report (rep2) CR1_L[TYPE]= CR1_L[TYPE]; + report (rep2) CR2_L[TYPE]= CR2_L[TYPE]; + report (rep2) Q1_L[TYPE]= Q1_L[TYPE]; + report (rep2) Q2_L[TYPE]= Q2_L[TYPE]; + + }#-end of land cover type loop + +#-------------------------- +#Overall fluxes third store +#-------------------------- +#Third reservoir +#R3 (m): groundwater recharge +#S3 (m): storage in third store, updated with current fluxes +#Q3 (m): discharge from third reservoir, based on storage previous timestep + R3= P2-CR2; + S3= max(0,S3+P2-CR2); + Q3= min(S3,KQ3*S3*Duration*timeslice()); + S3= max(0,S3-Q3); + +#-------------------- +# Fresh water surface +#-------------------- +# EWAT (m): potential evapotranspiration imposed on water surface +# QWAT (m): local change in storage of fresh water surface (can be negative) + EWAT= timeinputsparse(KC_WATSTACK)*EVAP; + QWAT= if(LANDMASK,PRPTOT-EWAT); + +#----------------------------- +#Channel storage and discharge +#----------------------------- +#QLOC (m): local discharge +#QCHANNEL (m3.s-1): channel discharge +#QAVG (m3.s-1): channel discharge, averaged per year + QLOC= Q1+Q2+Q3; + QCHANNEL= max(0,catchmenttotal(((1-FRACWAT)*QLOC+FRACWAT*QWAT)*CELLAREA,LDD)/(3600*24*Duration*timeslice())); + QCUM= QCUM+QCHANNEL; + QAVG= QCUM/time(); + +#------------ +#Budget check +#------------ +#PTOT (m): total accumulated precipitation +#ETOT (m): total accumulated evapotranspiration +#QTOT (m): total accumulated local discharge +#INTOT, OUTTOT (km3): total incoming and outgoing water volumes per catchment +#SLOC, SLOCINI (m): local storage at any timestep and initially +#STOT_ACT (km3) total active storage (e.g, excluding snow cover) to decide whether equilibrium has been +# achieved (also included STOT_AVG, average total storage in (m) for soil, +# which excludes snow accumulation) +#MBE (m): local mass balance error +#MBR (-): total mass balance error per catchment, relative to total input + PTOT= PTOT+PRPTOT; + ETOT= ETOT+(FRACWAT*EWAT+(1-FRACWAT)*EACT); + QTOT= QTOT+((1-FRACWAT)*QLOC+FRACWAT*QWAT); + SLOC= (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + MBE= PTOT+SLOCINI-(ETOT+QTOT+SLOC); + STOT_ACT= if(LANDMASK,1E-9,1E-9)*maptotal((1-FRACWAT)*CELLAREA*(S1+S2+S3+INTS)); + INTOT= catchmenttotal(1E-9*CELLAREA*(SLOCINI+PTOT),LDD); + OUTTOT= catchmenttotal(1E-9*CELLAREA*(ETOT+QTOT+SLOC),LDD); + MBR= 1-if(INTOT>0,(INTOT-OUTTOT)/INTOT,0); + +#------------------------ +# Reports: overall values +#------------------------ +#-Meteo + report (rep2) PRPTOT= PRPTOT; + report (rep2) EPOT= EPOT; + report (rep2) TAVG= TAVG; +#-states: snow pack + report (rep2) SC= SC; + report (rep2) SCF= SCF; +#-states: soil moisture and saturated area + report (rep2) S1= S1; + report (rep2) S2= S2; + report (rep2) SS= SS; + report (rep2) THETA1= THETA1; + report (rep2) THETA2= THETA2; + report (rep2) THETAS= THETAS; + report (rep2) SATFRAC= SATFRAC; +#-groundwater: storage, recharge and area influenced by capillary rise + report (rep2) S3= S3; + report (rep2) R3= R3; + report (rep2) CRFRAC= CRFRAC; +#-fluxes: evapotranspiration + report EWAT= EWAT; + report EACT= EACT; + report ESPOT= ESPOT; + report ESACT= ESACT; + report T1POT= T1POT; + report T2POT= T2POT; + report T1ACT= T1ACT; + report T2ACT= T2ACT; + report TPOT= TPOT; + report TACT= TACT; +#-fluxes: percolation and capillary rise + report (rep2) P0= P0; + report (rep2) P1= P1; + report (rep2) P2= P2; + report (rep2) CR1= CR1; + report (rep2) CR2= CR2; +#-runoff, discharge and surface water + report (rep2) Q1= Q1; + report (rep2) Q2= Q2; + report (rep2) Q3= Q3; + report (rep2) QLOC= QLOC; + report (rep2) QWAT= QWAT; + report (rep1) QAVG= QAVG; + +#-budget checks + report (rep1) MBE= MBE; + report (rep1) MBR= MBR; + +#-all output reported, end of file diff --git a/model/pcrglobwb_v1/rens_master/pcr-glob_waterbalance_v1.0.txt b/model/pcrglobwb_v1/rens_master/pcr-glob_waterbalance_v1.0.txt new file mode 100755 index 000000000..148af1fad --- /dev/null +++ b/model/pcrglobwb_v1/rens_master/pcr-glob_waterbalance_v1.0.txt @@ -0,0 +1,838 @@ +#PCRGLOB-WB: run oldcalc -f pcrglobwb_v1.1.txt 365 10 +#Rens van Beek, Dept. Physical Geography, Utrecht University, 9/11/2005 +#Basic water balance model, thus omitting routing and water temperature +#-with 2 surface covers (tall and short vegetation) and 3 layers of soil compartment +#-includes surface runoff and soil evaporation based on the improved Arno scheme +# of Hagemann and Gates (2003) +#-climate input based on CRU data downscaled with ERA-40 daily surface fields +#-change made to script regarding fractioning of soil evaporation and transpiration +# and reports on fraction of EACT over EPOT included on 20/08/2008 +# NOTE: WS... for reducing bare soil evaporation is obsolete as a result of changes +# Updates made to root fractions (evapotranspiration parameters dependent on relative +# root fractions RFW rather than on absolute fractions RFRAC) and CR2 limited to parameterized +# storage capacity of second layer rather than on porosity in root zone (17/11/2008) +# Capillary rise is restricted to the fractional area influenced by the groundwater, CRFRAC +# 20/04/2011: Soil moisture scheme has been changed to allow for full saturation of the soil layers +# by including percolation over the contact between the second to third layer to the infiltration; +# both percolation and capillary rise over the first and second layer has been made dependent on +# the square root of k(theta_eff) to include the effect of less pervious layers; +# to limit recursive drying and wetting of the first layer by percolation to and capillary rise from +# the second, drainage from the first layer is restricted to water in excess of field capacity +# under wet conditions (water in excess of field capacity) and capillary rise from the second to +# first layer is based on the gradient rather than on the difference in relative degree of saturation +# alone and is capped to maximum field capacity; see #* for comments on the changes +# Modification 28/06/2012: minor issue with precipitation partitioning following interception solved + + +binding + +#Maps & TSS - input +#-General + Duration= $2; #timestep in days + LANDMASK= $3; #clone map representing landmask of earth surface + CELLAREA= $4; #surface (m2) of cell covered by total land surface + +#-Surface water + LDD= $5; #local drainage direction map + FRACWAT= $6; #fraction of cell area covered by fresh water [m2/m2] + KC_WATSTACK= $7; #composite crop factor for channels and wetlands or lakes + +#-Groundwater + KQ3= $8; #recession coefficient for store 3 (day-1): drainage + SPECYIELD3= $9; #specific yield for aquifer + DZS3INFLUENCED= $10; #additional zone influenced by groundwater + DZREL0001= $91; #maps of relative elevation above floodplain, in percent + DZREL0005= $92; + DZREL0010= $93; + DZREL0020= $94; + DZREL0030= $95; + DZREL0040= $96; + DZREL0050= $97; + DZREL0060= $98; + DZREL0070= $99; + DZREL0080= $100; + DZREL0090= $101; + DZREL0100= $102; + +#-Meteo +#-Precipitation [m/day], conversion constant and factor + PRPSTACK= $11; # input value + PRPCONSTANT= $12; # conversion constant, to get values as required + PRPFACTOR= $13; # conversion factor, to get values as required +#-Precipitation anomaly, multiplicative + PRPANOSTACK= $14; # input value + PRPANOCONSTANT= $15; # conversion constant, to get values as required + PRPANOFACTOR= $16; # conversion factor, to get values as required +#-Temperature [degC], conversion constant and factor + TASTACK= $17; + TACONSTANT= $18; + TAFACTOR= $19; +#-Temperature anomaly , additive + TAANOSTACK= $20; + TAANOCONSTANT= $21; + TAANOFACTOR= $22; +#-Reference potential evapotranspiration [m/day], conversion constant and factor + EVAPSTACK= $23; + EVAPCONSTANT= $24; + EVAPFACTOR= $25; +#-Reference potential evapotranspiration anomaly, multiplicative + EVAPANOSTACK= $26; + EVAPANOCONSTANT= $27; + EVAPANOFACTOR= $28; + +#-Vegetation parameters per cover type, interception and fractions read in per type (maximum 10 values) + COVERTYPE= [ + $31= $41, + $32= $42]; #array of cover type, e.g.: 1) short, 2) tall +#-fractional vegetation cover (m2/m2), interception storage (m per unit area) +# and crop factor per vegetation type + CFSTACK_01= $51; #-cover fraction + CFSTACK_02= $52; + CFSTACK_03= $53; + CFSTACK_04= $54; + CFSTACK_05= $55; + CFSTACK_06= $56; + CFSTACK_07= $57; + CFSTACK_08= $58; + CFSTACK_09= $59; + CFSTACK_10= $60; + SMAXSTACK_01= $61; #-interception, maximum canopy storage + SMAXSTACK_02= $62; + SMAXSTACK_03= $63; + SMAXSTACK_04= $64; + SMAXSTACK_05= $65; + SMAXSTACK_06= $66; + SMAXSTACK_07= $67; + SMAXSTACK_08= $68; + SMAXSTACK_09= $69; + SMAXSTACK_10= $70; + KCSTACK_01= $71; #-crop factor + KCSTACK_02= $72; + KCSTACK_03= $73; + KCSTACK_04= $74; + KCSTACK_05= $75; + KCSTACK_06= $76; + KCSTACK_07= $77; + KCSTACK_08= $78; + KCSTACK_09= $79; + KCSTACK_10= $80; +#-table with parameterization per cover type; all variables read as maps + COVERTABLE= $81; #table with parameterization per cover type +#-parameter values: vegetation fraction + VEGFRAC[COVERTYPE]= index(COVERTABLE); #subdivision in cover type +#-parameter values: snow module + TT[COVERTYPE]= index(COVERTABLE); #threshold temperature for freezing/thawing (?C) + CFMAX[COVERTYPE]= index(COVERTABLE); #degree-day factor (m??C-1?d-1) was: 0.0055 + SFCF[COVERTYPE]= index(COVERTABLE); #snowfall correction factor (-) + CWH[COVERTYPE]= index(COVERTABLE); #water holding capacity snow cover (-) + CFR[COVERTYPE]= index(COVERTABLE); #refreezing coefficient (-) +#-topographical parameters per cover type + LSLOPE[COVERTYPE]= index(COVERTABLE); #slope length (m) + TANSLOPE[COVERTYPE]= index(COVERTABLE); #gradient of slope (m/m) +#-soil parameters per cover type + PSI_FC[COVERTYPE]= index(COVERTABLE); #matric suction at field capacity (m) + PSI_50[COVERTYPE]= index(COVERTABLE); #matric suction at which transpiration is halved (m) + BCH_FACTOR[COVERTYPE]= index(COVERTABLE); #factor for kr-relationship of Clapp & Hornberger (1978; default 2) + BCH_ADD[COVERTYPE]= index(COVERTABLE); #addition for kr-relationship of Clapp & Hornberger (1978; default 3) + BCF[COVERTYPE]= index(COVERTABLE); #beta coefficient of the improved Arno scheme + MINFRAC[COVERTYPE]= index(COVERTABLE); #ratio of min soil depth over average soil depth + #MAXFRAC[COVERTYPE]= index(COVERTABLE); #ratio of max soil depth over average soil depth + P2_IMP[COVERTYPE]= index(COVERTABLE); #fractional area where percolation to groundwater store is impeded +#-soil parameters per cover type, constants and layer (i) + THETASAT1[COVERTYPE]= index(COVERTABLE); #saturated volumetric moisture content (m3.m-3) + THETASAT2[COVERTYPE]= index(COVERTABLE); #first and second layer + THETARES1[COVERTYPE]= index(COVERTABLE); #residual volumetric moisture content (m3.m-3) + THETARES2[COVERTYPE]= index(COVERTABLE); #first and second layer + KS1[COVERTYPE]= index(COVERTABLE); #saturated hydraulic conductivity (m.day-1) + KS2[COVERTYPE]= index(COVERTABLE); #first and second layer + PSI_A1[COVERTYPE]= index(COVERTABLE); #air entry value (m) according to SWRC of Clapp & Hornberger (1978) + PSI_A2[COVERTYPE]= index(COVERTABLE); #first and second layer + BCH1[COVERTYPE]= index(COVERTABLE); #pore size distribution parameter according to Clapp and Hornberger (1978) + BCH2[COVERTYPE]= index(COVERTABLE); #first and second layer + Z1[COVERTYPE]= index(COVERTABLE); #depth of first store + Z2[COVERTYPE]= index(COVERTABLE); #depth of second store + RFRAC1[COVERTYPE]= index(COVERTABLE); #root fraction per soil layer + RFRAC2[COVERTYPE]= index(COVERTABLE); #first and second layer +#-vegetation parameters per crop type + KCMIN[COVERTYPE]= index(COVERTABLE); #used to separate soil evaporation from transpiration +#Initial storages for local variables, cell averages reported by default + SC_INI[COVERTYPE]= index(COVERTABLE); #initial snow cover (m) + SCF_INI[COVERTYPE]= index(COVERTABLE); #initial liquid water stored in snow cover (m) + INTS_INI[COVERTYPE]= index(COVERTABLE); #initial interception storage (m) + S1_INI[COVERTYPE]= index(COVERTABLE); #initial storage in upper store (m) + S2_INI[COVERTYPE]= index(COVERTABLE); #initial storage in second store (m) + Q2_INI[COVERTYPE]= index(COVERTABLE); #initial drainage from second store (m) +#Initial storages for local variables, cell averages reported by default + S3_INI= $82; #initial storage in lower store (m) + +#Output: only maps are reported +#-representative for land cover dependent variables: note cover type is not needed to report local fluxes! +#-initial values + SC_L= $89\sc; #snow cover (m) + SCF_L= $89\scf; #liquid water stored in snow cover (m) + INTS_L= $89\ints; #interception storage (m) + Q2_L= $89\q2; #runoff from second store (flow) (m) + S1_L= $89\s1; #storage in upper store (m) + S2_L= $89\s2; #storage in second store (m) +#-optional output: see matches below for cell-based values + PRP_L= $89\prec; + TA_L= $89\temp; + ET_p= $89\epot; + THETA1_L= $89\th1; + THETA2_L= $89\th2; + THETAS_L= $89\ths; + W= $89\stors; + SATFRAC_L= $89\satf; + EACT_L= $89\eact; + ES_p= $89\espot; + ES_a= $89\esact; + T1_p= $89\t1pot; + T1_a= $89\t1act; + T2_p= $89\t2pot; + T2_a= $89\t2act; + T_p= $89\tpot; + T_a= $89\tact; + P0_L= $89\p0; + P1_L= $89\p1; + P2_L= $89\p2; + Q1_L= $89\q1; + CR1_L= $89\cr1; + CR2_L= $89\cr2; + +#-representative for total cell: meteo + PRPTOT= $89\prec; #total precipitiation (m/day) + TAVG= $89\temp; #average air temperature (degC) + EPOT= $89\epot; #total potential evapotranspiration (m) +#-representative for total cell: states + SC= $89\snowcov; #snow cover (m) + SCF= $89\snowliq; #liquid water stored in snow cover (m) + INTS= $89\intstor; #interception storage (m) + THETA1= $89\theta1x; #volumetric moisture content in the first soil (m3/m3) + THETA2= $89\theta2x; #volumetric moisture content in the second soil (m3/m3) + THETAS= $89\theta; #volumetric moisture content in soil column (m3/m3) + S1= $89\stor1x; #water storage in upper store (m) + S2= $89\stor2x; #water storage in second store (m) + SS= $89\stors; #total water storage in soil (m) + SATFRAC= $89\satf; #fraction saturated area (-) + CRFRAC= $89\crfrac; #fraction of soil surface influenced by capillary rise +#-representative for total cell: fluxes + EWAT= $89\ewat; #potential evaporation over open water + EACT= $89\eact; #actual evapotranspiration (m) + ESPOT= $89\espot; #potential soil evaporation (m) + ESACT= $89\esact; #actual soil evaporation (m) + T1POT= $89\t1pot; #potential transpiration drawn from first soil layer (m) + T1ACT= $89\t1act; #idem, actual + T2POT= $89\t2pot; #potential transpiration drawn from second soil layer (m) + T2ACT= $89\t2act; #idem, actual + TPOT= $89\tpot; #potential transpiration drawn from total soil layer (m) + TACT= $89\tact; #idem, actual + P0= $89\p0x; #infiltration to first layer (m/day) + P1= $89\p1x; #percolation from first layer (m/day) + P2= $89\p2x; #percolation from second layer (m/day) + CR1= $89\cr1x; #capillary rise to first layer (m/day) + CR2= $89\cr2x; #capilary rise to second layer (m/day) + Q1= $89\q1x; #direct runoff (m) + Q2= $89\q2x; #runoff from second store (flow) (m) + Q3= $89\q3x; #runoff from lower store (base flow) (m) + QLOC= $89\qloc; #specific runoff (m) + R3= $89\r3x; #recharge to third store + S3= $89\stor3x; #storage in lower store (m) + QWAT= $89\qwat; #change in storage of freshwater surface + QAVG= $89\qaverage.map;#channel discharge - annual average (m/s) +#budget check + MBE= $89\mbe.map; #absolute local mass balance error (m) + MBR= $89\mbcheck.map; #relative, local mass balance error (-) + +areamap + LANDMASK; + +timer + 1 $1 1; + rep1= endtime; #times to report TSS and initial maps + rep2= 1+1..endtime; #times to report soil states and fluxes + + +initial + +#Patching LDD + LDD= if(LANDMASK,cover(LDD,5)); + +#Initialization, dependent on COVERTYPE +#Initial storages + SC= scalar(0); + SCF= scalar(0); + INTS= scalar(0); + S1= scalar(0); + S2= scalar(0); + S3= S3_INI; + + foreach TYPE in COVERTYPE{ + #Initial storages + #-states and fluxes per vegetation type + SC_L[TYPE]= SC_INI[TYPE]; #initial snow cover (m) + SCF_L[TYPE]= SCF_INI[TYPE]; #initial liquid water stored in snow cover (m) + INTS_L[TYPE]= INTS_INI[TYPE]; #initial interception storage (m) + S1_L[TYPE]= S1_INI[TYPE]; #initial storage in upper store (m) + S2_L[TYPE]= S2_INI[TYPE]; #initial storage in second store (m) + Q2_L[TYPE]= Q2_INI[TYPE]; #initial drainage from second store (m) + #-total storages + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + + #-soil parameters + BCB1[TYPE]= BCH_FACTOR[TYPE]*BCH1[TYPE]+BCH_ADD[TYPE]; #Campbell's (1974) coefficient to calculate the relative, + BCB2[TYPE]= BCH_FACTOR[TYPE]*BCH2[TYPE]+BCH_ADD[TYPE]; #unsaturated hydraulic conductivity + #degree of saturation at field capacity for first and second layer + #and corresponding unstaturated hydraulic conductivity + THEFF1_FC[TYPE]= (PSI_FC[TYPE]/PSI_A1[TYPE])**(-1/BCH1[TYPE]); + KTHEFF1_FC[TYPE]= max(0,THEFF1_FC[TYPE]**BCB1[TYPE]*KS1[TYPE]); + THEFF2_FC[TYPE]= (PSI_FC[TYPE]/PSI_A2[TYPE])**(-1/BCH2[TYPE]); + KTHEFF2_FC[TYPE]= max(0,THEFF2_FC[TYPE]**BCB2[TYPE]*KS2[TYPE]); + #centroid-lag for constant drainable pore space (day), + #rewritten to fractions given the duration of one timestep + TCL[TYPE]= Duration*(2*KS2[TYPE]*TANSLOPE[TYPE])/(LSLOPE[TYPE]*(1-THEFF2_FC[TYPE])*(THETASAT2[TYPE]-THETARES2[TYPE])); + #-storage parameters related to Improved Arno Scheme + #-total active water storage capacity over first and second layer and total soil profile (m) + SC1[TYPE]= Z1[TYPE]*(THETASAT1[TYPE]-THETARES1[TYPE]); + SC2[TYPE]= Z2[TYPE]*(THETASAT2[TYPE]-THETARES2[TYPE]); + WMAX[TYPE]= SC1[TYPE]+SC2[TYPE]; + # storage in top soil limiting bare soil evapotranspiration + WSMAX[TYPE]= SC1[TYPE]; + #minimum storage capacity set to fraction of mean total + WMIN[TYPE]= MINFRAC[TYPE]*WMAX[TYPE]; + WSMIN[TYPE]= MINFRAC[TYPE]*WSMAX[TYPE]; + #range in storage capacity + WRANGE[TYPE]= WMAX[TYPE]-WMIN[TYPE]; + WSRANGE[TYPE]= WSMAX[TYPE]-WSMIN[TYPE]; + #weighed root fractions + RFW1[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0, + min(1.0,RFRAC1[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + RFW2[TYPE]= if(RFRAC1[TYPE]+RFRAC2[TYPE] > 0.0, + min(1.0,RFRAC2[TYPE]/(RFRAC1[TYPE]+RFRAC2[TYPE])),0.0); + #average degree of saturation at which actual transpiration is halved + THEFF_50[TYPE]= if(RFW1[TYPE]+RFW2[TYPE] > 0, + (SC1[TYPE]*RFW1[TYPE]*(PSI_50[TYPE]/PSI_A1[TYPE])**(-1/BCH1[TYPE])+ + SC2[TYPE]*RFW2[TYPE]*(PSI_50[TYPE]/PSI_A2[TYPE])**(-1/BCH2[TYPE]))/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5); + BCH_50[TYPE]= if(RFW1[TYPE]+RFW2[TYPE] > 0,(SC1[TYPE]*RFW1[TYPE]*BCH1[TYPE]+SC2[TYPE]*RFW2[TYPE]*BCH2[TYPE])/ + (SC1[TYPE]*RFW1[TYPE]+SC2[TYPE]*RFW2[TYPE]),0.5*(BCH1[TYPE]+BCH2[TYPE])); +} + +#-cumulative fluxes for average discharge and budget check + QCUM= scalar(0); + STOT_CUM= scalar(0); + SLOCINI= (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + PTOT= scalar(0); + ETOT= scalar(0); + QTOT= scalar(0); + +dynamic +#---------------- +# Meteo +#---------------- +#Meteorological input as total/average per time step +# PRPORG (m): total precipitation from original forcing +# TA (?C): average temperature +# EVAP (m): reference potential evapotranspiration + PRPORG= PRPCONSTANT+PRPFACTOR* + timeinput(PRPSTACK); + PRPANO= PRPANOCONSTANT+PRPANOFACTOR* + timeinputsparse(PRPANOSTACK); + PRPORG= max(0.,PRPANO*PRPORG)*Duration*timeslice(); + TA= TACONSTANT+TAFACTOR*timeinput(TASTACK); + TAANO= TAANOCONSTANT+TAANOFACTOR* + timeinputsparse(TAANOSTACK); + TA= TAANO+TA; + EVAP= EVAPCONSTANT+EVAPFACTOR* + timeinput(EVAPSTACK); + EVAPANO= EVAPANOCONSTANT+EVAPANOFACTOR* + timeinputsparse(EVAPANOSTACK); + EVAP= max(0.,EVAPANO*EVAP)*Duration*timeslice(); + +#---------------- +# Land surface +#---------------- +#Current approximate height of groundwater table and corresponding reach of cell under +# influence of capillary rise + DZS3= S3/SPECYIELD3+DZS3INFLUENCED; + CRFRAC= min(1.0,1.0-(DZREL0100-DZS3)*0.1/max(1e-3,DZREL0100-DZREL0090)); + CRFRAC= if(DZS30,PTF_L/PRP_L[TYPE],0)); #** + PTF_L= max(0,PTF_L-SNOW_L); #** + EACT_L[TYPE]= min(INTS_L[TYPE],(T_p[TYPE]*if(ICC[TYPE]>0,INTS_L[TYPE]/ICC[TYPE],0)**(2/3))); + INTS_L[TYPE]= INTS_L[TYPE]-EACT_L[TYPE]; + T_p[TYPE]= max(0,T_p[TYPE]-EACT_L[TYPE]); + + #-Snow accumulation and melt + #SC (m): snow cover + #SCF (m): free water stored in snow cover + #DSC (m): change in snow cover, - melt, + gain in snow or refreezing (CFR) + #Pn (m): net liquid water transferred to soil + #DSCR (m): relative contribution of snow melt to net liquid water transfer + #ES_a (m): actual bare soil evaporation, + # here used to subtract any evaporation from liquid phase of snow cover + DSC[TYPE]= if(TA_L[TYPE]<=TT[TYPE],CFR[TYPE]*SCF_L[TYPE],-min(SC_L[TYPE],max(TA_L[TYPE]-TT[TYPE],0)*CFMAX[TYPE]*Duration*timeslice())); + SC_L[TYPE]= SC_L[TYPE]+DSC[TYPE]+SNOW_L; + SCF_L[TYPE]= SCF_L[TYPE]-DSC[TYPE]+PTF_L; + Pn= max(0,SCF_L[TYPE]-CWH[TYPE]*SC_L[TYPE]); + DSCR= if(Pn>0,max(-DSC[TYPE],0)/Pn,0); + SCF_L[TYPE]= max(0,SCF_L[TYPE]-Pn); + ES_a[TYPE]= min(SCF_L[TYPE],ES_p[TYPE]); + SCF_L[TYPE]= SCF_L[TYPE]-ES_a[TYPE]; + ES_p[TYPE]= max(0,ES_p[TYPE]-ES_a[TYPE]); + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]; + + #-Direct runoff and infiltration based on improved Arno scheme + # partial runoff when not entirely saturated (condition 1), else complete saturation excess + #BCF (-): b coefficient of soil water storage capacity distribution + #WMIN, WMAX (m): root zone water storage capacity, area-averaged values + #W (m): actual water storage in root zone + #WRANGE, DW, + #WFRAC (m): computation steps to ease runoff calculation, resp. + # (WMAX-WMIN), (WMAX-W) and DW/WRANGE + # WFRAC capped at 1 + #WFRACB (nd): DW/WRANGE raised to the power (1/(b+1)) + #SATFRAC (-): fractional saturated area + #WACT (m): actual water storage within rootzone + #THEFF(i) (-): effective degree of saturation + # + #-Saturated and unsaturated hydraulic conductivity, matric suction and gradient + #*PSI(i) (m): matric suction in layer(i) + #*GRAD (-): gradient for capillary rise + #KS(i) (m/d): saturated hydraulic conductivity + #KTHEFF(i) (m/d): unsaturated hydraulic conductivity + #*KTHVERT (m/d): idem, exchange between layers, capped at field capacity + #BCH(i) (-): pore size distribution factor of Clapp and Hornberger (1978) + #BCB(i) (-): Campbell's (1974) coefficient to calculate the relative, + # unsaturated hydraulic conductivity + #Pn (m): net liquid precipitation, reduced if WMIN not exceeded + #Q1 (m): direct or surface runoff + #Q1S (-): direct or surface runoff directly attributable to snow melt + #P0 (m): infiltration + #P(i) (m): percolation from layer(i) to layer(i+1) + #* + #* Note that here the scaling of the unsaturated hydraulic conductivity by that at field capacity + #* has been placed which earlier was included in the section where the soil hydrological fluxes (percolation) + #* were calculated. In order to allow for full saturation, the percolation from the second to the third + #* layer is already calculated here and added to the infiltration. + #* To ensure that scaling of k(thetaeff) by that value at field capacity for percolation and capillary rise of the first + #* layer does not affect the other results, the additional variable k(thetaeff) in the vertical direction over + #* the two soil layers is introduced. The capillary rise into this layer is no longer dependent on moisture but + #* primarily on the gradient. To this end, the new variables PSI(i), GRAD are introduced. + #* + THEFF1_L= max(0,S1_L[TYPE]/SC1[TYPE]); + THEFF2_L= max(0,S2_L[TYPE]/SC2[TYPE]); + PSI1= PSI_A1[TYPE]*max(0.01,THEFF1_L)**-BCH1[TYPE]; #* + PSI2= PSI_A2[TYPE]*max(0.01,THEFF2_L)**-BCH2[TYPE]; #* + GRAD= max(0,2*(PSI1-PSI2)/(Z1[TYPE]+Z2[TYPE])-1); #* + KTHEFF1= max(0,THEFF1_L**BCB1[TYPE]*KS1[TYPE]); + KTHEFF2= max(0,THEFF2_L**BCB2[TYPE]*KS2[TYPE]); + KTHVERT= min(sqrt(KTHEFF1*KTHEFF2), + (KTHEFF1*KTHEFF2*KTHEFF1_FC[TYPE]*KTHEFF2_FC[TYPE])**0.25); #* + P2_L[TYPE]= min(KTHEFF2,sqrt(KTHEFF2*KTHEFF2_FC[TYPE]))*Duration*timeslice(); #* + W[TYPE]= max(0,S1_L[TYPE]+S2_L[TYPE]); + P0_L[TYPE]= Pn; + Pn= W[TYPE]+Pn; + Pn= Pn-max(WMIN[TYPE],W[TYPE]); + W[TYPE]= if(Pn<0,WMIN[TYPE]+Pn,max(W[TYPE],WMIN[TYPE])); + Pn= max(0,Pn); + DW= max(0,WMAX[TYPE]-W[TYPE]); + WFRAC= min(1,DW/WRANGE[TYPE]); + WFRACB= WFRAC**(1/(1+BCF[TYPE])); + SATFRAC_L[TYPE]= if(WFRACB>0,1-WFRACB**BCF[TYPE],1.0); + WACT_L= (BCF[TYPE]+1)*WMAX[TYPE]-BCF[TYPE]*WMIN[TYPE]-(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB; + Q1_L[TYPE]= max(0,Pn-(WMAX[TYPE]+P2_L[TYPE]-W[TYPE])+ + if(Pn>=(BCF[TYPE]+1)*WRANGE[TYPE]*WFRACB, 0, + WRANGE[TYPE]*(WFRACB-Pn/((BCF[TYPE]+1)*WRANGE[TYPE]))**(BCF[TYPE]+1))); #* + Q1S_L[TYPE]= min(1,DSCR)*Q1_L[TYPE]; + P0_L[TYPE]= P0_L[TYPE]-Q1_L[TYPE]; + + #-Actual bare soil evaporation and transpiration based on the remainder of the potential + # and limited to the available moisture content; top soil for ES, entire root zone for T + #RFW(i) (-): root fraction per layer, corrected to 100% + #WF(i) (-): weighing factor for fractioning transpiration per layer, + # based on total available moisture storage in soil, or else RFW + #ES_p (m): potential bare soil evaporation + #ES_a (m): actual bare soil evaporation + #T_p(i) (m): potential transpiration per layer + #T_a(i) (m): actual transpiration per layer + #FRACTA (-): fraction of actual over potential transpiration + WF1= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW1[TYPE]*S1_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW1[TYPE]); + WF2= if((S1_L[TYPE]+S2_L[TYPE])>0,RFW2[TYPE]*S2_L[TYPE]/ + max(1e-9,RFW1[TYPE]*S1_L[TYPE]+RFW2[TYPE]*S2_L[TYPE]),RFW2[TYPE]); + FRACTA[TYPE]= (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-(1+BCF[TYPE])/BCF[TYPE]*WFRACB))/ + (WMAX[TYPE]+BCF[TYPE]*WRANGE[TYPE]*(1-WFRACB)); + FRACTA[TYPE]= (1-SATFRAC_L[TYPE])/(1+(max(0.01,FRACTA[TYPE])/THEFF_50[TYPE])**(-3*BCH_50[TYPE])); + T1_p[TYPE]= WF1*T_p[TYPE]; + T2_p[TYPE]= max(0,T_p[TYPE]-T1_p[TYPE]); + T1_a[TYPE]= FRACTA[TYPE]*T1_p[TYPE]; + T2_a[TYPE]= FRACTA[TYPE]*T2_p[TYPE]; + T_a[TYPE]= T1_a[TYPE]+T2_a[TYPE]; + #-actual bare soil evaporation + ES_a[TYPE]= SATFRAC_L[TYPE]*min(ES_p[TYPE],KS1[TYPE]*Duration*timeslice())+ + (1-SATFRAC_L[TYPE])*min(ES_p[TYPE],KTHEFF1*Duration*timeslice()); + + #-Percolation, subsurface storm flow and capillary rise + #P(i) (m): percolation from layer(i) to layer(i+1) + #CR(i) (m): capillary rise into layer(i) #* + #Q2 (m): lateral drainage from second store: + # dependent on net recharge to saturated wedge + # and centroid lag (Sloan and Moore, 1984) + # simplified by considering drainable pore space only + #RQ2 (m): recharge adding to or drawing from saturated wedge + #-fluxes + #* + #* Note that here the sequence of calculation has been reversed. First, the direct runoff + #* and the infiltration are modified by the amount of infiltration that is in excess of + #* the infiltration capacity. Next, the percolation from the first into the second layer is + #* computed as the flux due to the vertical unsaturated hydraulic conductivity over the two layers + #* this flux can only drain the layer to field capacity when the latyer is wet; infiltration in + #* excess to the storage capacity of layer 1 is passed on to the second layer. If the second layer + #* becomes saturated, the excess water is passed back to the first layer by means of the percolation + #* which may become negative in extreme cases (gain in storage in layer 1 due to return flow). + #* This was already included in the model but the return flow not assigned to a particular flux. + #* The capillary rise from the second to the first layer has been modified to consider the + #* gradient and the vertical unsaturated hydraulic conductivity. + #* + Q1_L[TYPE]= Q1_L[TYPE]+max(0,P0_L[TYPE]-KS1[TYPE]*Duration*timeslice()); + P0_L[TYPE]= min(P0_L[TYPE],KS1[TYPE]*Duration*timeslice()); + P1_L[TYPE]= KTHVERT*Duration*timeslice(); #* + P1_L[TYPE]= if(THEFF1_L > THEFF1_FC[TYPE],min(max(0,THEFF1_L-THEFF1_FC[TYPE])*SC1[TYPE], + P1_L[TYPE]),P1_L[TYPE])+max(0,P0_L[TYPE]-(SC1[TYPE]-S1_L[TYPE])); #* + CR1_L[TYPE]= min(max(0,THEFF1_FC[TYPE]-THEFF1_L)*SC1[TYPE], + KTHVERT*GRAD*Duration*timeslice()); #* + CR2_L[TYPE]= 0.5*(SATFRAC_L[TYPE]+CRFRAC)*min((1-THEFF2_L)*sqrt(KS2[TYPE]*KTHEFF2)*Duration*timeslice(), + max(0,THEFF2_FC[TYPE]-THEFF2_L)*SC2[TYPE]); + RQ2= P2_IMP[TYPE]*(P1_L[TYPE]+CR2_L[TYPE]-(P2_L[TYPE]+CR1_L[TYPE])); + Q2_L[TYPE]= max(TCL[TYPE]*RQ2+(1-TCL[TYPE])*Q2_L[TYPE],0); + #-water balance: scaled fluxes and new states + # first layer + ADJUST= ES_a[TYPE]+T1_a[TYPE]+P1_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,(max(0,S1_L[TYPE]+P0_L[TYPE]))/ADJUST),0); + ES_a[TYPE]= ADJUST*ES_a[TYPE]; + T1_a[TYPE]= ADJUST*T1_a[TYPE]; + P1_L[TYPE]= ADJUST*P1_L[TYPE]; + # second layer + ADJUST= T2_a[TYPE]+P2_L[TYPE]+Q2_L[TYPE]; + ADJUST= if(ADJUST>0,min(1,max(S2_L[TYPE]+P1_L[TYPE],0)/ADJUST),0); + T2_a[TYPE]= ADJUST*T2_a[TYPE]; + P2_L[TYPE]= ADJUST*P2_L[TYPE]; + Q2_L[TYPE]= ADJUST*Q2_L[TYPE]; + CR2_L[TYPE]= min(VEGFRAC[TYPE]*S3,CR2_L[TYPE]); + CR1_L[TYPE]= min(max(0,S2_L[TYPE]+P1_L[TYPE]-(T2_a[TYPE]+P2_L[TYPE]+Q2_L[TYPE])),CR1_L[TYPE]); + S2_L[TYPE]= max(0,S2_L[TYPE]+P1_L[TYPE]+CR2_L[TYPE]- + (P2_L[TYPE]+Q2_L[TYPE]+CR1_L[TYPE]+T2_a[TYPE])); + P1_L[TYPE]= P1_L[TYPE]-max(0,S2_L[TYPE]-SC2[TYPE]); #* + S1_L[TYPE]= max(0,S1_L[TYPE]+P0_L[TYPE]+CR1_L[TYPE]- + (P1_L[TYPE]+T1_a[TYPE]+ES_a[TYPE])); #* + S2_L[TYPE]= min(S2_L[TYPE],SC2[TYPE]); + Q1_L[TYPE]= Q1_L[TYPE]+max(0,S1_L[TYPE]-SC1[TYPE]); + S1_L[TYPE]= min(S1_L[TYPE],SC1[TYPE]); + #-total actual evapotranspiration + EACT_L[TYPE]= EACT_L[TYPE]+ES_a[TYPE]+T1_a[TYPE]+T2_a[TYPE]; + + #-update volumetric moisture content (m3/m3) + # THETA1_L : volumetric moisture content in the first soil layer (m3/m3) + # THETA2_L : volumetric moisture content in the second soil layer (m3/m3) + # THETAS_L : volumetric moisture content in the total soil layer (m3/m3) + # W : total water content in the soil layer (m) + THETA1_L[TYPE]= THETARES1[TYPE]+(THETASAT1[TYPE]-THETARES1[TYPE])*max(0,S1_L[TYPE]/SC1[TYPE]); + THETA2_L[TYPE]= THETARES1[TYPE]+(THETASAT1[TYPE]-THETARES1[TYPE])*max(0,S2_L[TYPE]/SC2[TYPE]); + THETAS_L[TYPE]= (Z1[TYPE]*THETA1_L[TYPE]+Z2[TYPE]*THETA2_L[TYPE])/max(0.001,Z1[TYPE]+Z2[TYPE]); + W[TYPE]= max(0,S1_L[TYPE]+S2_L[TYPE]); + + #-adding local fluxes and states relative to vegetation fractions + # as a function of RTN to correct for vegetation presence + PRPTOT= PRPTOT+VEGFRAC[TYPE]*PRP_L[TYPE]; + TAVG= TAVG+VEGFRAC[TYPE]*TA_L[TYPE]; + EPOT= EPOT+VEGFRAC[TYPE]*ET_p[TYPE]; + SC= SC+VEGFRAC[TYPE]*SC_L[TYPE]; + SCF= SCF+VEGFRAC[TYPE]*SCF_L[TYPE]; + INTS= INTS+VEGFRAC[TYPE]*INTS_L[TYPE]; + EACT= EACT+VEGFRAC[TYPE]*EACT_L[TYPE]; + ESPOT= ESPOT+VEGFRAC[TYPE]*ES_p[TYPE]; + ESACT= ESACT+VEGFRAC[TYPE]*ES_a[TYPE]; + T1POT= T1POT+VEGFRAC[TYPE]*T1_p[TYPE]; + T1ACT= T1ACT+VEGFRAC[TYPE]*T1_a[TYPE]; + T2POT= T2POT+VEGFRAC[TYPE]*T2_p[TYPE]; + T2ACT= T2ACT+VEGFRAC[TYPE]*T2_a[TYPE]; + TPOT= T1POT+T2POT; + TACT= T1ACT+T2ACT; + SATFRAC= SATFRAC+VEGFRAC[TYPE]*SATFRAC_L[TYPE]; + WACT= WACT+VEGFRAC[TYPE]*WACT_L; + THETA1= THETA1+VEGFRAC[TYPE]*THETA1_L[TYPE]; + THETA2= THETA2+VEGFRAC[TYPE]*THETA2_L[TYPE]; + THETAS= THETAS+VEGFRAC[TYPE]*THETAS_L[TYPE]; + S1= S1+VEGFRAC[TYPE]*S1_L[TYPE]; + S2= S2+VEGFRAC[TYPE]*S2_L[TYPE]; + SS= SS+VEGFRAC[TYPE]*W[TYPE]; + P0= P0+VEGFRAC[TYPE]*P0_L[TYPE]; + P1= P1+VEGFRAC[TYPE]*P1_L[TYPE]; + P2= P2+VEGFRAC[TYPE]*P2_L[TYPE]; + CR1= CR1+VEGFRAC[TYPE]*CR1_L[TYPE]; + CR2= CR2+VEGFRAC[TYPE]*CR2_L[TYPE]; + Q1= Q1+VEGFRAC[TYPE]*Q1_L[TYPE]; + Q1S= Q1S+VEGFRAC[TYPE]*Q1S_L[TYPE]; + Q2= Q2+VEGFRAC[TYPE]*Q2_L[TYPE]; + + #-report values per land cover type + #-initial and possible output + report (rep2) SC_L[TYPE]= SC_L[TYPE]; + report (rep2) SCF_L[TYPE]= SCF_L[TYPE]; + report (rep2) INTS_L[TYPE]= INTS_L[TYPE]; + report (rep2) S1_L[TYPE]= S1_L[TYPE]; + report (rep2) S2_L[TYPE]= S2_L[TYPE]; + #-possible output only + report (rep2) PRP_L[TYPE]= PRP_L[TYPE]; + report (rep2) TA_L[TYPE]= TA_L[TYPE]; + report (rep2) ET_p[TYPE]= ET_p[TYPE]; + report (rep2) THETA1_L[TYPE]= THETA1_L[TYPE]; + report (rep2) THETA2_L[TYPE]= THETA2_L[TYPE]; + report (rep2) THETAS_L[TYPE]= THETAS_L[TYPE]; + report (rep2) W[TYPE]= W[TYPE]; + report (rep2) SATFRAC_L[TYPE]= SATFRAC_L[TYPE]; + report (rep2) ES_p[TYPE]= ES_p[TYPE]; + report (rep2) ES_a[TYPE]= ES_a[TYPE]; + report (rep2) T1_p[TYPE]= T1_p[TYPE]; + report (rep2) T1_a[TYPE]= T1_a[TYPE]; + report (rep2) T2_p[TYPE]= T2_p[TYPE]; + report (rep2) T2_a[TYPE]= T2_a[TYPE]; + report (rep2) T_p[TYPE]= T_p[TYPE]; + report (rep2) T_a[TYPE]= T_a[TYPE]; + report (rep2) P0_L[TYPE]= P0_L[TYPE]; + report (rep2) P1_L[TYPE]= P1_L[TYPE]; + report (rep2) P2_L[TYPE]= P2_L[TYPE]; + report (rep2) CR1_L[TYPE]= CR1_L[TYPE]; + report (rep2) CR2_L[TYPE]= CR2_L[TYPE]; + report (rep2) Q1_L[TYPE]= Q1_L[TYPE]; + report (rep2) Q2_L[TYPE]= Q2_L[TYPE]; + + }#-end of land cover type loop + +#-------------------------- +#Overall fluxes third store +#-------------------------- +#Third reservoir +#R3 (m): groundwater recharge +#S3 (m): storage in third store, updated with current fluxes +#Q3 (m): discharge from third reservoir, based on storage previous timestep + R3= P2-CR2; + S3= max(0,S3+P2-CR2); + Q3= min(S3,KQ3*S3*Duration*timeslice()); + S3= max(0,S3-Q3); + +#-------------------- +# Fresh water surface +#-------------------- +# EWAT (m): potential evapotranspiration imposed on water surface +# QWAT (m): local change in storage of fresh water surface (can be negative) + EWAT= timeinputsparse(KC_WATSTACK)*EVAP; + QWAT= if(LANDMASK,PRPTOT-EWAT); + +#----------------------------- +#Channel storage and discharge +#----------------------------- +#QLOC (m): local discharge +#QCHANNEL (m3.s-1): channel discharge +#QAVG (m3.s-1): channel discharge, averaged per year + QLOC= Q1+Q2+Q3; + QCHANNEL= max(0,catchmenttotal(((1-FRACWAT)*QLOC+FRACWAT*QWAT)*CELLAREA,LDD)/(3600*24*Duration*timeslice())); + QCUM= QCUM+QCHANNEL; + QAVG= QCUM/time(); + +#------------ +#Budget check +#------------ +#PTOT (m): total accumulated precipitation +#ETOT (m): total accumulated evapotranspiration +#QTOT (m): total accumulated local discharge +#INTOT, OUTTOT (km3): total incoming and outgoing water volumes per catchment +#SLOC, SLOCINI (m): local storage at any timestep and initially +#STOT_ACT (km3) total active storage (e.g, excluding snow cover) to decide whether equilibrium has been +# achieved (also included STOT_AVG, average total storage in (m) for soil, +# which excludes snow accumulation) +#MBE (m): local mass balance error +#MBR (-): total mass balance error per catchment, relative to total input + PTOT= PTOT+PRPTOT; + ETOT= ETOT+(FRACWAT*EWAT+(1-FRACWAT)*EACT); + QTOT= QTOT+((1-FRACWAT)*QLOC+FRACWAT*QWAT); + SLOC= (1-FRACWAT)*(S1+S2+S3+INTS+SC+SCF); + MBE= PTOT+SLOCINI-(ETOT+QTOT+SLOC); + STOT_ACT= if(LANDMASK,1E-9,1E-9)*maptotal((1-FRACWAT)*CELLAREA*(S1+S2+S3+INTS)); + INTOT= catchmenttotal(1E-9*CELLAREA*(SLOCINI+PTOT),LDD); + OUTTOT= catchmenttotal(1E-9*CELLAREA*(ETOT+QTOT+SLOC),LDD); + MBR= 1-if(INTOT>0,(INTOT-OUTTOT)/INTOT,0); + +#------------------------ +# Reports: overall values +#------------------------ +#-Meteo + report (rep2) PRPTOT= PRPTOT; + report (rep2) EPOT= EPOT; + report (rep2) TAVG= TAVG; +#-states: snow pack + report (rep2) SC= SC; + report (rep2) SCF= SCF; +#-states: soil moisture and saturated area + report (rep2) S1= S1; + report (rep2) S2= S2; + report (rep2) SS= SS; + report (rep2) THETA1= THETA1; + report (rep2) THETA2= THETA2; + report (rep2) THETAS= THETAS; + report (rep2) SATFRAC= SATFRAC; +#-groundwater: storage, recharge and area influenced by capillary rise + report (rep2) S3= S3; + report (rep2) R3= R3; + report (rep2) CRFRAC= CRFRAC; +#-fluxes: evapotranspiration + report EWAT= EWAT; + report EACT= EACT; + report ESPOT= ESPOT; + report ESACT= ESACT; + report T1POT= T1POT; + report T2POT= T2POT; + report T1ACT= T1ACT; + report T2ACT= T2ACT; + report TPOT= TPOT; + report TACT= TACT; +#-fluxes: percolation and capillary rise + report (rep2) P0= P0; + report (rep2) P1= P1; + report (rep2) P2= P2; + report (rep2) CR1= CR1; + report (rep2) CR2= CR2; +#-runoff, discharge and surface water + report (rep2) Q1= Q1; + report (rep2) Q2= Q2; + report (rep2) Q3= Q3; + report (rep2) QLOC= QLOC; + report (rep2) QWAT= QWAT; + report (rep1) QAVG= QAVG; + +#-budget checks + report (rep1) MBE= MBE; + report (rep1) MBR= MBR; + +#-all output reported, end of file diff --git a/model/reporting.py b/model/reporting.py old mode 100755 new mode 100644 index c8b1a5aff..6ad80ea48 --- a/model/reporting.py +++ b/model/reporting.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + ''' Takes care of reporting (writing) output to netcdf files. Aggregates totals and averages for various time periods. @author: Edwin H. Sutanudjaja @@ -7,6 +31,7 @@ ''' import os +import shutil import logging logger = logging.getLogger(__name__) @@ -19,25 +44,36 @@ class Reporting(object): - #list of all output variables - def __init__(self, configuration, model, modelTime): + # model (e.g. PCR-GLOBWB) and modelTime object self._model = model self._modelTime = modelTime + # configuration/setting from the ini file + self.configuration = configuration + + # initiate reporting tool/object and its configuration + self.initiate_reporting() + + # option for debugging to PCR-GLOBWB version 1.0 + self.debug_to_version_one = False + if self.configuration.debug_to_version_one: self.debug_to_version_one = True + + def initiate_reporting(self): + # output directory storing netcdf files: - self.outNCDir = str(configuration.outNCDir) + self.outNCDir = str(self.configuration.outNCDir) # object for reporting: - self.netcdfObj = PCR2netCDF(configuration) + self.netcdfObj = PCR2netCDF(self.configuration) # initiating netcdf files for reporting # # - daily output in netCDF files: self.outDailyTotNC = ["None"] try: - self.outDailyTotNC = configuration.reportingOptions['outDailyTotNC'].split(",") + self.outDailyTotNC = list(set(self.configuration.reportingOptions['outDailyTotNC'].split(","))) except: pass # @@ -61,7 +97,7 @@ def __init__(self, configuration, model, modelTime): # -- cummulative self.outMonthTotNC = ["None"] try: - self.outMonthTotNC = configuration.reportingOptions['outMonthTotNC'].split(",") + self.outMonthTotNC = list(set(self.configuration.reportingOptions['outMonthTotNC'].split(","))) except: pass if self.outMonthTotNC[0] != "None": @@ -86,7 +122,7 @@ def __init__(self, configuration, model, modelTime): # -- average self.outMonthAvgNC = ["None"] try: - self.outMonthAvgNC = configuration.reportingOptions['outMonthAvgNC'].split(",") + self.outMonthAvgNC = list(set(self.configuration.reportingOptions['outMonthAvgNC'].split(","))) except: pass if self.outMonthAvgNC[0] != "None": @@ -115,7 +151,7 @@ def __init__(self, configuration, model, modelTime): # -- last day of the month self.outMonthEndNC = ["None"] try: - self.outMonthEndNC = configuration.reportingOptions['outMonthEndNC'].split(",") + self.outMonthEndNC = list(set(self.configuration.reportingOptions['outMonthEndNC'].split(","))) except: pass if self.outMonthEndNC[0] != "None": @@ -135,11 +171,34 @@ def __init__(self, configuration, model, modelTime): "_monthEnd_output.nc",\ short_name,unit,long_name) # + # -- maximum of the month + self.outMonthMaxNC = ["None"] + try: + self.outMonthMaxNC = list(set(self.configuration.reportingOptions['outMonthMaxNC'].split(","))) + except: + pass + if self.outMonthMaxNC[0] != "None": + + for var in self.outMonthMaxNC: + + logger.info("Creating the netcdf file for monthly maximum reporting for variable %s.", str(var)) + + short_name = varDicts.netcdf_short_name[var] + unit = varDicts.netcdf_unit[var] + long_name = varDicts.netcdf_long_name[var] + if long_name == None: long_name = short_name + + # creating netCDF files: + self.netcdfObj.createNetCDF(self.outNCDir+"/"+ \ + str(var)+\ + "_monthMax_output.nc",\ + short_name,unit,long_name) + # # - YEARly output in netCDF files: # -- cummulative self.outAnnuaTotNC = ["None"] try: - self.outAnnuaTotNC = configuration.reportingOptions['outAnnuaTotNC'].split(",") + self.outAnnuaTotNC = list(set(self.configuration.reportingOptions['outAnnuaTotNC'].split(","))) except: pass if self.outAnnuaTotNC[0] != "None": @@ -165,7 +224,7 @@ def __init__(self, configuration, model, modelTime): # -- average self.outAnnuaAvgNC = ["None"] try: - self.outAnnuaAvgNC = configuration.reportingOptions['outAnnuaAvgNC'].split(",") + self.outAnnuaAvgNC = list(set(self.configuration.reportingOptions['outAnnuaAvgNC'].split(","))) except: pass if self.outAnnuaAvgNC[0] != "None": @@ -194,7 +253,7 @@ def __init__(self, configuration, model, modelTime): # -- last day of the year self.outAnnuaEndNC = ["None"] try: - self.outAnnuaEndNC = configuration.reportingOptions['outAnnuaEndNC'].split(",") + self.outAnnuaEndNC = list(set(self.configuration.reportingOptions['outAnnuaEndNC'].split(","))) except: pass if self.outAnnuaEndNC[0] != "None": @@ -213,30 +272,277 @@ def __init__(self, configuration, model, modelTime): str(var)+\ "_annuaEnd_output.nc",\ short_name,unit,long_name) + # -- maximum of the year + self.outAnnuaMaxNC = ["None"] + try: + self.outAnnuaMaxNC = list(set(self.configuration.reportingOptions['outAnnuaMaxNC'].split(","))) + except: + pass + if self.outAnnuaMaxNC[0] != "None": + + for var in self.outAnnuaMaxNC: + + logger.info("Creating the netcdf file for annual maximum reporting for variable %s.", str(var)) + + short_name = varDicts.netcdf_short_name[var] + unit = varDicts.netcdf_unit[var] + long_name = varDicts.netcdf_long_name[var] + if long_name == None: long_name = short_name + + # creating netCDF files: + self.netcdfObj.createNetCDF(self.outNCDir+"/"+ \ + str(var)+\ + "_annuaMax_output.nc",\ + short_name,unit,long_name) # list of variables that will be reported: self.variables_for_report = self.outDailyTotNC +\ self.outMonthTotNC +\ self.outMonthAvgNC +\ self.outMonthEndNC +\ + self.outMonthMaxNC +\ self.outAnnuaTotNC +\ self.outAnnuaAvgNC +\ - self.outAnnuaEndNC + self.outAnnuaEndNC +\ + self.outMonthMaxNC def post_processing(self): self.basic_post_processing() - self.additional_post_processing() + self.additional_post_processing() + + if self.debug_to_version_one: + if self._modelTime.timeStepPCR == 1: self.report_static_maps_for_debugging() + self.report_forcing_for_debugging() + self.report_vegetation_phenology_for_debugging() + + def report_forcing_for_debugging(self): + + # prepare forcing directory + if self._modelTime.timeStepPCR == 1: + self.directory_for_forcing_maps = vos.getFullPath("meteo/", self.configuration.mapsDir) + if os.path.exists(self.directory_for_forcing_maps): shutil.rmtree(self.directory_for_forcing_maps) + os.makedirs(self.directory_for_forcing_maps) + + # writing precipitation time series maps + file_name = self.directory_for_forcing_maps +\ + pcr.framework.frameworkBase.generateNameT("/"+varDicts.pcr_short_name['precipitation'] , self._modelTime.timeStepPCR) + pcr.report(self._model.meteo.precipitation, file_name) + + # writing temperature time series maps + file_name = self.directory_for_forcing_maps +\ + pcr.framework.frameworkBase.generateNameT("/"+varDicts.pcr_short_name['temperature'] , self._modelTime.timeStepPCR) + pcr.report(self._model.meteo.temperature, file_name) + + # writing referencePotET time series maps + file_name = self.directory_for_forcing_maps +\ + pcr.framework.frameworkBase.generateNameT("/"+varDicts.pcr_short_name['referencePotET'], self._modelTime.timeStepPCR) + pcr.report(self._model.meteo.referencePotET, file_name) + + + def report_vegetation_phenology_for_debugging(self): + + # CF_SHORTSTACK = maps\cover_fraction/cv_s; # fractional vegetation cover (-) per vegetation type + # CF_TALLSTACK = maps\cover_fraction/cv_t; + + # prepare directory + if self._modelTime.timeStepPCR == 1: + self.directory_for_cover_fraction_maps = vos.getFullPath("cover_fraction/", self.configuration.mapsDir) + if os.path.exists(self.directory_for_cover_fraction_maps): shutil.rmtree(self.directory_for_cover_fraction_maps) + os.makedirs(self.directory_for_cover_fraction_maps) + + # writing CF_SHORTSTACK maps + file_name = self.directory_for_cover_fraction_maps +\ + pcr.framework.frameworkBase.generateNameT("/cv_s", self._modelTime.timeStepPCR) + pcr.report(self._model.landSurface.landCoverObj["grassland"].coverFraction, file_name) + + # writing CF_TALLSTACK maps + file_name = self.directory_for_cover_fraction_maps +\ + pcr.framework.frameworkBase.generateNameT("/cv_t", self._modelTime.timeStepPCR) + pcr.report(self._model.landSurface.landCoverObj["forest"].coverFraction, file_name) + + + # SMAX_SHORTSTACK = maps\interception_capacity_input\smax_s # interception storage (m) per vegetation type + # SMAX_TALLSTACK = maps\interception_capacity_input\smax_t + + # prepare directory + if self._modelTime.timeStepPCR == 1: + self.directory_for_interception_capacity_input_maps = vos.getFullPath("interception_capacity_input/", self.configuration.mapsDir) + if os.path.exists(self.directory_for_interception_capacity_input_maps): shutil.rmtree(self.directory_for_interception_capacity_input_maps) + os.makedirs(self.directory_for_interception_capacity_input_maps) + + # writing SMAX_SHORTSTACK maps + file_name = self.directory_for_interception_capacity_input_maps +\ + pcr.framework.frameworkBase.generateNameT("/smax_s", self._modelTime.timeStepPCR) + pcr.report(self._model.landSurface.landCoverObj["grassland"].interceptCapInput, file_name) + + # writing SMAX_TALLSTACK maps + file_name = self.directory_for_interception_capacity_input_maps +\ + pcr.framework.frameworkBase.generateNameT("/smax_t", self._modelTime.timeStepPCR) + pcr.report(self._model.landSurface.landCoverObj["forest"].interceptCapInput, file_name) + + + # KC_SHORTSTACK = maps\crop_coefficient\kc_s; # crop factor (-) per vegetation type + # KC_TALLSTACK = maps\crop_coefficient\kc_t; + + # prepare directory + if self._modelTime.timeStepPCR == 1: + self.directory_for_crop_coefficient_maps = vos.getFullPath("crop_coefficient/", self.configuration.mapsDir) + if os.path.exists(self.directory_for_crop_coefficient_maps): shutil.rmtree(self.directory_for_crop_coefficient_maps) + os.makedirs(self.directory_for_crop_coefficient_maps) + + # writing KC_SHORTSTACK + file_name = self.directory_for_crop_coefficient_maps +\ + pcr.framework.frameworkBase.generateNameT("/kc_s", self._modelTime.timeStepPCR) + pcr.report(self._model.landSurface.landCoverObj["grassland"].inputCropKC, file_name) + + # writing KC_TALLSTACK + file_name = self.directory_for_crop_coefficient_maps +\ + pcr.framework.frameworkBase.generateNameT("/kc_t", self._modelTime.timeStepPCR) + pcr.report(self._model.landSurface.landCoverObj["forest"].inputCropKC, file_name) + + + def report_static_maps_for_debugging(self): + + # LANDMASK = $1\maps\catclone.map; # clone map representing landmask of earth surface + # CELLAREA = $1\maps\cellarea30.map; # surface (m2) of cell covered by total land surface + + pcr.report(self._model.routing.landmask, self.configuration.mapsDir+"/catclone.map") + pcr.report(self._model.routing.cellArea, self.configuration.mapsDir+"/cellarea30.map") + + + # LSLOPE = $1\maps\globalbcat.map; # slope length (m) + # TANSLOPE = $1\maps\globalgradslope.map; # gradient of slope (m/m) + # B_ORO = $1\maps\globalboro.map; # shape coefficient related to orography + + pcr.report(self._model.landSurface.soil_topo_parameters['default'].slopeLength , self.configuration.mapsDir+"/globalbcat.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].tanslope , self.configuration.mapsDir+"/globalgradslope.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].orographyBeta, self.configuration.mapsDir+"/globalboro.map") + + + # LDD = maps\lddsound_30min.map; # local drainage direction map + + pcr.report(self._model.routing.lddMap, self.configuration.mapsDir+"/lddsound_30min.map") + + + # DZREL0001 = $1\maps\hydro1k_dzrel0001.map; # maps of relative elevation above floodplain, in percent + # DZREL0005 = $1\maps\hydro1k_dzrel0005.map; + # DZREL0010 = $1\maps\hydro1k_dzrel0010.map; + # DZREL0020 = $1\maps\hydro1k_dzrel0020.map; + # DZREL0030 = $1\maps\hydro1k_dzrel0030.map; + # DZREL0040 = $1\maps\hydro1k_dzrel0040.map; + # DZREL0050 = $1\maps\hydro1k_dzrel0050.map; + # DZREL0060 = $1\maps\hydro1k_dzrel0060.map; + # DZREL0070 = $1\maps\hydro1k_dzrel0070.map; + # DZREL0080 = $1\maps\hydro1k_dzrel0080.map; + # DZREL0090 = $1\maps\hydro1k_dzrel0090.map; + # DZREL0100 = $1\maps\hydro1k_dzrel0100.map; + + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0001, self.configuration.mapsDir+"/hydro1k_dzrel0001.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0005, self.configuration.mapsDir+"/hydro1k_dzrel0005.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0010, self.configuration.mapsDir+"/hydro1k_dzrel0010.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0020, self.configuration.mapsDir+"/hydro1k_dzrel0020.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0030, self.configuration.mapsDir+"/hydro1k_dzrel0030.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0040, self.configuration.mapsDir+"/hydro1k_dzrel0040.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0050, self.configuration.mapsDir+"/hydro1k_dzrel0050.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0060, self.configuration.mapsDir+"/hydro1k_dzrel0060.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0070, self.configuration.mapsDir+"/hydro1k_dzrel0070.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0080, self.configuration.mapsDir+"/hydro1k_dzrel0080.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0090, self.configuration.mapsDir+"/hydro1k_dzrel0090.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].dzRel0100, self.configuration.mapsDir+"/hydro1k_dzrel0100.map") + + # COVERTYPE = [ + # SHORT = sv, + # TALL = tv]; # array of cover type: 1) short, 2) tall + # COVERTABLE = maps\param_permafrost.tbl; # table with parameterization per cover type + + # VEGFRAC[COVERTYPE] = index(COVERTABLE); # subdivision in cover type + version_one_cover_type = {} + version_one_cover_type['grassland'] = "short" + version_one_cover_type['forest'] = "tall" + + + # VEGFRAC sv maps\vegf_short.map + # VEGFRAC tv maps\vegf_tall.map + + for coverType in ['forest','grassland']: + pcr.report(self._model.landSurface.landCoverObj[coverType].fracVegCover, self.configuration.mapsDir+"/vegf_"+version_one_cover_type[coverType]+".map") + + + # THETASAT1 sv maps\fao30_ths30.map # THETASAT1 tv maps\fao30_ths30.map + # THETASAT2 sv maps\fao30_ths100.map # THETASAT2 tv maps\fao30_ths100.map + # THETARES1 sv maps\fao30_thr30.map # THETARES1 tv maps\fao30_thr30.map + # THETARES2 sv maps\fao30_thr100.map # THETARES2 tv maps\fao30_thr100.map + # KS1 sv maps\fao30_ks30.map # KS1 tv maps\fao30_ks30.map + # KS2 sv maps\fao30_ks100.map # KS2 tv maps\fao30_ks100.map + # PSI_A1 sv maps\fao30_psis30.map # PSI_A1 tv maps\fao30_psis30.map + # PSI_A2 sv maps\fao30_psis100.map # PSI_A2 tv maps\fao30_psis100.map + # BCH1 sv maps\fao30_beta30.map # BCH1 tv maps\fao30_beta30.map + # BCH2 sv maps\fao30_beta100.map # BCH2 tv maps\fao30_beta100.map + + pcr.report(self._model.landSurface.soil_topo_parameters['default'].satVolMoistContUpp, self.configuration.mapsDir+"/fao30_ths30.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].satVolMoistContLow, self.configuration.mapsDir+"/fao30_ths100.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].resVolMoistContUpp, self.configuration.mapsDir+"/fao30_thr30.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].resVolMoistContLow, self.configuration.mapsDir+"/fao30_thr100.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].airEntryValueUpp , self.configuration.mapsDir+"/fao30_psis30.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].airEntryValueLow , self.configuration.mapsDir+"/fao30_psis100.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].poreSizeBetaUpp , self.configuration.mapsDir+"/fao30_beta30.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].poreSizeBetaLow , self.configuration.mapsDir+"/fao30_beta100.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].kSatUpp , self.configuration.mapsDir+"/fao30_ks30.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].kSatLow , self.configuration.mapsDir+"/fao30_ks100.map") + + + # Z1 sv maps\fao30_z1_permafrost.map # Z1 tv maps\fao30_z1_permafrost.map + # Z2 sv maps\fao30_z2_permafrost.map # Z2 tv maps\fao30_z2_permafrost.map + # SC1 sv maps\fao30_sc1_permafrost.map # SC1 tv maps\fao30_sc1_permafrost.map + # SC2 sv maps\fao30_sc2_permafrost.map # SC2 tv maps\fao30_sc2_permafrost.map + + pcr.report(self._model.landSurface.soil_topo_parameters['default'].thickUpp , self.configuration.mapsDir+"/fao30_z1_permafrost.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].thickLow , self.configuration.mapsDir+"/fao30_z2_permafrost.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].storCapUpp , self.configuration.mapsDir+"/fao30_sc1_permafrost.map") + pcr.report(self._model.landSurface.soil_topo_parameters['default'].storCapLow , self.configuration.mapsDir+"/fao30_sc2_permafrost.map") + + # WMAX sv maps\fao30_sc_permafrost.map # WMAX tv maps\fao30_sc_permafrost.map + + pcr.report(self._model.landSurface.soil_topo_parameters['default'].rootZoneWaterStorageCap, self.configuration.mapsDir+"/fao30_sc_permafrost.map") + + + # P2_IMP sv maps\fao30_p2imp_permafrost.map # P2_IMP tv maps\fao30_p2imp_permafrost.map + + pcr.report(self._model.landSurface.soil_topo_parameters['default'].percolationImp , self.configuration.mapsDir+"/fao30_p2imp_permafrost.map") + + + # MINFRAC sv maps\minf_short.map # MINFRAC tv maps\minf_tall.map + # MAXFRAC sv maps\maxf_short.map # MAXFRAC tv maps\maxf_tall.map + # RFRAC1 sv maps\rfrac1_short.map # RFRAC1 tv maps\rfrac1_tall.map + # RFRAC2 sv maps\rfrac2_short.map # RFRAC2 tv maps\rfrac2_tall.map + + for coverType in ['forest','grassland']: + pcr.report(self._model.landSurface.landCoverObj[coverType].minSoilDepthFrac, self.configuration.mapsDir+"/minf_"+version_one_cover_type[coverType]+".map") + pcr.report(self._model.landSurface.landCoverObj[coverType].maxSoilDepthFrac, self.configuration.mapsDir+"/maxf_"+version_one_cover_type[coverType]+".map") + pcr.report(self._model.landSurface.landCoverObj[coverType].rootFraction1 , self.configuration.mapsDir+"/rfrac1_"+version_one_cover_type[coverType]+".map") + pcr.report(self._model.landSurface.landCoverObj[coverType].rootFraction2 , self.configuration.mapsDir+"/rfrac2_"+version_one_cover_type[coverType]+".map") + + + # KQ3 = maps\globalalpha.map; # recession coefficient for store 3 (day-1): drainage + # SPECYIELD3 = maps\specificyield.map; # specific yield for aquifer + + pcr.report(self._model.groundwater.recessionCoeff, self.configuration.mapsDir+"/globalalpha.map") + pcr.report(self._model.groundwater.specificYield , self.configuration.mapsDir+"/specificyield.map") + + # SAMPAI DI SINI def basic_post_processing(self): - self.precipitation = self._model.meteo.precipitation - self.temperature = self._model.meteo.temperature - self.referencePotET = self._model.meteo.referencePotET + # forcing + self.precipitation = pcr.ifthen(self._model.routing.landmask, self._model.meteo.precipitation) + self.temperature = pcr.ifthen(self._model.routing.landmask, self._model.meteo.temperature) + self.referencePotET = pcr.ifthen(self._model.routing.landmask, self._model.meteo.referencePotET) + # potential and actual evaporation from land surface part (m) self.totalLandSurfacePotET = self._model.landSurface.totalPotET self.totLandSurfaceActuaET = self._model.landSurface.actualET - + # self.fractionLandSurfaceET = vos.getValDivZero(self.totLandSurfaceActuaET,\ self.totalLandSurfacePotET,\ vos.smallNumber) @@ -264,8 +570,9 @@ def basic_post_processing(self): self.infiltration = self._model.landSurface.infiltration self.gwRecharge = self._model.landSurface.gwRecharge - self.gwNetCapRise = pcr.ifthen(self._model.landSurface.gwRecharge < 0.0, self.gwRecharge*(-1.0)) + self.gwNetCapRise = pcr.ifthenelse(self._model.landSurface.gwRecharge < 0.0, self.gwRecharge*(-1.0), 0.0) + # water demand (m) self.irrGrossDemand = self._model.landSurface.irrGrossDemand self.nonIrrGrossDemand = self._model.landSurface.nonIrrGrossDemand self.totalGrossDemand = self._model.landSurface.totalPotentialGrossDemand @@ -277,54 +584,69 @@ def basic_post_processing(self): self.baseflow = self._model.groundwater.baseflow + # abstraction (m) + self.desalinationAbstraction = self._model.landSurface.desalinationAbstraction self.surfaceWaterAbstraction = self._model.landSurface.actSurfaceWaterAbstract - self.nonFossilGroundWaterAbstraction = self._model.groundwater.nonFossilGroundwaterAbs - self.otherWaterSourceAbstraction = self._model.groundwater.unmetDemand - self.totalAbstraction = self.surfaceWaterAbstraction +\ - self.nonFossilGroundWaterAbstraction +\ - self.otherWaterSourceAbstraction + self.nonFossilGroundwaterAbstraction = self._model.groundwater.nonFossilGroundwaterAbs + self.fossilGroundwaterAbstraction = self._model.groundwater.fossilGroundwaterAbstr + self.totalAbstraction = self.desalinationAbstraction +\ + self.surfaceWaterAbstraction +\ + self.nonFossilGroundwaterAbstraction +\ + self.fossilGroundwaterAbstraction - # water body evaporation (m) - from surface water fractions only - self.waterBodyActEvaporation = self._model.routing.waterBodyEvaporation - self.waterBodyPotEvaporation = self._model.routing.waterBodyPotEvap - # - self.fractionWaterBodyEvaporation = vos.getValDivZero(self.waterBodyActEvaporation,\ - self.waterBodyPotEvaporation,\ - vos.smallNumber) # total evaporation (m), from land and water fractions self.totalEvaporation = self._model.landSurface.actualET + \ self._model.routing.waterBodyEvaporation - + # + self.fractionTotalEvaporation = vos.getValDivZero(self.totalEvaporation,\ + self._model.landSurface.totalPotET + self._model.routing.waterBodyPotEvap,\ + vos.smallNumber) + # runoff (m) from land surface - not including local changes in water bodies self.runoff = self._model.routing.runoff # discharge (unit: m3/s) self.discharge = self._model.routing.disChanWaterBody - def additional_post_processing(self): - # In this method/function, users can add their own post-processing. + # soil moisture state from (approximately) the first 5 cm soil + if self._model.landSurface.numberOfSoilLayers == 3: + self.storUppSurface = self._model.landSurface.storUpp000005 # unit: m + self.satDegUppSurface = self._model.landSurface.satDegUpp000005 # unit: percentage - # consumption for and return flow from non irrigation water demand (unit: m/day) - self.nonIrrWaterConsumption = self._model.routing.nonIrrWaterConsumption - self.nonIrrReturnFlow = self._model.routing.nonIrrReturnFlow + # fraction of surface water bodies. + self.dynamicFracWat = self._model.routing.dynamicFracWat + + if self._model.landSurface.numberOfSoilLayers == 3: + self.storUpp000005 = self._model.landSurface.storUpp000005 + self.storUpp005030 = self._model.landSurface.storUpp005030 + self.storLow030150 = self._model.landSurface.storLow030150 - # accumulated runoff (m3/s) along the drainage network - not including local changes in water bodies - if "accuRunoff" in self.variables_for_report: - self.accuRunoff = pcr.catchmenttotal(self.runoff * self._model.routing.cellArea, self._model.routing.lddMap) / vos.secondsPerDay() + def additional_post_processing(self): + # In this method/function, users can add their own post-processing. - # accumulated baseflow (m3) along the drainage network + # reporting water balance from the land surface part (excluding surface water bodies) + if "land_surface_water_balance" in self.variables_for_report: self.land_surface_water_balance = self._model.waterBalance + + # accumulated baseflow (m3/s) along the drainage network if "accuBaseflow" in self.variables_for_report: - self.accuBaseflow = pcr.catchmenttotal(self.baseflow * self._model.routing.cellArea, self._model.routing.lddMap) + self.accuBaseflow = pcr.catchmenttotal(self.baseflow * self._model.routing.cellArea, self._model.routing.lddMap) / vos.secondsPerDay() # local changes in water bodies (i.e. abstraction, return flow, evaporation, bed exchange), excluding runoff self.local_water_body_flux = self._model.routing.local_input_to_surface_water / self._model.routing.cellArea - self.runoff # total runoff (m) from local land surface runoff and local changes in water bodies self.totalRunoff = self.runoff + self.local_water_body_flux # actually this is equal to self._model.routing.local_input_to_surface_water / self._model.routing.cellArea - - # accumulated total runoff (m3) along the drainage network - not including local changes in water bodies - if "accuTotalRunoff" in self.variables_for_report: - self.accuTotalRunoff = pcr.catchmenttotal(self.totalRunoff * self._model.routing.cellArea, self._model.routing.lddMap) / vos.secondsPerDay() + + # water body evaporation (m) - from surface water fractions only + self.waterBodyActEvaporation = self._model.routing.waterBodyEvaporation + self.waterBodyPotEvaporation = self._model.routing.waterBodyPotEvap + # + self.fractionWaterBodyEvaporation = vos.getValDivZero(self.waterBodyActEvaporation,\ + self.waterBodyPotEvaporation,\ + vos.smallNumber) + + # land surface evaporation (m) + self.actualET = self._model.landSurface.actualET # fossil groundwater storage self.storGroundwaterFossil = self._model.groundwater.storGroundwaterFossil @@ -333,7 +655,7 @@ def additional_post_processing(self): self.storGroundwaterTotal = self._model.groundwater.storGroundwater + \ self._model.groundwater.storGroundwaterFossil - # total active storage thickness (m) for the entire water column - not including fossil groundwater (unmetDemand) + # total active storage thickness (m) for the entire water column - not including fossil groundwater # - including: interception, snow, soil and non fossil groundwater self.totalActiveStorageThickness = pcr.ifthen(\ self._model.routing.landmask, \ @@ -342,11 +664,14 @@ def additional_post_processing(self): self._model.groundwater.storGroundwater) # total water storage thickness (m) for the entire water column: - # - including: interception, snow, soil, non fossil groundwater and fossil groundwater (unmetDemand) + # - including: interception, snow, soil, non fossil groundwater and fossil groundwater # - this is usually used for GRACE comparison self.totalWaterStorageThickness = self.totalActiveStorageThickness + \ self._model.groundwater.storGroundwaterFossil + # total water storage volume (m3) for the entire water column: + self.totalWaterStorageVolume = self.totalWaterStorageThickness * self._model.routing.cellArea + # surfaceWaterStorage (unit: m) - negative values may be reported self.surfaceWaterStorage = self._model.routing.channelStorage / self._model.routing.cellArea @@ -359,41 +684,141 @@ def additional_post_processing(self): self.fracNonFossilGroundwaterAllocation = pcr.ifthen(self._model.routing.landmask, \ vos.getValDivZero(\ self._model.groundwater.allocNonFossilGroundwater, self.totalGrossDemand, vos.smallNumber)) - self.fracNonFossilGroundwaterAllocation = pcr.ifthenelse(self.totalGrossDemand < vos.smallNumber, 0.0, self.fracNonFossilGroundwaterAllocation) # self.fracOtherWaterSourceAllocation = pcr.ifthen(self._model.routing.landmask, \ vos.getValDivZero(\ self._model.groundwater.unmetDemand, self.totalGrossDemand, vos.smallNumber)) + # + self.fracDesalinatedWaterAllocation = pcr.ifthen(self._model.routing.landmask, \ + vos.getValDivZero(\ + self._model.landSurface.desalinationAllocation, self.totalGrossDemand, vos.smallNumber)) + # self.totalFracWaterSourceAllocation = self.fracSurfaceWaterAllocation + \ self.fracNonFossilGroundwaterAllocation + \ - self.fracOtherWaterSourceAllocation + self.fracOtherWaterSourceAllocation + \ + self.fracDesalinatedWaterAllocation - # Stefanie's post processing: reporting lake and reservoir storage (unit: m3) + # Stefanie's post processing: + # - reporting lake and reservoir storage (unit: m3) self.waterBodyStorage = pcr.ifthen(self._model.routing.landmask, \ + pcr.cover(\ pcr.ifthen(\ pcr.scalar(self._model.routing.WaterBodies.waterBodyIds) > 0.,\ - self._model.routing.WaterBodies.waterBodyStorage)) # Note: This value is after lake/reservoir outflow. - # - # snowMelt (m/day) + self._model.routing.WaterBodies.waterBodyStorage), 0.0)) # Note: This value is after lake/reservoir outflow. + # - snowMelt (m) self.snowMelt = self._model.landSurface.snowMelt - # soil moisture state from (approximately) the first 5 cm soil - if self._model.landSurface.numberOfSoilLayers == 3: - self.storUppSurface = self._model.landSurface.storUpp000005 # unit: m - self.satDegUppSurface = self._model.landSurface.satDegUpp000005 # unit: percentage + # channel storage (unit: m3) + self.channelStorage = pcr.ifthen(self._model.routing.landmask, \ + pcr.cover(self._model.routing.channelStorage, 0.0)) - # reporting water balance from the land surface part (excluding surface water bodies) - self.land_surface_water_balance = self._model.waterBalance - # evaporation from irrigation areas (m/day) - values are average over the entire cell area - if self._model.landSurface.includeIrrigation:\ - self.evaporation_from_irrigation = self._model.landSurface.landCoverObj['irrPaddy'].actualET * \ - self._model.landSurface.landCoverObj['irrPaddy'].fracVegCover + \ - self._model.landSurface.landCoverObj['irrNonPaddy'].actualET * \ - self._model.landSurface.landCoverObj['irrNonPaddy'].fracVegCover + # Some examples to report variables from certain land cover types: + # - unit: m/day - values are average over the entire cell area + if self._model.landSurface.includeIrrigation: + self.precipitation_at_irrigation = self._model.meteo.precipitation * \ + self._model.landSurface.landCoverObj['irrPaddy'].fracVegCover + \ + self._model.meteo.precipitation * \ + self._model.landSurface.landCoverObj['irrNonPaddy'].fracVegCover + self.netLqWaterToSoil_at_irrigation = self._model.landSurface.landCoverObj['irrPaddy'].netLqWaterToSoil * \ + self._model.landSurface.landCoverObj['irrPaddy'].fracVegCover + \ + self._model.landSurface.landCoverObj['irrNonPaddy'].netLqWaterToSoil * \ + self._model.landSurface.landCoverObj['irrNonPaddy'].fracVegCover + self.evaporation_from_irrigation = self._model.landSurface.landCoverObj['irrPaddy'].actualET * \ + self._model.landSurface.landCoverObj['irrPaddy'].fracVegCover + \ + self._model.landSurface.landCoverObj['irrNonPaddy'].actualET * \ + self._model.landSurface.landCoverObj['irrNonPaddy'].fracVegCover + self.transpiration_from_irrigation = self._model.landSurface.landCoverObj['irrPaddy'].actTranspiTotal * \ + self._model.landSurface.landCoverObj['irrPaddy'].fracVegCover + \ + self._model.landSurface.landCoverObj['irrNonPaddy'].actTranspiTotal * \ + self._model.landSurface.landCoverObj['irrNonPaddy'].fracVegCover + + # Total groundwater abstraction (m) (assuming otherWaterSourceAbstraction as fossil groundwater abstraction + self.totalGroundwaterAbstraction = self.nonFossilGroundwaterAbstraction +\ + self.fossilGroundwaterAbstraction + + # net liquid water passing to the soil + self.net_liquid_water_to_soil = self._model.landSurface.netLqWaterToSoil + + # consumptive water use and return flow from non irrigation water demand (unit: m/day) + self.nonIrrWaterConsumption = self._model.routing.nonIrrWaterConsumption + self.nonIrrReturnFlow = self._model.landSurface.nonIrrReturnFlow + + # total potential water demand - not considering water availability + self.totalPotentialMaximumGrossDemand = self._model.landSurface.totalPotentialMaximumGrossDemand + + # return flow due to groundwater abstraction (unit: m/day) + self.groundwaterAbsReturnFlow = self._model.routing.riverbedExchange / self._model.routing.cellArea + # NOTE: Before 24 May 2015, the stupid Edwin forgot to divide this variable with self._model.routing.cellArea + + # flood innundation depth (unit: m) above the floodplain + if self._model.routing.floodPlain:\ + self.floodDepth = pcr.ifthen(self._model.routing.landmask, \ + pcr.ifthenelse(pcr.cover(pcr.scalar(self._model.routing.WaterBodies.waterBodyIds), 0.0) > 0.0, 0.0, + self._model.routing.floodDepth)) + + # flood volume (unit: m3): excess above the channel storage capacity + if self._model.routing.floodPlain:\ + self.floodVolume = pcr.ifthen(self._model.routing.landmask, \ + pcr.ifthenelse(pcr.cover(pcr.scalar(self._model.routing.WaterBodies.waterBodyIds), 0.0) > 0.0, 0.0, \ + pcr.max(0.0, self._model.routing.channelStorage - self._model.routing.channelStorageCapacity))) + + # water withdrawal for irrigation sectors + self.irrPaddyWaterWithdrawal = pcr.ifthen(self._model.routing.landmask, self._model.landSurface.irrGrossDemandPaddy) + self.irrNonPaddyWaterWithdrawal = pcr.ifthen(self._model.routing.landmask, self._model.landSurface.irrGrossDemandNonPaddy) + self.irrigationWaterWithdrawal = self.irrPaddyWaterWithdrawal + self.irrNonPaddyWaterWithdrawal + + # water withdrawal for livestock, industry and domestic water demands + self.domesticWaterWithdrawal = pcr.ifthen(self._model.routing.landmask, self._model.landSurface.domesticWaterWithdrawal) + self.industryWaterWithdrawal = pcr.ifthen(self._model.routing.landmask, self._model.landSurface.industryWaterWithdrawal) + self.livestockWaterWithdrawal = pcr.ifthen(self._model.routing.landmask, self._model.landSurface.livestockWaterWithdrawal) + + + ###################################################################################################################################################################### + # All water withdrawal variables in volume unit (m3): + waterWithdrawalVariables = [ + 'totalGroundwaterAbstraction',\ + 'surfaceWaterAbstraction',\ + 'desalinationAbstraction',\ + 'domesticWaterWithdrawal',\ + 'industryWaterWithdrawal',\ + 'livestockWaterWithdrawal',\ + 'irrigationWaterWithdrawal',\ + 'irrGrossDemand',\ + 'nonIrrGrossDemand',\ + 'totalGrossDemand'\ + ] + for var in waterWithdrawalVariables: + volVariable = var + 'Volume' + vars(self)[volVariable] = None + vars(self)[volVariable] = self._model.routing.cellArea * vars(self)[var] + ###################################################################################################################################################################### + + + ########################################################################################################################################################################################## + # Consumptive water use (unit: m3/day) for livestock, domestic and industry + self.livestockWaterConsumptionVolume = self._model.landSurface.livestockReturnFlowFraction * self.livestockWaterWithdrawalVolume + self.domesticWaterConsumptionVolume = self._model.landSurface.domesticReturnFlowFraction * self.domesticWaterWithdrawalVolume + self.industryWaterConsumptionVolume = self._model.landSurface.industryReturnFlowFraction * self.industryWaterWithdrawalVolume + ########################################################################################################################################################################################## + + + ###################################################################################################################################################################### + # For irrigation sector, the net consumptive water use will be calculated using annual values as follows: + # irrigation_water_consumption_volume = self.evaporation_from_irrigation_volume * self.irrigationWaterWithdrawal / \ + # (self.precipitation_at_irrigation_volume + self.irrigationWaterWithdrawal) + if self._model.landSurface.includeIrrigation: + self.precipitation_at_irrigation_volume = self.precipitation_at_irrigation * self._model.routing.cellArea + self.evaporation_from_irrigation_volume = self.evaporation_from_irrigation * self._model.routing.cellArea + # - additional values (may be needed) + self.netLqWaterToSoil_at_irrigation_volume = self.netLqWaterToSoil_at_irrigation * self._model.routing.cellArea + self.transpiration_from_irrigation_volume = self.transpiration_from_irrigation * self._model.routing.cellArea + ###################################################################################################################################################################### + def report(self): + # recap all variables self.post_processing() # time stamp for reporting @@ -402,6 +827,8 @@ def report(self): self._modelTime.day,\ 0) + logger.info("reporting for time %s", self._modelTime.currTime) + # writing daily output to netcdf files if self.outDailyTotNC[0] != "None": for var in self.outDailyTotNC: @@ -411,7 +838,7 @@ def report(self): str(var)+\ "_dailyTot_output.nc",\ short_name,\ - pcr2numpy(self.__getattribute__(var),vos.MV),\ + pcr.pcr2numpy(self.__getattribute__(var),vos.MV),\ timeStamp) # writing monthly output to netcdf files @@ -436,7 +863,7 @@ def report(self): str(var)+\ "_monthTot_output.nc",\ short_name,\ - pcr2numpy(self.__getattribute__(var+'MonthTot'),\ + pcr.pcr2numpy(self.__getattribute__(var+'MonthTot'),\ vos.MV),timeStamp) # # - average @@ -466,7 +893,7 @@ def report(self): str(var)+\ "_monthAvg_output.nc",\ short_name,\ - pcr2numpy(self.__getattribute__(var+'MonthAvg'),\ + pcr.pcr2numpy(self.__getattribute__(var+'MonthAvg'),\ vos.MV),timeStamp) # # - last day of the month @@ -481,7 +908,31 @@ def report(self): str(var)+\ "_monthEnd_output.nc",\ short_name,\ - pcr2numpy(self.__getattribute__(var),\ + pcr.pcr2numpy(self.__getattribute__(var),\ + vos.MV),timeStamp) + # + # - maximum + if self.outMonthMaxNC[0] != "None": + for var in self.outMonthMaxNC: + + # introduce variables at the beginning of simulation or + # reset variables at the beginning of the month + if self._modelTime.timeStepPCR == 1 or \ + self._modelTime.day == 1:\ + vars(self)[var+'MonthMax'] = pcr.scalar(0.0) + + # find the maximum + vars(self)[var+'MonthMax'] = pcr.max(vars(self)[var], vars(self)[var+'MonthMax']) + + # reporting at the end of the month: + if self._modelTime.endMonth == True: + + short_name = varDicts.netcdf_short_name[var] + self.netcdfObj.data2NetCDF(self.outNCDir+"/"+ \ + str(var)+\ + "_monthMax_output.nc",\ + short_name,\ + pcr.pcr2numpy(self.__getattribute__(var+'MonthMax'),\ vos.MV),timeStamp) # writing yearly output to netcdf files @@ -490,7 +941,7 @@ def report(self): for var in self.outAnnuaTotNC: # introduce variables at the beginning of simulation or - # reset variables at the beginning of the month + # reset variables at the beginning of the year if self._modelTime.timeStepPCR == 1 or \ self._modelTime.doy == 1:\ vars(self)[var+'AnnuaTot'] = pcr.scalar(0.0) @@ -506,7 +957,7 @@ def report(self): str(var)+\ "_annuaTot_output.nc",\ short_name,\ - pcr2numpy(self.__getattribute__(var+'AnnuaTot'),\ + pcr.pcr2numpy(self.__getattribute__(var+'AnnuaTot'),\ vos.MV),timeStamp) # - average @@ -536,20 +987,45 @@ def report(self): str(var)+\ "_annuaAvg_output.nc",\ short_name,\ - pcr2numpy(self.__getattribute__(var+'AnnuaAvg'),\ + pcr.pcr2numpy(self.__getattribute__(var+'AnnuaAvg'),\ vos.MV),timeStamp) # # -last day of the year if self.outAnnuaEndNC[0] != "None": for var in self.outAnnuaEndNC: + # calculating average & reporting at the end of the year: + if self._modelTime.endYear == True: + short_name = varDicts.netcdf_short_name[var] self.netcdfObj.data2NetCDF(self.outNCDir+"/"+ \ str(var)+\ "_annuaEnd_output.nc",\ short_name,\ - pcr2numpy(self.__getattribute__(var),\ + pcr.pcr2numpy(self.__getattribute__(var),\ vos.MV),timeStamp) + # + # - maximum + if self.outAnnuaMaxNC[0] != "None": + for var in self.outAnnuaMaxNC: - logger.info("reporting for time %s", self._modelTime.currTime) - + # introduce variables at the beginning of simulation or + # reset variables at the beginning of the year + if self._modelTime.timeStepPCR == 1 or \ + self._modelTime.doy == 1:\ + vars(self)[var+'AnnuaMax'] = pcr.scalar(0.0) + + # find the maximum + vars(self)[var+'AnnuaMax'] = pcr.max(vars(self)[var], vars(self)[var+'AnnuaMax']) + + # reporting at the end of the year: + if self._modelTime.endYear == True: + + short_name = varDicts.netcdf_short_name[var] + self.netcdfObj.data2NetCDF(self.outNCDir+"/"+ \ + str(var)+\ + "_annuaMax_output.nc",\ + short_name,\ + pcr.pcr2numpy(self.__getattribute__(var+'AnnuaMax'),\ + vos.MV),timeStamp) + diff --git a/model/routing.py b/model/routing.py old mode 100755 new mode 100644 index 7f804a623..a681fae98 --- a/model/routing.py +++ b/model/routing.py @@ -1,9 +1,31 @@ -#!/usr/bin/ python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os import types import math +import types from pcraster.framework import * import pcraster as pcr @@ -68,16 +90,16 @@ def __init__(self,iniItems,initialConditions,lddMap): self.method = iniItems.routingOptions['routingMethod'] - # TODO: 26 Feb 2014, Edwin found that reasonable runs are only found - # if all of these options = True. + # option to include lakes and reservoirs self.includeWaterBodies = True - self.includeLakes = True - self.includeReservoirs = True + if 'includeWaterBodies' in iniItems.routingOptions.keys(): + if iniItems.routingOptions['includeWaterBodies'] == "False" or\ + iniItems.routingOptions['includeWaterBodies'] == "None": + self.includeWaterBodies = False # local drainage direction: - self.lddMap = vos.readPCRmapClone(\ - iniItems.routingOptions['lddMap'], - self.cloneMap,self.tmpDir,self.inputDir,True) + self.lddMap = vos.readPCRmapClone(iniItems.routingOptions['lddMap'], + self.cloneMap,self.tmpDir,self.inputDir,True) self.lddMap = pcr.lddrepair(pcr.ldd(self.lddMap)) self.lddMap = pcr.lddrepair(self.lddMap) @@ -94,10 +116,12 @@ def __init__(self,iniItems,initialConditions,lddMap): # ldd mask self.lddMap = pcr.lddmask(self.lddMap, self.landmask) + # cell area (unit: m2) self.cellArea = vos.readPCRmapClone(\ iniItems.routingOptions['cellAreaMap'], self.cloneMap,self.tmpDir,self.inputDir) + # model resolution in arc-degree unit self.cellSizeInArcDeg = vos.getMapAttributes(self.cloneMap,"cellsize") # maximum number of days (timesteps) to calculate long term average flow values (default: 5 years = 5 * 365 days = 1825) @@ -110,9 +134,10 @@ def __init__(self,iniItems,initialConditions,lddMap): for var in routingParameters: input = iniItems.routingOptions[str(var)] vars(self)[var] = vos.readPCRmapClone(input,\ - self.cloneMap,self.tmpDir,self.inputDir) + self.cloneMap,self.tmpDir,self.inputDir) # parameters needed to estimate channel dimensions/parameters + # - used in the method/function 'getRoutingParamAvgDischarge' self.eta = 0.25 self.nu = 0.40 self.tau = 8.00 @@ -122,49 +147,73 @@ def __init__(self,iniItems,initialConditions,lddMap): self.minChannelWidth = pcr.scalar(0.0) if "minimumChannelWidth" in iniItems.routingOptions.keys(): if iniItems.routingOptions['minimumChannelWidth'] != "None":\ - self.minChannelWidth = vos.readPCRmapClone(\ + self.minChannelWidth = pcr.cover(vos.readPCRmapClone(\ iniItems.routingOptions['minimumChannelWidth'], - self.cloneMap,self.tmpDir,self.inputDir) + self.cloneMap,self.tmpDir,self.inputDir), 0.0) - # option to use constant channel width (m) - self.constantChannelWidth = None + # option to use constant/pre-defined channel width (m) + self.predefinedChannelWidth = None if "constantChannelWidth" in iniItems.routingOptions.keys(): if iniItems.routingOptions['constantChannelWidth'] != "None":\ - self.constantChannelWidth = vos.readPCRmapClone(\ - iniItems.routingOptions['constantChannelWidth'], - self.cloneMap,self.tmpDir,self.inputDir) + self.predefinedChannelWidth = pcr.cover(vos.readPCRmapClone(\ + iniItems.routingOptions['constantChannelWidth'], + self.cloneMap,self.tmpDir,self.inputDir), 0.0) + + # option to use constant/pre-defined channel depth (m) + self.predefinedChannelDepth = None + if "constantChannelDepth" in iniItems.routingOptions.keys(): + if iniItems.routingOptions['constantChannelDepth'] != "None":\ + self.predefinedChannelDepth = pcr.cover(vos.readPCRmapClone(\ + iniItems.routingOptions['constantChannelDepth'], + self.cloneMap,self.tmpDir,self.inputDir), 0.0) + # an assumption for broad sheet flow in kinematic wave methods/approaches self.beta = 0.6 - - # cellLength (m) is approximated cell diagonal - # + + # channelLength = approximation of channel length (unit: m) + # This is approximated by cell diagonal. cellSizeInArcMin = self.cellSizeInArcDeg*60. verticalSizeInMeter = cellSizeInArcMin*1852. # - self.cellLengthFD = ((self.cellArea/verticalSizeInMeter)**(2)+\ - (verticalSizeInMeter)**(2))\ - **(0.5) + self.cellLengthFD = ((self.cellArea/verticalSizeInMeter)**(2)+\ + (verticalSizeInMeter)**(2))**(0.5) + self.channelLength = self.cellLengthFD + # + # channel length (unit: m) + if "channelLength" in iniItems.routingOptions.keys(): + if iniItems.routingOptions['channelLength'] != "None":\ + self.channelLength = pcr.cover( + vos.readPCRmapClone(\ + iniItems.routingOptions['channelLength'], + self.cloneMap,self.tmpDir,self.inputDir), self.channelLength) + + # dist2celllength in m/arcDegree (needed in the accuTravelTime function): nrCellsDownstream = pcr.ldddist(self.lddMap,\ self.lddMap == 5,1.) distanceDownstream = pcr.ldddist(self.lddMap,\ self.lddMap == 5,\ - self.cellLengthFD) + self.channelLength) channelLengthDownstream = \ - (self.cellLengthFD + distanceDownstream)/\ + (self.channelLength + distanceDownstream)/\ (nrCellsDownstream + 1) # unit: m self.dist2celllength = channelLengthDownstream /\ self.cellSizeInArcDeg # unit: m/arcDegree # the channel gradient must be >= minGradient - minGradient = 0.00001 + minGradient = 0.00005 # 0.000005 self.gradient = pcr.max(minGradient,\ pcr.cover(self.gradient, minGradient)) # initiate/create WaterBody class self.WaterBodies = waterBodies.WaterBodies(iniItems,self.landmask) - self.fileCropKC = vos.getFullPath(\ + # crop evaporation coefficient for surface water bodies + self.no_zero_crop_water_coefficient = True + if iniItems.routingOptions['cropCoefficientWaterNC'] == "None": + self.no_zero_crop_water_coefficient = False + else: + self.fileCropKC = vos.getFullPath(\ iniItems.routingOptions['cropCoefficientWaterNC'],\ self.inputDir) @@ -175,7 +224,7 @@ def __init__(self,iniItems,initialConditions,lddMap): design_flood_speed = 5.00 # m/s design_length_of_sub_time_step = pcr.cellvalue( pcr.mapminimum( - self.courantNumber * self.cellLengthFD / design_flood_speed),1)[0] + self.courantNumber * self.channelLength / design_flood_speed),1)[0] self.limit_num_of_sub_time_steps = np.ceil( vos.secondsPerDay() / design_length_of_sub_time_step) # @@ -194,10 +243,10 @@ def __init__(self,iniItems,initialConditions,lddMap): self.limit_num_of_sub_time_steps = np.int(self.limit_num_of_sub_time_steps) # critical water height (m) used to select stable length of sub time step in kinematic wave methods/approaches - self.critical_water_height = 0.25; # used in Van Beek et al. (2011) + self.critical_water_height = 0.25; # used in Van Beek et al. (2011) # assumption for the minimum fracwat value used for calculating water height - self.min_fracwat_for_water_height = 0.0001 + self.min_fracwat_for_water_height = 0.001 # dimensionless # assumption for minimum crop coefficient for surface water bodies self.minCropWaterKC = 0.00 @@ -207,9 +256,64 @@ def __init__(self,iniItems,initialConditions,lddMap): # get the initialConditions self.getICs(iniItems, initialConditions) - # initiate old style reporting # TODO: remove this! - self.initiate_old_style_routing_reporting(iniItems) + # flood plain options: + ################################################################################# + self.floodPlain = iniItems.routingOptions['dynamicFloodPlain'] == "True" + if self.floodPlain: + + logger.info("Flood plain extents can vary during the simulation.") + + # get ManningsN for the flood plain areas + input = iniItems.routingOptions['floodplainManningsN'] + self.floodplainManN = vos.readPCRmapClone(input,\ + self.cloneMap, self.tmpDir, self.inputDir) + + # reduction parameter of smoothing interval and error threshold + self.reductionKK = 0.5 + if 'reductionKK' in iniItems.routingOptions.keys(): + self.reductionKK= float(iniItems.routingOptions['reductionKK']) + self.criterionKK = 40.0 + if 'criterionKK' in iniItems.routingOptions.keys(): + self.criterionKK= float(iniItems.routingOptions['criterionKK']) + + # get relative elevation (above floodplain) profile per grid cell (including smoothing parameters) + self.nrZLevels, self.areaFractions, self.relZ, self.floodVolume, self.kSlope, self.mInterval = \ + self.getElevationProfile(iniItems) + + # get bankfull capacity (unit: m3) + self.predefinedBankfullCapacity = None + self.usingFixedBankfullCapacity = False + if iniItems.routingOptions['bankfullCapacity'] != "None" : + + self.usingFixedBankfullCapacity = True + self.predefinedBankfullCapacity = vos.readPCRmapClone(iniItems.routingOptions['bankfullCapacity'],\ + self.cloneMap, self.tmpDir, self.inputDir) + else: + msg = "The bankfull channel storage capacity is NOT defined in the configuration file. " + + if isinstance(self.predefinedChannelWidth, types.NoneType) or\ + isinstance(self.predefinedChannelDepth, types.NoneType): + + msg += "The bankfull capacity is estimated from average discharge (5 year long term average)." + + else: + + msg += "The bankfull capacity is estimated from the given channel depth and channel width." + self.usingFixedBankfullCapacity = True + self.predefinedBankfullCapacity = self.estimateBankfullCapacity(self.predefinedChannelWidth,\ + self.predefinedChannelDepth) + + logger.info(msg) + + # covering the value + self.predefinedBankfullCapacity = pcr.cover(self.predefinedBankfullCapacity, 0.0) + + # zero fracwat assumption (used for debugging to the version 1) + self.zeroFracWatAllAndAlways = False + if iniItems.debug_to_version_one: self.zeroFracWatAllAndAlways = True + # initiate old style reporting # This is still very useful during the 'debugging' process. + self.initiate_old_style_routing_reporting(iniItems) def getICs(self,iniItems,iniConditions = None): @@ -279,7 +383,7 @@ def getICs(self,iniItems,iniConditions = None): self.avgOutflow = vos.readPCRmapClone(iniItems.routingOptions['avgLakeReservoirOutflowLongIni'],self.cloneMap,self.tmpDir,self.inputDir) if not isinstance(iniItems.routingOptions['waterBodyStorageIni'],types.NoneType): self.waterBodyStorage = vos.readPCRmapClone(iniItems.routingOptions['waterBodyStorageIni'],self.cloneMap,self.tmpDir,self.inputDir) - self.waterBodyStorage = pcr.ifthen(self.landmask, self.waterBodyStorage) + self.waterBodyStorage = pcr.ifthen(self.landmask, pcr.cover(self.waterBodyStorage, 0.0)) else: self.waterBodyStorage = None else: @@ -289,7 +393,142 @@ def getICs(self,iniItems,iniConditions = None): self.waterBodyStorage = iniConditions['routing']['waterBodyStorage'] - def getRoutingParamAvgDischarge(self, avgDischarge, dist2celllength): + def estimateBankfullDischarge(self, bankfullWidth, factor = 4.8): + + # bankfull discharge (unit: m3/s) + # - from Lacey formula: P = B = 4.8 * (Qbf)**0.5 + + bankfullDischarge = (bankfullWidth / factor ) ** (2.0) + + return bankfullDischarge + + def estimateBankfullDepth(self, bankfullDischarge): + + # bankfull depth (unit: m) + # - from the Manning formula + # - assuming rectangular channel + + bankfullDepth = self.manningsN * ((bankfullDischarge)**(0.50)) + bankfullDepth = bankfullDepth / (4.8 * ((self.gradient)**(0.50))) + bankfullDepth = bankfullDepth**(3.0/5.0) + + return bankfullDepth + + def estimateBankfullCapacity(self, width, depth, minWidth = 5.0, minDepth = 1.0): + + # bankfull capacity (unit: m3) + bankfullCapacity = pcr.max(minWidth, width) * \ + pcr.max(minDepth, depth) * \ + self.channelLength + + return bankfullCapacity + + def getElevationProfile(self, iniItems): + + # get the profile of relative elevation above the floodplain (per grid cell) + + # output: dictionaries kSlope, mInterval, relZ and floodVolume with the keys iCnt (index, dimensionless) + # - nrZLevels : number of intervals/levels + # - areaFractions (dimensionless) : percentage/fraction of flooded/innundated area + # - relZ (m) : relative elevation above floodplain + # - floodVolume (m3) : flood volume above the channel bankfull capacity + # - kSlope (dimensionless) : slope used during the interpolation + # - mInterval (m3) : smoothing interval (used in the interpolation) + + msg = 'Get the profile of relative elevation (relZ, unit: m) !!!' + logger.info(msg) + + relativeElevationFileNC = None # TODO define relative elevation files in a netdf file. + if relativeElevationFileNC != None: + pass # TODO: using a netcdf file + + if relativeElevationFileNC == None: + + relZFileName = vos.getFullPath(iniItems.routingOptions['relativeElevationFiles'],\ + iniItems.globalOptions['inputDir']) + + # a dictionary contains areaFractions (dimensionless): fractions of flooded/innundated areas + areaFractions = map(float, iniItems.routingOptions['relativeElevationLevels'].split(',')) + # number of levels/intervals + nrZLevels = len(areaFractions) + # - TODO: Read areaFractions and nrZLevels automatically. + + ######################################################################################################## + # + # patch elevations: those that are part of sills are updated on the basis of the floodplain gradient + # using local distances deltaX per increment upto z[N] and the sum over sills + # - fill all lists (including smoothing interval and slopes) + + relZ = [0.] * nrZLevels + for iCnt in range(0, nrZLevels): + + if relativeElevationFileNC == None: + inputName = relZFileName %(areaFractions[iCnt] * 100) + relZ[iCnt] = vos.readPCRmapClone(inputName, + self.cloneMap, self.tmpDir, self.inputDir) + if relativeElevationFileNC != None: + pass # TODO: using a netcdf file + + # covering elevation values + relZ[iCnt] = pcr.ifthen(self.landmask, pcr.cover(relZ[iCnt], 0.0)) + + # make sure that relZ[iCnt] >= relZ[iCnt-1] (added by Edwin) + if iCnt > 0: relZ[iCnt] = pcr.max(relZ[iCnt], relZ[iCnt-1]) + + # - minimum slope of floodplain + # being defined as the longest sill, + # first used to retrieve longest cumulative distance + deltaX = [self.cellArea**0.5] * nrZLevels + deltaX[0] = 0.0 + sumX = deltaX[:] + minSlope = 0.0 + for iCnt in range(nrZLevels): + if iCnt < nrZLevels-1: + deltaX[iCnt] = (areaFractions[iCnt+1]**0.5 - areaFractions[iCnt]**0.5) * deltaX[iCnt] + else: + deltaX[iCnt] = (1.0 - areaFractions[iCnt-1]**0.5)*deltaX[iCnt] + if iCnt > 0: + sumX[iCnt] = pcr.ifthenelse(relZ[iCnt] == relZ[iCnt-1], sumX[iCnt-1] + deltaX[iCnt], 0.0) + minSlope = pcr.ifthenelse(relZ[iCnt] == relZ[iCnt-1], pcr.max( sumX[iCnt], minSlope), minSlope) + # - the maximum value for the floodplain slope is channel gradient (flow velocity is slower in the floodplain) + minSlope = pcr.min(self.gradient, 0.5* pcr.max(deltaX[1], minSlope)**-1.) + + # - add small increment to elevations to each sill (except in the case of lakes, #TODO: verify this) + for iCnt in range(nrZLevels): + relZ[iCnt] = relZ[iCnt] + sumX[iCnt] * pcr.ifthenelse(relZ[nrZLevels-1] > 0., minSlope, 0.0) + # make sure that relZ[iCnt] >= relZ[iCnt-1] (added by Edwin) + if iCnt > 0: relZ[iCnt] = pcr.max(relZ[iCnt], relZ[iCnt-1]) + # + ######################################################################################################## + + + ######################################################################################################## + # - set slope and smoothing interval between dy= y(i+1)-y(i) and dx= x(i+1)-x(i) + # on the basis of volume + # + floodVolume = [0.] * (nrZLevels) # volume (unit: m3) + mInterval = [0.] * (nrZLevels) # smoothing interval (unit: m3) + kSlope = [0.] * (nrZLevels) # slope (dimensionless) + # + for iCnt in range(1, nrZLevels): + floodVolume[iCnt] = floodVolume[iCnt-1] + \ + 0.5 * (areaFractions[iCnt] + areaFractions[iCnt-1]) * \ + (relZ[iCnt] - relZ[iCnt-1]) * self.cellArea + kSlope[iCnt-1] = (areaFractions[iCnt] - areaFractions[iCnt-1])/\ + pcr.max(0.001, floodVolume[iCnt] - floodVolume[iCnt-1]) + for iCnt in range(1, nrZLevels): + if iCnt < (nrZLevels-1): + mInterval[iCnt] = 0.5 * self.reductionKK * pcr.min(floodVolume[iCnt+1] - floodVolume[iCnt], \ + floodVolume[iCnt] - floodVolume[iCnt-1]) + else: + mInterval[iCnt] = 0.5 * self.reductionKK *(floodVolume[iCnt] - floodVolume[iCnt-1]) + # + ######################################################################################################## + + return nrZLevels, areaFractions, relZ, floodVolume, kSlope, mInterval + + + def getRoutingParamAvgDischarge(self, avgDischarge, dist2celllength = None): # obtain routing parameters based on average (longterm) discharge # output: channel dimensions and # characteristicDistance (for accuTravelTime input) @@ -297,18 +536,43 @@ def getRoutingParamAvgDischarge(self, avgDischarge, dist2celllength): yMean = self.eta * pow (avgDischarge, self.nu ) # avgDischarge in m3/s wMean = self.tau * pow (avgDischarge, self.phi) + wMean = pcr.max(wMean,0.01) # average flow width (m) - this could be used as an estimate of channel width (assuming rectangular channels) + wMean = pcr.cover(wMean,0.01) + yMean = pcr.max(yMean,0.01) # average flow depth (m) - this should NOT be used as an estimate of channel depth + yMean = pcr.cover(yMean,0.01) + # option to use constant channel width (m) - if not isinstance(self.constantChannelWidth,types.NoneType):\ - wMean = pcr.cover(self.constantChannelWidth, wMean) - + if not isinstance(self.predefinedChannelWidth,types.NoneType):\ + wMean = pcr.cover(self.predefinedChannelWidth, wMean) + # # minimum channel width (m) wMean = pcr.max(self.minChannelWidth, wMean) - yMean = pcr.max(yMean,0.01) # channel depth (m) - wMean = pcr.max(wMean,0.01) # channel width (m) - yMean = pcr.cover(yMean,0.01) - wMean = pcr.cover(wMean,0.01) + return (yMean, wMean) + + def getCharacteristicDistance(self, yMean, wMean): + + # Manning's coefficient: + usedManningsN = self.manningsN + + # corrected Manning's coefficient: + if self.floodPlain: + # wetted perimeter + flood_only_wetted_perimeter = self.floodDepth * (2.0) + \ + pcr.max(0.0, self.innundatedFraction*self.cellArea/self.channelLength - self.channelWidth) + channel_only_wetted_perimeter = \ + pcr.min(self.channelDepth, vos.getValDivZero(self.channelStorage, self.channelLength*self.channelWidth, 0.0)) * 2.0 + \ + self.channelWidth + # total channel wetted perimeter (unit: m) + channel_wetted_perimeter = channel_only_wetted_perimeter + \ + flood_only_wetted_perimeter + # minimum channel wetted perimeter = 10 cm + channel_wetted_perimeter = pcr.max(0.1, channel_wetted_perimeter) + + usedManningsN = ((channel_only_wetted_perimeter/channel_wetted_perimeter) * self.manningsN**(1.5) + \ + ( flood_only_wetted_perimeter/channel_wetted_perimeter) * self.floodplainManN**(1.5))**(2./3.) + # characteristicDistance (dimensionless) # - This will be used for accutraveltimeflux & accutraveltimestate # - discharge & storage = accutraveltimeflux & accutraveltimestate @@ -319,12 +583,12 @@ def getRoutingParamAvgDischarge(self, avgDischarge, dist2celllength): ( (yMean * wMean)/ \ (wMean + 2*yMean) )**(2./3.) * \ ((self.gradient)**(0.5))/ \ - self.manningsN * \ - vos.secondsPerDay() # meter/day + usedManningsN * \ + vos.secondsPerDay() # meter/day characteristicDistance = \ pcr.max((self.cellSizeInArcDeg)*0.000000001,\ - characteristicDistance/dist2celllength) # arcDeg/day + characteristicDistance/self.dist2celllength) # arcDeg/day # charateristicDistance for each lake/reservoir: lakeReservoirCharacteristicDistance = pcr.ifthen(pcr.scalar(self.WaterBodies.waterBodyIds) > 0., @@ -334,8 +598,11 @@ def getRoutingParamAvgDischarge(self, avgDischarge, dist2celllength): outlets = pcr.cover(pcr.ifthen(pcr.scalar(self.WaterBodies.waterBodyOut) > 0, pcr.boolean(1)), pcr.boolean(0)) distance_to_outlets = pcr.ifthen(pcr.scalar(self.WaterBodies.waterBodyIds) > 0., pcr.ldddist(self.lddMap, outlets, pcr.scalar(1.0))) + #~ lakeReservoirCharacteristicDistance = pcr.ifthen(pcr.scalar(self.WaterBodies.waterBodyIds) > 0., + #~ pcr.max(distance_to_outlets + pcr.downstreamdist(self.lddMap)*1.50, lakeReservoirCharacteristicDistance)) lakeReservoirCharacteristicDistance = pcr.ifthen(pcr.scalar(self.WaterBodies.waterBodyIds) > 0., - pcr.max(distance_to_outlets + pcr.downstreamdist(self.lddMap)*1.50, lakeReservoirCharacteristicDistance)) + pcr.max(distance_to_outlets + pcr.downstreamdist(self.lddMap)*2.50, lakeReservoirCharacteristicDistance)) + lakeReservoirCharacteristicDistance = pcr.areamaximum(lakeReservoirCharacteristicDistance, self.WaterBodies.waterBodyIds) # # TODO: calculate lakeReservoirCharacteristicDistance while obtaining lake & reservoir parameters @@ -357,8 +624,7 @@ def getRoutingParamAvgDischarge(self, avgDischarge, dist2celllength): characteristicDistance = pcr.cover(characteristicDistance, 0.1*self.cellSizeInArcDeg) characteristicDistance = pcr.max(0.100*self.cellSizeInArcDeg, characteristicDistance) # TODO: check what the minimum distance for accutraveltime function - return (yMean, wMean, characteristicDistance) - + return characteristicDistance def accuTravelTime(self): @@ -377,45 +643,45 @@ def accuTravelTime(self): channelStorageForAccuTravelTime = pcr.max(0.0, self.channelStorage) channelStorageForAccuTravelTime = pcr.cover(channelStorageForAccuTravelTime,0.0) # TODO: check why do we have to use the "cover" operation? + characteristicDistance = self.getCharacteristicDistance(self.yMean, self.wMean) + # estimating channel discharge (m3/day) self.Q = pcr.accutraveltimeflux(self.lddMap,\ channelStorageForAccuTravelTime,\ - self.characteristicDistance) + pcr.max(0.0, characteristicDistance)) self.Q = pcr.cover(self.Q, 0.0) # for very small velocity (i.e. characteristicDistanceForAccuTravelTime), discharge can be missing value. # see: http://sourceforge.net/p/pcraster/bugs-and-feature-requests/543/ # http://karssenberg.geo.uu.nl/tt/TravelTimeSpecification.htm # # and make sure that no negative discharge - self.Q = pcr.max(0.0, self.Q) # unit: m3/day + self.Q = pcr.max(0.0, self.Q) # unit: m3/day # updating channelStorage (after routing) - # - # - alternative 1: using accutraveltimestate self.channelStorage = pcr.accutraveltimestate(self.lddMap,\ channelStorageForAccuTravelTime,\ - self.characteristicDistance) # unit: m3 - - #~ # - alternative 2: using the calculated Q (Can we do this?) - #~ storage_change_in_volume = pcr.upstream(self.lddMap, self.Q) - self.Q - #~ channelStorageForRouting += storage_change_in_volume + pcr.max(0.0, characteristicDistance)) # unit: m3 # return channelStorageThatWillNotMove to channelStorage: - self.channelStorage += channelStorageThatWillNotMove # unit: m3 + self.channelStorage += channelStorageThatWillNotMove # unit: m3 - # for non kinematic wave approach, set subDishcarge to missing values - self.subDischarge = pcr.scalar(vos.MV) + # for non kinematic wave approaches, set subDishcarge Q in m3/s + self.subDischarge = self.Q / vos.secondsPerDay() + self.subDischarge = pcr.ifthen(self.landmask, self.subDischarge) + def estimate_length_of_sub_time_step(self): # estimate the length of sub-time step (unit: s): # - the shorter is the better # - estimated based on the initial or latest sub-time step discharge (unit: m3/s) - # + # length_of_sub_time_step = pcr.ifthenelse(self.subDischarge > 0.0, - self.water_height * self.dynamicFracWat * self.cellArea / self.subDischarge, vos.secondsPerDay()) + self.water_height * self.dynamicFracWat * self.cellArea / \ + self.subDischarge, vos.secondsPerDay()) + # TODO: Check this logic with Rens! - # determine the number of sub time steps (based on Rens van Beek's method - check this method with him) + # determine the number of sub time steps (based on Rens van Beek's method) # critical_condition = (length_of_sub_time_step < vos.secondsPerDay()) & \ (self.water_height > self.critical_water_height) & \ @@ -446,6 +712,8 @@ def simplifiedKinematicWave(self): """ ########################################################################################################################## + + # TODO: REMOVE THIS METHOD AS THIS IS IRRELEVANT. logger.info("Using the simplifiedKinematicWave method ! ") @@ -455,44 +723,74 @@ def simplifiedKinematicWave(self): # channelStorage that will be given to the ROUTING operation: channelStorageForRouting = pcr.max(0.0, self.channelStorage) # unit: m3 - # water height (m) - self.water_height = channelStorageForRouting / (pcr.max(self.min_fracwat_for_water_height, self.dynamicFracWat * self.cellArea)) - + # estimate of water height (m) + # - needed to estimate the length of sub-time step and + # also to estimate the channel wetted area (for the calculation of alpha and dischargeInitial) + self.water_height = channelStorageForRouting /\ + (pcr.max(self.min_fracwat_for_water_height, self.dynamicFracWat) * self.cellArea) + # estimate the length of sub-time step (unit: s): - length_of_sub_time_step, number_of_loops = \ - self.estimate_length_of_sub_time_step() - + length_of_sub_time_step, number_of_loops = self.estimate_length_of_sub_time_step() + for i_loop in range(number_of_loops): msg = "sub-daily time step "+str(i_loop+1)+" from "+str(number_of_loops) logger.info(msg) - # alpha parameter and initial discharge variable needed for kinematci wave - alpha, dischargeInitial = self.calculate_alpha_and_initial_discharge_for_kinematic_wave() + # alpha parameter and initial discharge variable needed for kinematic wave + alpha, dischargeInitial = \ + self.calculate_alpha_and_initial_discharge_for_kinematic_wave(channelStorageForRouting, \ + self.water_height, \ + self.innundatedFraction, self.floodDepth) # at the lake/reservoir outlets, use the discharge of water bofy outflow + waterBodyOutflowInM3PerSec = pcr.cover( + pcr.ifthen(\ + self.WaterBodies.waterBodyOut,\ + self.WaterBodies.waterBodyOutflow), 0.0) / vos.secondsPerDay() waterBodyOutflowInM3PerSec = pcr.ifthen(\ - pcr.scalar(self.WaterBodies.waterBodyIds) > 0.0, - self.WaterBodies.waterBodyOutflow) / vos.secondsPerDay() + pcr.scalar(self.WaterBodies.waterBodyIds) > 0.0, \ + waterBodyOutflowInM3PerSec) dischargeInitial = pcr.cover(waterBodyOutflowInM3PerSec, dischargeInitial) # discharge (m3/s) based on kinematic wave approximation - logger.info('start pcr.kinematic') + #~ logger.debug('start pcr.kinematic') self.subDischarge = pcr.kinematic(self.lddMap, dischargeInitial, 0.0, alpha, self.beta, \ - 1, length_of_sub_time_step, self.cellLengthFD) - logger.info('done') + 1, length_of_sub_time_step, self.channelLength) + self.subDischarge = pcr.cover(self.subDischarge, 0.0) + self.subDischarge = pcr.max(0.0, pcr.cover(self.subDischarge, 0.0)) + #~ logger.debug('done') + + # make sure that we do not get negative channel storage + self.subDischarge = pcr.min(self.subDischarge * length_of_sub_time_step, \ + pcr.max(0.0, channelStorageForRouting + pcr.upstream(self.lddMap, self.subDischarge * length_of_sub_time_step)))/length_of_sub_time_step # update channelStorage (m3) - storage_change_in_volume = pcr.upstream(self.lddMap, self.subDischarge * length_of_sub_time_step) - self.subDischarge * length_of_sub_time_step + storage_change_in_volume = pcr.upstream(self.lddMap, self.subDischarge * length_of_sub_time_step) - \ + self.subDischarge * length_of_sub_time_step channelStorageForRouting += storage_change_in_volume # # route only non negative channelStorage (otherwise stay): channelStorageThatWillNotMove += pcr.ifthenelse(channelStorageForRouting < 0.0, channelStorageForRouting, 0.0) channelStorageForRouting = pcr.max(0.000, channelStorageForRouting) - # - # update water_height (this will be passed to the next loop) - self.water_height = channelStorageForRouting / (pcr.max(self.min_fracwat_for_water_height, self.dynamicFracWat * self.cellArea)) + + # update flood fraction and flood depth + self.inundatedFraction, self.floodDepth = self.returnInundationFractionAndFloodDepth(channelStorageForRouting) + + # update dynamicFracWat: fraction of surface water bodies (dimensionless) including lakes and reservoirs + # - lake and reservoir surface water fraction + self.dynamicFracWat = pcr.cover(\ + pcr.min(1.0, self.WaterBodies.fracWat), 0.0) + # - fraction of channel (including its excess above bankfull capacity) + self.dynamicFracWat += pcr.max(0.0, 1.0 - self.dynamicFracWat) * pcr.max(self.channelFraction, self.innundatedFraction) + # - maximum value of dynamicFracWat is 1.0 + self.dynamicFracWat = pcr.ifthen(self.landmask, pcr.min(1.0, self.dynamicFracWat)) + + # estimate water_height for the next loop + # - needed to estimate the channel wetted area (for the calculation of alpha and dischargeInitial) + self.water_height = channelStorageForRouting / (pcr.max(self.min_fracwat_for_water_height, self.dynamicFracWat) * self.cellArea) + # TODO: Check whether the usage of dynamicFracWat provides any problems? # total discharge_volume (m3) until this present i_loop if i_loop == 0: discharge_volume = pcr.scalar(0.0) @@ -521,17 +819,16 @@ def update(self,landSurface,groundwater,currTimeStep,meteo): self.WaterBodies.getParameterFiles(currTimeStep,\ self.cellArea,\ self.lddMap,\ - self.cellLengthFD,\ - self.cellSizeInArcDeg,\ initial_conditions_for_water_bodies) # the last line is for the initial conditions of lakes/reservoirs if (currTimeStep.doy == 1) and (currTimeStep.timeStepPCR > 1): self.WaterBodies.getParameterFiles(currTimeStep,\ self.cellArea,\ - self.lddMap,\ - self.cellLengthFD,\ - self.cellSizeInArcDeg) + self.lddMap) # + if self.includeWaterBodies == False: + self.WaterBodies.waterBodyIds = pcr.ifthen(self.landmask, pcr.nominal(-1)) # ignoring all lakes and reservoirs + # downstreamDemand (m3/s) for reservoirs # - this one must be called before updating timestepsToAvgDischarge # - estimated based on environmental flow discharge @@ -539,54 +836,81 @@ def update(self,landSurface,groundwater,currTimeStep,meteo): # get routing/channel parameters/dimensions (based on avgDischarge) # and estimating water bodies fraction ; this is needed for calculating evaporation from water bodies - # - self.yMean, self.wMean, self.characteristicDistance = \ - self.getRoutingParamAvgDischarge(self.avgDischarge,\ - self.dist2celllength) - # - channelFraction = pcr.max(0.0, pcr.min(1.0,\ - self.wMean * self.cellLengthFD / (self.cellArea))) - self.dynamicFracWat = \ - pcr.max(channelFraction, self.WaterBodies.fracWat) - self.dynamicFracWat = pcr.ifthen(self.landmask, self.dynamicFracWat) - + self.yMean, self.wMean = \ + self.getRoutingParamAvgDischarge(self.avgDischarge) + + # channel width (unit: m) + self.channelWidth = self.wMean + + # channel depth (unit: m) + self.channelDepth = pcr.max(0.0, self.yMean) + # + # option to use constant channel depth (m) + if not isinstance(self.predefinedChannelDepth, types.NoneType):\ + self.channelDepth = pcr.cover(self.predefinedChannelDepth, self.channelDepth) + + # channel bankfull capacity (unit: m3) + if self.floodPlain: + if self.usingFixedBankfullCapacity: + self.channelStorageCapacity = self.predefinedBankfullCapacity + else: + self.channelStorageCapacity = self.estimateBankfullCapacity(self.channelWidth, \ + self.channelDepth) + + # fraction of channel (dimensionless) + # - mininum inundated fraction + self.channelFraction = pcr.max(0.0, pcr.min(1.0,\ + self.channelWidth * self.channelLength / (self.cellArea))) + + # fraction of innundation due to flood (dimensionless) and flood/innundation depth (m) + self.innundatedFraction, self.floodDepth = self.returnInundationFractionAndFloodDepth(self.channelStorage) + + # fraction of surface water bodies (dimensionless) including lakes and reservoirs + # - lake and reservoir surface water fraction + self.dynamicFracWat = pcr.cover(\ + pcr.min(1.0, self.WaterBodies.fracWat), 0.0) + # - fraction of channel (including its excess above bankfull capacity) + self.dynamicFracWat += pcr.max(0.0, 1.0 - self.dynamicFracWat) * pcr.max(self.channelFraction, self.innundatedFraction) + # - maximum value of dynamicFracWat is 1.0 + self.dynamicFracWat = pcr.ifthen(self.landmask, pcr.min(1.0, self.dynamicFracWat)) # routing methods if self.method == "accuTravelTime" or self.method == "simplifiedKinematicWave": \ - self.simple_update(landSurface,groundwater,currTimeStep,meteo) + self.simple_update(landSurface, groundwater, currTimeStep, meteo) # if self.method == "kinematicWave": \ - self.kinematic_wave_update(landSurface,groundwater,currTimeStep,meteo) + self.kinematic_wave_update(landSurface, groundwater, currTimeStep, meteo) # NOTE that this method require abstraction from fossil groundwater. # infiltration from surface water bodies (rivers/channels, as well as lakes and/or reservoirs) to groundwater bodies # - this exchange fluxes will be handed in the next time step # - in the future, this will be the interface between PCR-GLOBWB & MODFLOW (based on the difference between surface water levels & groundwater heads) # - self.calculate_exchange_to_groundwater(groundwater,currTimeStep) + self.calculate_exchange_to_groundwater(groundwater, currTimeStep) # volume water released in pits (losses: to the ocean / endorheic basin) self.outgoing_volume_at_pits = pcr.ifthen(self.landmask, pcr.cover( pcr.ifthen(self.lddMap == pcr.ldd(5), self.Q), 0.0)) - # # TODO: accumulate water in endorheic basins that are considered as lakes/reservoirs - + # estimate volume of water that can be extracted for abstraction in the next time step - self.readAvlChannelStorage = self.estimate_available_volume_for_abstraction(self.channelStorage) + self.readAvlChannelStorage = pcr.max(0.0, self.estimate_available_volume_for_abstraction(self.channelStorage)) # old-style reporting self.old_style_routing_reporting(currTimeStep) # TODO: remove this one - def calculate_potential_evaporation(self,landSurface,currTimeStep,meteo): + def calculate_potential_evaporation(self,landSurface,currTimeStep,meteo,definedDynamicFracWat = None): + if self.no_zero_crop_water_coefficient == False: self.waterKC = 0.0 + # potential evaporation from water bodies # current principle: # - if landSurface.actualET < waterKC * meteo.referencePotET * self.fracWat # then, we add more evaporation # - if (currTimeStep.day == 1) or (currTimeStep.timeStepPCR == 1): + if (currTimeStep.day == 1) or (currTimeStep.timeStepPCR == 1) and self.no_zero_crop_water_coefficient: waterKC = vos.netcdf2PCRobjClone(self.fileCropKC,'kc', \ currTimeStep.fulldate, useDoy = 'month',\ cloneMapFileName = self.cloneMap) @@ -601,7 +925,8 @@ def calculate_potential_evaporation(self,landSurface,currTimeStep,meteo): landSurface.actualET )) # These values are NOT over the entire cell area. # potential evaporation from water bodies over the entire cell area (m/day) - waterBodyPotEvap = waterBodyPotEvapOvesSurfaceWaterArea * self.dynamicFracWat + if definedDynamicFracWat == None: dynamicFracWat = self.dynamicFracWat + waterBodyPotEvap = waterBodyPotEvapOvesSurfaceWaterArea * dynamicFracWat return waterBodyPotEvap def calculate_evaporation(self,landSurface,groundwater,currTimeStep,meteo): @@ -625,28 +950,6 @@ def calculate_evaporation(self,landSurface,groundwater,currTimeStep,meteo): self.waterBodyEvaporation = volLocEvapWaterBody / self.cellArea self.waterBodyEvaporation = pcr.ifthen(self.landmask, self.waterBodyEvaporation) - # remaining potential evaporation (m) from water bodies - self.remainWaterBodyPotEvap = pcr.max(0.0, self.waterBodyPotEvap - self.waterBodyEvaporation) - - def calculate_extra_evaporation(self): - # limited to self.remainWaterBodyPotEvap: remaining potential evaporation (m) from water bodies - - # evaporation volume from water bodies (m3) - limited to available channelStorage - volLocEvapWaterBody = pcr.min(\ - pcr.max(0.0,self.channelStorage), - self.remainWaterBodyPotEvap * self.dynamicFracWat * self.cellArea) - - # update channelStorage (m3) after evaporation from water bodies - self.channelStorage = self.channelStorage -\ - volLocEvapWaterBody - self.local_input_to_surface_water -= volLocEvapWaterBody - - # update evaporation (m) from water bodies - self.waterBodyEvaporation += volLocEvapWaterBody / self.cellArea - - # remaining potential evaporation (m) from water bodies - self.remainWaterBodyPotEvap = pcr.max(0.0, self.remainWaterBodyPotEvap - volLocEvapWaterBody / self.cellArea) - def calculate_exchange_to_groundwater(self,groundwater,currTimeStep): if self.debugWaterBalance:\ @@ -656,7 +959,7 @@ def calculate_exchange_to_groundwater(self,groundwater,currTimeStep): # # - current implementation based on Inge's principle (later, will be based on groundater head (MODFLOW) and can be negative) # - happening only if 0.0 < baseflow < total_groundwater_abstraction - # - total_groundwater_abstraction = groundwater.nonFossilGroundwaterAbs + groundwater.unmetDemand + # - total_groundwater_abstraction: from fossil and non fossil # - infiltration rate will be based on aquifer saturated conductivity # - limited to fracWat # - limited to available channelStorage @@ -664,21 +967,30 @@ def calculate_exchange_to_groundwater(self,groundwater,currTimeStep): # - References: de Graaf et al. (2014); Wada et al. (2012); Wada et al. (2010) # - TODO: This concept should be IMPROVED. # - riverbedConductivity = groundwater.kSatAquifer # unit: m/day - total_groundwater_abstraction = pcr.max(0.0, groundwater.nonFossilGroundwaterAbs + groundwater.unmetDemand) # unit: m - self.riverbedExchange = pcr.max(0.0,\ - pcr.min(pcr.max(0.0,self.channelStorage),\ - pcr.ifthenelse(groundwater.baseflow > 0.0, \ - pcr.ifthenelse(total_groundwater_abstraction > groundwater.baseflow, \ - riverbedConductivity * self.dynamicFracWat * self.cellArea, \ - 0.0), 0.0))) - self.riverbedExchange = pcr.cover(self.riverbedExchange, 0.0) - factor = 0.05 # to avoid flip flop - self.riverbedExchange = pcr.min(self.riverbedExchange, (1.0-factor)*pcr.max(0.0,self.channelStorage)) - self.riverbedExchange = pcr.ifthenelse(self.channelStorage < 0.0, 0.0, self.riverbedExchange) - self.riverbedExchange = pcr.cover(self.riverbedExchange, 0.0) - self.riverbedExchange = pcr.ifthen(self.landmask, self.riverbedExchange) - + if groundwater.useMODFLOW: + + # river bed exchange have been calculated within the MODFLOW (via baseflow variable) + + self.riverbedExchange = pcr.scalar(0.0) + + else: + + riverbedConductivity = groundwater.riverBedConductivity # unit: m/day + riverbedConductivity = pcr.min(0.1, riverbedConductivity) # maximum conductivity is 0.1 m/day (as recommended by Marc Bierkens: resistance = 1 day for 0.1 m river bed thickness) + total_groundwater_abstraction = pcr.max(0.0, groundwater.nonFossilGroundwaterAbs + groundwater.fossilGroundwaterAbstr) # unit: m + self.riverbedExchange = pcr.max(0.0,\ + pcr.min(pcr.max(0.0,self.channelStorage),\ + pcr.ifthenelse(groundwater.baseflow > 0.0, \ + pcr.ifthenelse(total_groundwater_abstraction > groundwater.baseflow, \ + riverbedConductivity * self.dynamicFracWat * self.cellArea, \ + 0.0), 0.0))) + self.riverbedExchange = pcr.cover(self.riverbedExchange, 0.0) + factor = 0.25 # to avoid flip flop + self.riverbedExchange = pcr.min(self.riverbedExchange, (1.0-factor)*pcr.max(0.0,self.channelStorage)) + self.riverbedExchange = pcr.ifthenelse(self.channelStorage < 0.0, 0.0, self.riverbedExchange) + self.riverbedExchange = pcr.cover(self.riverbedExchange, 0.0) + self.riverbedExchange = pcr.ifthen(self.landmask, self.riverbedExchange) + # update channelStorage (m3) after riverbedExchange (m3) self.channelStorage -= self.riverbedExchange self.local_input_to_surface_water -= self.riverbedExchange @@ -693,126 +1005,13 @@ def calculate_exchange_to_groundwater(self,groundwater,currTimeStep): currTimeStep.fulldate,threshold=1e-4) - def reduce_unmet_demand(self,landSurface,groundwater,currTimeStep): - - logger.info("Reducing unmetDemand by allowing extra surface water abstraction.") - - extra_surface_water_abstraction = pcr.scalar(0.0) - reduction_for_unmetDemand = pcr.scalar(0.0) - - # estimate channel storage that can be extracted (unit: m3) - self.readAvlChannelStorage = self.estimate_available_volume_for_abstraction(self.channelStorage) - - # potential_unmet_demand (unit: m) - potential_unmet_demand = landSurface.totalPotentialGrossDemand -\ - landSurface.allocSurfaceWaterAbstract -\ - groundwater.allocNonFossilGroundwater - - if self.debugWaterBalance: - test = pcr.ifthen(potential_unmet_demand < 0.0, potential_unmet_demand) - a,b,c = vos.getMinMaxMean(pcr.scalar(test),True) - threshold = 1e-3 - if abs(a) > threshold or abs(b) > threshold: - logger.info("WARNING !!!!! Water Balance Error. There is negative unmetDemand ... Min %f Max %f Mean %f" %(a,b,c)) - - if landSurface.usingAllocSegments == False and landSurface.limitAbstraction == False: - - logger.info("Surface water abstraction is only to satisfy local demand. No network.") - - # reduction_for_unmetDemand - reduction_for_unmetDemand = pcr.min(self.readAvlChannelStorage / self.cellArea, \ - potential_unmet_demand) # unit: m - - # actual extra surface water abstraction in meter - extra_surface_water_abstraction = pcr.ifthen(self.landmask, reduction_for_unmetDemand) - - - if landSurface.usingAllocSegments == True and landSurface.limitAbstraction == False: - - # TODO: Assuming that there is also network for distributing groundwater abstractions. - # Notes: Incorporating distribution network of groundwater source is possible only if limitAbstraction = False. - - logger.info("Using allocation to reduce unmetDemand.") - - # gross/potential demand volume in each cell (unit: m3) - ignore small values (less than 1 m3) - cellVolGrossDemand = pcr.rounddown( - potential_unmet_demand*self.cellArea) - - # demand in each segment/zone (unit: m3) - segTtlGrossDemand = pcr.areatotal(cellVolGrossDemand, landSurface.allocSegments) - - # total available water volume in each cell - ignore small values (less than 1 m3) - cellAvlWater = pcr.rounddown(pcr.max(0.00, self.readAvlChannelStorage)) - - # total available surface water volume in each segment/zone (unit: m3) - segAvlWater = pcr.areatotal(cellAvlWater, landSurface.allocSegments) - - # total actual extra surface water abstraction volume in each segment/zone (unit: m3) - # - limited to available water - segActWaterAbs = pcr.min(segAvlWater, segTtlGrossDemand) - - # actual extra surface water abstraction volume in each cell (unit: m3) - volActWaterAbstract = vos.getValDivZero(\ - cellAvlWater, segAvlWater, vos.smallNumber) * \ - segActWaterAbs - volActWaterAbstract = pcr.min(cellAvlWater,volActWaterAbstract) # unit: m3 - - # actual extra surface water abstraction in meter - extra_surface_water_abstraction = pcr.ifthen(self.landmask, volActWaterAbstract) /\ - self.cellArea # unit: m - - # allocation extra surface water abstraction volume to each cell (unit: m3) - extraVolAllocSurfaceWaterAbstract = vos.getValDivZero(\ - cellVolGrossDemand, segTtlGrossDemand, vos.smallNumber) *\ - segActWaterAbs # unit: m3 - # reduction for unmetDemand (unit: m) - reduction_for_unmetDemand = pcr.ifthen(self.landmask, - extraVolAllocSurfaceWaterAbstract / self.cellArea) # unit: m - - if self.debugWaterBalance: - - abstraction = pcr.cover(pcr.areatotal(volActWaterAbstract , landSurface.allocSegments)/landSurface.segmentArea, 0.0) - allocation = pcr.cover(pcr.areatotal(extraVolAllocSurfaceWaterAbstract, landSurface.allocSegments)/landSurface.segmentArea, 0.0) - - vos.waterBalanceCheck([pcr.ifthen(self.landmask,abstraction)],\ - [pcr.ifthen(self.landmask, allocation)],\ - [pcr.scalar(0.0)],\ - [pcr.scalar(0.0)],\ - 'extra surface water abstraction - allocation per zone/segment (PS: Error here may be caused by rounding error.)' ,\ - True,\ - "",threshold=5e-4) - - # correcting surface water abstraction - landSurface.actSurfaceWaterAbstract += extra_surface_water_abstraction # unit: m - - # update channelStorage (m3) after extra_surface_water_abstraction - self.channelStorage = self.channelStorage -\ - extra_surface_water_abstraction * self.cellArea - self.local_input_to_surface_water -= extra_surface_water_abstraction * self.cellArea - - # correcting surface water allocation after reduction of unmetDemand - landSurface.allocSurfaceWaterAbstract += reduction_for_unmetDemand # unit: m - - # recalculating unmetDemand (m) - groundwater.unmetDemand = landSurface.totalPotentialGrossDemand -\ - landSurface.allocSurfaceWaterAbstract -\ - groundwater.allocNonFossilGroundwater - - if self.debugWaterBalance: - - test = pcr.ifthen(groundwater.unmetDemand < 0.0, groundwater.unmetDemand) - a,b,c = vos.getMinMaxMean(pcr.scalar(test),True) - threshold = 1e-3 - if abs(a) > threshold or abs(b) > threshold: - logger.info("WARNING !!!!! Water Balance Error. There is negative unmetDemand ... Min %f Max %f Mean %f" %(a,b,c)) - def simple_update(self,landSurface,groundwater,currTimeStep,meteo): # updating timesteps to calculate long and short term statistics values of avgDischarge, avgInflow, avgOutflow, etc. self.timestepsToAvgDischarge += 1. if self.debugWaterBalance:\ - preStorage = self.channelStorage # unit: m3 + preStorage = self.channelStorage # unit: m3 # the following variable defines total local change (input) to surface water storage bodies # unit: m3 # - only local processes; therefore not considering any routing processes @@ -834,30 +1033,28 @@ def simple_update(self,landSurface,groundwater,currTimeStep,meteo): self.channelStorageAfterAbstraction = pcr.ifthen(self.landmask, self.channelStorage) # return flow from (m) non irrigation water demand - self.nonIrrReturnFlow = landSurface.nonIrrReturnFlowFraction*\ - landSurface.nonIrrGrossDemand # m - nonIrrReturnFlowVol = self.nonIrrReturnFlow*self.cellArea + # - calculated in the landSurface.py module + nonIrrReturnFlowVol = landSurface.nonIrrReturnFlow*self.cellArea self.channelStorage += nonIrrReturnFlowVol self.local_input_to_surface_water += nonIrrReturnFlowVol - # water consumption for non irrigation water demand (m) - this water is removed from the water balance - self.nonIrrWaterConsumption = landSurface.nonIrrGrossDemand - \ - self.nonIrrReturnFlow - # - # Note that in case of limitAbstraction = True ; landSurface.nonIrrGrossDemand has been reduced by available water + # water consumption for non irrigation water demand (m) - this water is removed from the system/water balance + self.nonIrrWaterConsumption = pcr.max(0.0,\ + landSurface.nonIrrGrossDemand - \ + landSurface.nonIrrReturnFlow) # calculate evaporation from water bodies - this will return self.waterBodyEvaporation (unit: m) - self.calculate_evaporation(landSurface,groundwater,currTimeStep,meteo) + self.calculate_evaporation(landSurface, groundwater, currTimeStep, meteo) if self.debugWaterBalance:\ vos.waterBalanceCheck([self.runoff,\ - self.nonIrrReturnFlow],\ + landSurface.nonIrrReturnFlow],\ [landSurface.actSurfaceWaterAbstract,self.waterBodyEvaporation],\ [ preStorage/self.cellArea],\ [ self.channelStorage/self.cellArea],\ 'channelStorage (unit: m) before lake/reservoir outflow',\ True,\ - currTimeStep.fulldate,threshold=1e-4) + currTimeStep.fulldate,threshold=5e-3) # LAKE AND RESERVOIR OPERATIONS ########################################################################################################################## @@ -886,7 +1083,8 @@ def simple_update(self,landSurface,groundwater,currTimeStep,meteo): self.downstreamDemand) # waterBodyStorage (m3) after outflow: # values given are per water body id (not per cell) - self.waterBodyStorage = self.WaterBodies.waterBodyStorage + self.waterBodyStorage = pcr.ifthen(self.landmask, + self.WaterBodies.waterBodyStorage) # transfer outflow from lakes and/or reservoirs to channelStorages waterBodyOutflow = pcr.cover(\ @@ -946,39 +1144,174 @@ def simple_update(self,landSurface,groundwater,currTimeStep,meteo): # calculate the statistics of long and short term flow values self.calculate_statistics(groundwater) - self.allow_extra_evaporation_and_abstraction = False # This option is still EXPERIMENTAL (and not recommended) - if self.allow_extra_evaporation_and_abstraction:\ - self.update_with_extra_evaporation_and_unmet_demand_reduction() - # return waterBodyStorage to channelStorage self.channelStorage = self.return_water_body_storage_to_channel(self.channelStorage) - def update_with_extra_evaporation_and_unmet_demand_reduction(self): - # This function is still EXPERIMENTAL (and not recommended) + def calculate_alpha_and_initial_discharge_for_kinematic_wave(self, channelStorage, water_height, innundatedFraction, floodDepth): - # add extra evaporation - self.calculate_extra_evaporation() - # reduce fossil groundwater storage abstraction (unmetDemand) - if groundwater.limitAbstraction == False: self.reduce_unmet_demand(landSurface,groundwater,currTimeStep) + # calculate alpha (dimensionless), which is the roughness coefficient + # - for kinewatic wave (see: http://pcraster.geo.uu.nl/pcraster/4.0.0/doc/manual/op_kinematic.html) + # - based on wetted area (m2) and wetted perimeter (m), as well as self.beta (dimensionless) + # - assuming rectangular channel + # - flood innundated areas with + + # channel wetted area (m2) + # - the minimum wetted area is: water height x channel width (Edwin introduce this) + # - channel wetted area is mainly based on channelStorage and channelLength (Rens's approach) + channel_wetted_area = water_height * self.channelWidth + channel_wetted_area = pcr.max(channel_wetted_area,\ + channelStorage / self.channelLength) + + # wetted perimeter + flood_only_wetted_perimeter = floodDepth * (2.0) + \ + pcr.max(0.0, innundatedFraction*self.cellArea/self.channelLength - self.channelWidth) + channel_only_wetted_perimeter = \ + pcr.min(self.channelDepth, vos.getValDivZero(channelStorage, self.channelLength*self.channelWidth, 0.0)) * 2.0 + \ + self.channelWidth + # total channel wetted perimeter (unit: m) + channel_wetted_perimeter = channel_only_wetted_perimeter + \ + flood_only_wetted_perimeter + # minimum channel wetted perimeter = 10 cm + channel_wetted_perimeter = pcr.max(0.1, channel_wetted_perimeter) + + # corrected Manning's coefficient: + if self.floodPlain: + usedManningsN = ((channel_only_wetted_perimeter/channel_wetted_perimeter) * self.manningsN**(1.5) + \ + ( flood_only_wetted_perimeter/channel_wetted_perimeter) * self.floodplainManN**(1.5))**(2./3.) + else: + usedManningsN = self.manningsN + + # alpha (dimensionless) and initial estimate of channel discharge (m3/s) + # + alpha = (usedManningsN*channel_wetted_perimeter**(2./3.)*self.gradient**(-0.5))**self.beta # dimensionless + dischargeInitial = pcr.ifthenelse(alpha > 0.0,\ + (channel_wetted_area / alpha)**(1.0/self.beta), 0.0) # unit: m3 + + return (alpha, dischargeInitial) - def calculate_alpha_and_initial_discharge_for_kinematic_wave(self): + def calculate_alpha_and_initial_discharge_for_kinematic_wave_OLD(self, channelStorage = None): # calculate alpha (dimensionless), which is the roughness coefficient # - for kinewatic wave (see: http://pcraster.geo.uu.nl/pcraster/4.0.0/doc/manual/op_kinematic.html) # - based on wetted area (m2) and wetted perimeter (m), as well as self.beta (dimensionless) - # - assuming rectangular channel with channel_width = self.wMean and channel_length = self.dist2celllength - # - channel_wetted_area = self.water_height * self.wMean # unit: m2 - channel_wetted_perimeter = 2*self.water_height + self.wMean # unit: m - # - alpha = (self.manningsN*channel_wetted_perimeter**(2./3.)*self.gradient**(-0.5))**self.beta # dimensionless + # - assuming rectangular channel + + # Manning's coefficient: + usedManningsN = self.manningsN - # estimate of channel discharge (m3/s) based on water height + # channel wetted area (m2) + # - alternative 1: based on channelStorage and channelLength (Rens's approach) + channel_wetted_area = self.water_height * self.channelWidth + # - alternative 2: the minimum wetted are is: water height x channel width (Edwin introduce this) + channel_wetted_area = pcr.max(channel_wetted_area,\ + channelStorage / self.channelLength) # unit: m2 + + # channel wetted perimeter (m) + channel_wetted_perimeter = 2.0*channel_wetted_area/self.channelWidth + self.channelWidth # unit: m + + # flood fraction (dimensionless) and flood depth (unit: m) + floodFraction = pcr.scalar(0.0) + floodDepth = pcr.scalar(0.0) + + if self.floodPlain: + + # return flood fraction and flood/innundation depth above the flood plain + floodFraction, floodDepth = self.returnInundationFractionAndFloodDepth(channelStorage) + + # wetted perimeter + flood_only_wetted_perimeter = pcr.max(0.0, floodFraction*self.cellArea/self.channelLength - self.channelWidth) + \ + floodDepth * (2.0) + channel_only_wetted_perimeter = \ + self.channelWidth + \ + 2.0 * pcr.min(self.channelDepth, channelStorage/(self.channelLength*self.channelWidth)) + # + channel_wetted_perimeter = channel_only_wetted_perimeter + flood_only_wetted_perimeter # unit: m + + # corrected Manning's coefficient: + usedManningsN = ((channel_only_wetted_perimeter/channel_wetted_perimeter) * self.manningsN**(1.5) + \ + ( flood_only_wetted_perimeter/channel_wetted_perimeter) * self.floodplainManN**(1.5))**(2./3.) + + # alpha (dimensionless) and estimate of channel discharge (m3/s) # + alpha = (usedManningsN*channel_wetted_perimeter**(2./3.)*self.gradient**(-0.5))**self.beta # dimensionless dischargeInitial = pcr.ifthenelse(alpha > 0.0,\ - (self.water_height * self.wMean / alpha)**(1/self.beta),0.0) - return (alpha, dischargeInitial) + (channel_wetted_area / alpha)**(1.0/self.beta), 0.0) # unit: m3 + + return (alpha, dischargeInitial, floodFraction, floodDepth) + def integralLogisticFunction(self,x): + + # returns a tupple of two values holding the integral of the logistic functions of (x) and (-x) + + logInt=pcr.ln(pcr.exp(-x)+1) + + return logInt,x+logInt + + def returnInundationFractionAndFloodDepth(self, channelStorage): + + # flood/innundation depth above the flood plain (unit: m) + floodDepth = 0.0 + + # channel and flood innundated fraction (dimensionless, the minimum value is channelFraction) + inundatedFraction = self.channelFraction + + if self.floodPlain: + + msg = 'Calculate channel inundated fraction and flood inundation depth above the floodplain.' + logger.info(msg) + + # given the flood channel volume: channelStorage + # - return the flooded fraction and the associated water height + # - using a logistic smoother near intersections (K&K, 2007) + + # flood/innundation/excess volume (excess above the bankfull capacity, unit: m3) + excessVolume = pcr.max(0.0, channelStorage - self.channelStorageCapacity) + + # find the match on the basis of the shortest distance + # to the available intersections or steps + # + deltaXMin = self.floodVolume[self.nrZLevels-1] + y_i = pcr.scalar(1.0) + k = [pcr.scalar(0.0)]*2 + mInt = pcr.scalar(0.0) + for iCnt in range(self.nrZLevels-1,0,-1): + # - find x_i for current volume and update match if applicable + # also update slope and intercept + deltaX = excessVolume - self.floodVolume[iCnt] + mask = pcr.abs(deltaX) < pcr.abs(deltaXMin) + deltaXMin = pcr.ifthenelse(mask, deltaX, deltaXMin) + y_i = pcr.ifthenelse(mask, self.areaFractions[iCnt], y_i) + k[0] = pcr.ifthenelse(mask, self.kSlope[iCnt-1], k[0]) + k[1] = pcr.ifthenelse(mask, self.kSlope[iCnt], k[1]) + mInt = pcr.ifthenelse(mask, self.mInterval[iCnt], mInt) + + # all values returned, process data: calculate scaled deltaX and smoothed function + # on the basis of the integrated logistic functions PHI(x) and 1-PHI(x) + # + deltaX = deltaXMin + deltaXScaled = pcr.ifthenelse(deltaX < 0.,pcr.scalar(-1.),1.)*\ + pcr.min(self.criterionKK,pcr.abs(deltaX/pcr.max(1.,mInt))) + logInt = self.integralLogisticFunction(deltaXScaled) + + # compute fractional inundated/flooded area + inundatedFraction = pcr.ifthenelse(excessVolume > 0.0,\ + pcr.ifthenelse(pcr.abs(deltaXScaled) < self.criterionKK,\ + y_i-k[0]*mInt*logInt[0]+k[1]*mInt*logInt[1],\ + y_i+pcr.ifthenelse(deltaX < 0.,k[0],k[1])*deltaX), 0.0) + # - minimum value is channelFraction + inundatedFraction = pcr.max(self.channelFraction, inundatedFraction) + # - maximum value is 1.0 + inundatedFraction = pcr.max(0.,pcr.min(1.0, inundatedFraction)) # dimensionless + + # calculate flooded/inundated depth (unit: m) above the floodplain + #_- it will be zero if excessVolume == 0 + floodDepth = pcr.ifthenelse(inundatedFraction > 0., \ + excessVolume/(pcr.max(self.min_fracwat_for_water_height, inundatedFraction)*self.cellArea),0.) # unit: m + # - maximum flood depth + max_flood_depth = 25.0 + floodDepth = pcr.max(0.0, pcr.min(max_flood_depth, floodDepth)) + + return inundatedFraction, floodDepth def return_water_body_storage_to_channel(self, channelStorage): @@ -1014,34 +1347,33 @@ def kinematic_wave_update(self, landSurface,groundwater,currTimeStep,meteo): # values of avgDischarge, avgInflow, avgOutflow, etc. self.timestepsToAvgDischarge += 1. + # the following variable defines total local change (input) to surface water storage bodies # unit: m3 + # - only local processes; therefore not considering any routing processes + self.local_input_to_surface_water = pcr.scalar(0.0) # initiate the variable, start from zero + + # For simplification, surface water abstraction + # is done outside the sub daily time steps. + # + # update channelStorage (unit: m3) after actSurfaceWaterAbstraction + self.channelStorage -= landSurface.actSurfaceWaterAbstract * self.cellArea + self.local_input_to_surface_water -= landSurface.actSurfaceWaterAbstract * self.cellArea + # + # reporting channelStorage after surface water abstraction (unit: m3) + self.channelStorageAfterAbstraction = pcr.ifthen(self.landmask, self.channelStorage) + + + # return flow from (m) non irrigation water demand + # - calculated in the landSurface.py module: landSurface.nonIrrReturnFlow + + # water consumption for non irrigation water demand (m) - this water is removed from the system/water balance + self.nonIrrWaterConsumption = pcr.max(0.0,\ + landSurface.nonIrrGrossDemand - \ + landSurface.nonIrrReturnFlow) + # runoff from landSurface cells (unit: m/day) self.runoff = landSurface.landSurfaceRunoff +\ groundwater.baseflow # values are over the entire cell area - # return flow from non irrigation water demand (unit: m/day) - self.nonIrrReturnFlow = landSurface.nonIrrReturnFlowFraction*\ - landSurface.nonIrrGrossDemand # values are over the entire cell area - # - # Note that in case of limitAbstraction = True ; landSurface.nonIrrGrossDemand has been reduced by available water - # - # water consumption for non irrigation water demand (m/day) ; this water is removed from the system - self.nonIrrWaterConsumption = landSurface.nonIrrGrossDemand - \ - self.nonIrrReturnFlow # values are over the entire cell area - - # potential evaporation (unit: m/day) - self.waterBodyPotEvap = \ - self.calculate_potential_evaporation(landSurface,currTimeStep,\ - meteo) # values are over the entire cell area - - # surface_water_demand (unit: m/day) - # - this is based on landSurface.totalPotentialGrossDemand - # - the 'landSurface.actSurfaceWaterAbstract' and 'landSurface.allocSurfaceWaterAbstract' will be corrected - # - however, the "groundwater.nonFossilGroundwaterAbs" and "groundwater.allocNonFossilGroundwater" should remain the same - # - consequently, the "groundwater.unmetDemand" will be corrected - # - surface_water_demand = landSurface.totalPotentialGrossDemand -\ - groundwater.allocNonFossilGroundwater - # route only non negative channelStorage (otherwise stay): # - note that, the following includes storages in channelStorageThatWillNotMove = pcr.ifthenelse(self.channelStorage < 0.0, self.channelStorage, 0.0) @@ -1049,12 +1381,14 @@ def kinematic_wave_update(self, landSurface,groundwater,currTimeStep,meteo): # channelStorage that will be given to the ROUTING operation: channelStorageForRouting = pcr.max(0.0, self.channelStorage) # unit: m3 - # water height (m) - self.water_height = channelStorageForRouting / (pcr.max(self.min_fracwat_for_water_height, self.dynamicFracWat * self.cellArea)) - + # estimate of water height (m) + # - needed to estimate the length of sub-time step and + # also to estimate the channel wetted area (for the calculation of alpha and dischargeInitial) + self.water_height = channelStorageForRouting /\ + (pcr.max(self.min_fracwat_for_water_height, self.dynamicFracWat) * self.cellArea) + # estimate the length of sub-time step (unit: s): - length_of_sub_time_step, number_of_loops = \ - self.estimate_length_of_sub_time_step() + length_of_sub_time_step, number_of_loops = self.estimate_length_of_sub_time_step() ####################################################################################################################### for i_loop in range(number_of_loops): @@ -1066,141 +1400,46 @@ def kinematic_wave_update(self, landSurface,groundwater,currTimeStep,meteo): if i_loop == 0: acc_local_input_to_surface_water = pcr.scalar(0.0) # unit: m3 acc_water_body_evaporation_volume = pcr.scalar(0.0) # unit: m3 - acc_water_body_abstraction_volume = pcr.scalar(0.0) # unit: m3 - acc_water_body_allocation_volume = pcr.scalar(0.0) # unit: m3 acc_discharge_volume = pcr.scalar(0.0) # unit: m3 + if self.debugWaterBalance:\ preStorage = pcr.ifthen(self.landmask,\ channelStorageForRouting) # update channelStorageForRouting after runoff and return flow from non irrigation demand - channelStorageForRouting += (self.runoff + self.nonIrrReturnFlow) * \ + channelStorageForRouting += (self.runoff + landSurface.nonIrrReturnFlow) * \ self.cellArea * length_of_sub_time_step/vos.secondsPerDay() # unit: m3 - acc_local_input_to_surface_water += (self.runoff + self.nonIrrReturnFlow) * \ + acc_local_input_to_surface_water += (self.runoff + landSurface.nonIrrReturnFlow) * \ self.cellArea * length_of_sub_time_step/vos.secondsPerDay() # unit: m3 + # potential evaporation within the sub-time step ; unit: m, values are over the entire cell area + # + water_body_potential_evaporation = self.calculate_potential_evaporation(landSurface,currTimeStep,meteo) *\ + length_of_sub_time_step/vos.secondsPerDay() + # - accumulating potential evaporation + if i_loop == 0: + self.waterBodyPotEvap = pcr.scalar(0.0) + self.waterBodyPotEvap += water_body_potential_evaporation + # update channelStorageForRouting after evaporation water_body_evaporation_volume = pcr.min(channelStorageForRouting, \ - self.waterBodyPotEvap * self.cellArea * length_of_sub_time_step/vos.secondsPerDay()) + water_body_potential_evaporation * self.cellArea * length_of_sub_time_step/vos.secondsPerDay()) channelStorageForRouting -= water_body_evaporation_volume acc_local_input_to_surface_water -= water_body_evaporation_volume acc_water_body_evaporation_volume += water_body_evaporation_volume if self.debugWaterBalance:\ vos.waterBalanceCheck([self.runoff * length_of_sub_time_step/vos.secondsPerDay(), \ - self.nonIrrReturnFlow * length_of_sub_time_step/vos.secondsPerDay()],\ + landSurface.nonIrrReturnFlow * length_of_sub_time_step/vos.secondsPerDay()],\ [water_body_evaporation_volume/self.cellArea],\ [preStorage/self.cellArea],\ [channelStorageForRouting/self.cellArea],\ - 'channelStorageForRouting (before abstraction/allocation)',\ + 'channelStorageForRouting',\ True,\ currTimeStep.fulldate,threshold=5e-5) - # surface water abstraction and it allocation to meet surface water demand - # - # - potential abstraction during this sub time step - pot_surface_water_abstract_volume = pcr.rounddown( - surface_water_demand * \ - self.cellArea * length_of_sub_time_step/vos.secondsPerDay()) # unit: m3 - # - # - available_water (m3) for abstraction (during thus sub time step) - # - note that this includes storage in lakes and/resevoirs - available_water_volume = pcr.rounddown( - self.estimate_available_volume_for_abstraction(channelStorageForRouting)) # unit: m3 - available_water_volume = pcr.max(0.0, available_water_volume) - # - # - initiating abstraction and allocation variables (unit: m3) - water_body_abstraction_volume = pcr.scalar(0.0) - water_body_allocation_volume = pcr.scalar(0.0) - # - ########################################### - - if landSurface.limitAbstraction == True and\ - (landSurface.includeIrrigation or landSurface.domesticWaterDemandOption or landSurface.industrycWaterDemandOption): - - msg = "\n" - msg += "\n" - msg += "==================================================================================================================" - msg += "\n" - msg += "ERROR!! The option fully kinematicWave cannot be used for a run with water demand that has limitAbstraction = True" - msg += "\n" - msg += "==================================================================================================================" - msg += "\n" - msg += "\n" - msg += "\n" - logger.info(msg) - water_body_abstraction_volume = None - water_body_allocation_volume = None - - if landSurface.usingAllocSegments == False and landSurface.limitAbstraction == False and\ - (landSurface.includeIrrigation or landSurface.domesticWaterDemandOption or landSurface.industrycWaterDemandOption): - - logger.info("Surface water abstraction is only to satisfy local demand. No network.") - - # surface water abstraction - water_body_abstraction_volume = pcr.min(available_water_volume, pot_surface_water_abstract_volume) # unit: m3 - - # allocating surface water abstraction to surface water demand (no network) # unit: m3 - water_body_allocation_volume = water_body_abstraction_volume - # - if landSurface.usingAllocSegments == True and landSurface.limitAbstraction == False and \ - (landSurface.includeIrrigation or landSurface.domesticWaterDemandOption or landSurface.industrycWaterDemandOption): - - logger.info("Using surface water allocation.") - - # gross/potential demand volume in each cell (unit: m3) - cellVolGrossDemand = pot_surface_water_abstract_volume - - # demand in each segment/zone (unit: m3) - segTtlGrossDemand = pcr.areatotal(cellVolGrossDemand, landSurface.allocSegments) - - # total available water volume in each cell - ignore small values (less than 1 m3) - cellAvlWater = pcr.max(0.00, available_water_volume) - cellAvlWater = pcr.rounddown(cellAvlWater) - - # total available surface water volume in each segment/zone (unit: m3) - segAvlWater = pcr.areatotal(cellAvlWater, landSurface.allocSegments) - segAvlWater = pcr.max(0.00, segAvlWater) - - # total actual surface water abstraction volume in each segment/zone (unit: m3) - # - # - not limited to available water - ignore small values (less than 1 m3) - segActWaterAbs = pcr.rounddown(segTtlGrossDemand) - # - # - limited to available water - segActWaterAbs = pcr.min(segAvlWater, segActWaterAbs) - - # surface water abstraction in each cell (unit: m3) - volActWaterAbstract = vos.getValDivZero(\ - cellAvlWater, segAvlWater, vos.smallNumber) * \ - segActWaterAbs - water_body_abstraction_volume = pcr.min(cellAvlWater,volActWaterAbstract) - - # allocation surface water abstraction volume to each cell (unit: m3) - water_body_allocation_volume = vos.getValDivZero(\ - cellVolGrossDemand, segTtlGrossDemand, vos.smallNumber)*\ - segActWaterAbs - - if self.debugWaterBalance: - - abstraction = pcr.cover(pcr.areatotal(water_body_abstraction_volume, landSurface.allocSegments)/landSurface.segmentArea, 0.0) - allocation = pcr.cover(pcr.areatotal(water_body_allocation_volume , landSurface.allocSegments)/landSurface.segmentArea, 0.0) - - vos.waterBalanceCheck([pcr.ifthen(self.landmask,abstraction)],\ - [pcr.ifthen(self.landmask, allocation)],\ - [pcr.scalar(0.0)],\ - [pcr.scalar(0.0)],\ - 'extra surface water abstraction - allocation per zone/segment (PS: Error here may be caused by rounding error.)' ,\ - True,\ - "",threshold=5e-5) - - # - update channelStorageForRouting after abstraction - channelStorageForRouting -= water_body_abstraction_volume # unit: m3 - acc_water_body_abstraction_volume += water_body_abstraction_volume # unit: m3 - acc_water_body_allocation_volume += water_body_allocation_volume - - # lakes and reservoirs + # the kinematic wave is implemented only for channels (not to lakes and reservoirs) # at cells where lakes and/or reservoirs defined, move channelStorage to waterBodyStorage # storageAtLakeAndReservoirs = \ @@ -1212,7 +1451,45 @@ def kinematic_wave_update(self, landSurface,groundwater,currTimeStep,meteo): storageAtLakeAndReservoirs = pcr.max(0.00, pcr.rounddown(storageAtLakeAndReservoirs)) channelStorageForRouting -= storageAtLakeAndReservoirs # unit: m3 - # update waterBodyStorage (inflow, storage and outflow) + + # alpha parameter and initial discharge variable needed for kinematic wave + alpha, dischargeInitial = \ + self.calculate_alpha_and_initial_discharge_for_kinematic_wave(channelStorageForRouting, \ + self.water_height, \ + self.innundatedFraction, self.floodDepth) + + # discharge (m3/s) based on kinematic wave approximation + #~ logger.debug('start pcr.kinematic') + self.subDischarge = pcr.kinematic(self.lddMap, dischargeInitial, 0.0, + alpha, self.beta, \ + 1, length_of_sub_time_step, self.channelLength) + self.subDischarge = pcr.max(0.0, pcr.cover(self.subDischarge, 0.0)) + #~ logger.debug('done') + + # set discharge to zero for lakes and reservoirs: + self.subDischarge = pcr.cover(\ + pcr.ifthen(pcr.scalar(self.WaterBodies.waterBodyIds) > 0., pcr.scalar(0.0)), self.subDischarge) + + # make sure that we do not get negative channel storage + self.subDischarge = pcr.min(self.subDischarge * length_of_sub_time_step, \ + pcr.max(0.0, channelStorageForRouting + pcr.upstream(self.lddMap, self.subDischarge * length_of_sub_time_step)))/length_of_sub_time_step + + # update channelStorage (m3) + storage_change_in_volume = pcr.upstream(self.lddMap, self.subDischarge * length_of_sub_time_step) - self.subDischarge * length_of_sub_time_step + channelStorageForRouting += storage_change_in_volume + + if self.debugWaterBalance:\ + vos.waterBalanceCheck([self.runoff * length_of_sub_time_step/vos.secondsPerDay(), \ + landSurface.nonIrrReturnFlow * length_of_sub_time_step/vos.secondsPerDay(),\ + storage_change_in_volume/self.cellArea],\ + [water_body_evaporation_volume/self.cellArea],\ + [preStorage/self.cellArea - storageAtLakeAndReservoirs/self.cellArea],\ + [channelStorageForRouting/self.cellArea],\ + 'channelStorageForRouting (after routing, without lakes/reservoirs)',\ + True,\ + currTimeStep.fulldate,threshold=5e-4) + + # lakes and reservoirs: update waterBodyStorage (inflow, storage and outflow) self.WaterBodies.update(storageAtLakeAndReservoirs,\ self.timestepsToAvgDischarge,\ self.maxTimestepsToAvgDischargeShort,\ @@ -1223,51 +1500,27 @@ def kinematic_wave_update(self, landSurface,groundwater,currTimeStep,meteo): self.downstreamDemand) # waterBodyStorage (m3) after outflow: # values given are per water body id (not per cell) - self.waterBodyStorage = self.WaterBodies.waterBodyStorage + self.waterBodyStorage = pcr.ifthen(self.landmask, + self.WaterBodies.waterBodyStorage) # transfer outflow from lakes and/or reservoirs to channelStorages waterBodyOutflow = pcr.cover(\ pcr.ifthen(\ self.WaterBodies.waterBodyOut, self.WaterBodies.waterBodyOutflow), 0.0) # unit: m3 - + # update channelStorage (m3) after waterBodyOutflow (m3) - channelStorageForRouting += waterBodyOutflow + channelStorageForRouting += pcr.upstream(self.lddMap, waterBodyOutflow) # Note that local_input_to_surface_water does not include waterBodyOutflow - # alpha parameter and initial discharge variable needed for kinematic wave - alpha, dischargeInitial = self.calculate_alpha_and_initial_discharge_for_kinematic_wave() - - # at the lake/reservoir outlets, use the discharge of water body outflow + # at the lake/reservoir outlets, add the discharge of water body outflow waterBodyOutflowInM3PerSec = pcr.ifthen(\ self.WaterBodies.waterBodyOut, self.WaterBodies.waterBodyOutflow) / length_of_sub_time_step - dischargeInitial = pcr.cover(waterBodyOutflowInM3PerSec, dischargeInitial) - dischargeInitial = pcr.ifthen(self.landmask, dischargeInitial) - - # discharge (m3/s) based on kinematic wave approximation - logger.info('start pcr.kinematic') - self.subDischarge = pcr.kinematic(self.lddMap, dischargeInitial, 0.0, - alpha, self.beta, \ - 1, length_of_sub_time_step, self.cellLengthFD) - logger.info('done') - - # update channelStorage (m3) - storage_change_in_volume = pcr.upstream(self.lddMap, self.subDischarge * length_of_sub_time_step) - self.subDischarge * length_of_sub_time_step - channelStorageForRouting += storage_change_in_volume - - if self.debugWaterBalance:\ - vos.waterBalanceCheck([self.runoff * length_of_sub_time_step/vos.secondsPerDay(), \ - self.nonIrrReturnFlow * length_of_sub_time_step/vos.secondsPerDay(),\ - waterBodyOutflow/self.cellArea,\ - storage_change_in_volume/self.cellArea],\ - [water_body_evaporation_volume/self.cellArea,\ - water_body_abstraction_volume/self.cellArea],\ - [preStorage/self.cellArea - storageAtLakeAndReservoirs/self.cellArea],\ - [channelStorageForRouting/self.cellArea],\ - 'channelStorageForRouting (after routing, without lakes/reservoirs)',\ - True,\ - currTimeStep.fulldate,threshold=5e-4) + self.subDischarge = self.subDischarge + \ + pcr.cover(waterBodyOutflowInM3PerSec, 0.0) + self.subDischarge = pcr.ifthen(self.landmask, self.subDischarge) + # total discharge_volume (m3) until this present i_loop acc_discharge_volume += self.subDischarge * length_of_sub_time_step @@ -1279,36 +1532,30 @@ def kinematic_wave_update(self, landSurface,groundwater,currTimeStep,meteo): channelStorageThatWillNotMove += pcr.ifthenelse(channelStorageForRouting < 0.0, channelStorageForRouting, 0.0) channelStorageForRouting = pcr.max(0.000, channelStorageForRouting) - # update water_height (this will be passed to the next loop) - self.water_height = channelStorageForRouting / (pcr.max(self.min_fracwat_for_water_height, self.dynamicFracWat * self.cellArea)) + # update flood fraction and flood depth + self.inundatedFraction, self.floodDepth = self.returnInundationFractionAndFloodDepth(channelStorageForRouting) + + # update dynamicFracWat: fraction of surface water bodies (dimensionless) including lakes and reservoirs + # - lake and reservoir surface water fraction + self.dynamicFracWat = pcr.cover(\ + pcr.min(1.0, self.WaterBodies.fracWat), 0.0) + # - fraction of channel (including its excess above bankfull capacity) + self.dynamicFracWat += pcr.max(0.0, 1.0 - self.dynamicFracWat) * pcr.max(self.channelFraction, self.innundatedFraction) + # - maximum value of dynamicFracWat is 1.0 + self.dynamicFracWat = pcr.ifthen(self.landmask, pcr.min(1.0, self.dynamicFracWat)) + + # estimate water_height for the next loop + # - needed to estimate the channel wetted area (for the calculation of alpha and dischargeInitial) + self.water_height = channelStorageForRouting / (pcr.max(self.min_fracwat_for_water_height, self.dynamicFracWat) * self.cellArea) + # TODO: Check whether the usage of dynamicFracWat provides any problems? ####################################################################################################################### # evaporation (m/day) self.waterBodyEvaporation = water_body_evaporation_volume / self.cellArea - self.remainWaterBodyPotEvap = self.waterBodyPotEvap - self.waterBodyEvaporation # local input to surface water (m3) - self.local_input_to_surface_water = acc_local_input_to_surface_water - - # surface water abstraction (unit: m/day) - landSurface.actSurfaceWaterAbstract = acc_water_body_abstraction_volume / self.cellArea - - # surface water allocation (unit: m/day) - landSurface.allocSurfaceWaterAbstract = acc_water_body_allocation_volume / self.cellArea - - # unmetDemand (unit: m/day) - groundwater.unmetDemand = landSurface.totalPotentialGrossDemand -\ - landSurface.allocSurfaceWaterAbstract -\ - groundwater.allocNonFossilGroundwater - # Note that this must be positive (otherwise, it indicates water balance errors) - - if self.debugWaterBalance: - test = pcr.ifthen(groundwater.unmetDemand < 0.0, groundwater.unmetDemand) - a,b,c = vos.getMinMaxMean(pcr.scalar(test),True) - threshold = 1e-3 - if abs(a) > threshold or abs(b) > threshold: - logger.info("WARNING !!!!! Water balance errors. There is negative unmetDemand ... Min %f Max %f Mean %f" %(a,b,c)) + self.local_input_to_surface_water += acc_local_input_to_surface_water # channel discharge (m3/day) = self.Q self.Q = acc_discharge_volume @@ -1375,6 +1622,12 @@ def calculate_statistics(self, groundwater): def estimate_discharge_for_environmental_flow(self, channelStorage): + # statistical assumptions: + # - using z_score from the percentile 90 + z_score = 1.2816 + #~ # - using z_score from the percentile 95 + #~ z_score = 1.645 + # long term variance and standard deviation of discharge values varDischarge = self.m2tDischarge / \ pcr.max(1.,\ @@ -1383,31 +1636,47 @@ def estimate_discharge_for_environmental_flow(self, channelStorage): stdDischarge = pcr.max(varDischarge**0.5, 0.0) # calculate minimum discharge for environmental flow (m3/s) - minDischargeForEnvironmentalFlow = pcr.max(0.001, self.avgDischarge - 3.5*stdDischarge) + minDischargeForEnvironmentalFlow = pcr.max(0.0, self.avgDischarge - z_score * stdDischarge) factor = 0.10 # to avoid flip flop minDischargeForEnvironmentalFlow = pcr.max(factor*self.avgDischarge, minDischargeForEnvironmentalFlow) # unit: m3/s + minDischargeForEnvironmentalFlow = pcr.max(0.0, minDischargeForEnvironmentalFlow) + return minDischargeForEnvironmentalFlow - def estimate_available_volume_for_abstraction(self, channelStorage): + def estimate_available_volume_for_abstraction(self, channelStorage, length_of_time_step = vos.secondsPerDay()): # input: channelStorage in m3 # estimate minimum discharge for environmental flow (m3/s) minDischargeForEnvironmentalFlow = self.estimate_discharge_for_environmental_flow(channelStorage) - + # available channelStorage that can be extracted for surface water abstraction - readAvlChannelStorage = pcr.max(0.0,channelStorage) + readAvlChannelStorage = pcr.max(0.0,channelStorage) - # safety factor to reduce readAvlChannelStorage - safety_factor = vos.getValDivZero(pcr.max(0.0, pcr.min(self.avgDischargeShort, self.avgDischarge)), \ - minDischargeForEnvironmentalFlow, vos.smallNumber) - safety_factor = pcr.min(1.00, pcr.max(0.00, safety_factor)) - readAvlChannelStorage = safety_factor * pcr.max(0.0, readAvlChannelStorage) - - # ignore small volume values - less than 1 m3 - readAvlChannelStorage = pcr.rounddown(readAvlChannelStorage*1.)/1. + # reduce readAvlChannelStorage if the average discharge < minDischargeForEnvironmentalFlow + readAvlChannelStorage *= pcr.min(1.0,\ + vos.getValDivZero(pcr.max(0.0, pcr.min(self.avgDischargeShort, self.avgDischarge)), \ + minDischargeForEnvironmentalFlow, vos.smallNumber)) + + # maintaining environmental flow if average discharge > minDischargeForEnvironmentalFlow # TODO: Check why do we need this? + readAvlChannelStorage = pcr.ifthenelse(self.avgDischargeShort < minDischargeForEnvironmentalFlow, + readAvlChannelStorage, + pcr.max(readAvlChannelStorage, \ + pcr.max(0.0,\ + self.avgDischargeShort - minDischargeForEnvironmentalFlow)*length_of_time_step)) + + # maximum (precentage) of water can be abstracted from the channel - to avoid flip-flop + maximum_percentage = 0.90 + readAvlChannelStorage = pcr.min(readAvlChannelStorage, \ + maximum_percentage*channelStorage) + readAvlChannelStorage = pcr.max(0.0,\ + readAvlChannelStorage) + + # ignore small volume values - less than 0.1 m3 + readAvlChannelStorage = pcr.rounddown(readAvlChannelStorage*10.)/10. readAvlChannelStorage = pcr.ifthen(self.landmask, readAvlChannelStorage) - return readAvlChannelStorage # unit: m3 + + return readAvlChannelStorage # unit: m3 def initiate_old_style_routing_reporting(self,iniItems): @@ -1617,3 +1886,4 @@ def old_style_routing_reporting(self,currTimeStep): var,\ pcr2numpy(self.__getattribute__(var),vos.MV),\ timeStamp,currTimeStep.annuaIdx-1) + diff --git a/model/spinUp.py b/model/spinUp.py old mode 100755 new mode 100644 index 3276397f5..f73239b7b --- a/model/spinUp.py +++ b/model/spinUp.py @@ -1,25 +1,60 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os +import glob +import shutil import math -import logging import pcraster as pcr import virtualOS as vos +import logging +logger = logging.getLogger(__name__) + class SpinUp(object): def __init__(self, iniItems): object.__init__(self) - + self.noSpinUps = None # How many soil layers (excluding groundwater): self.numberOfLayers = int(iniItems.landSurfaceOptions['numberOfUpperSoilLayers']) - self.setupConvergence(iniItems) + # option to save the netcdf files of the latest cycle of spin up runs: + self.spinUpOutputDir = None + if 'spinUpOutputDir' in iniItems.globalOptions.keys(): + self.outNCDir = str(iniItems.outNCDir) + if iniItems.globalOptions['spinUpOutputDir'] not in ["None", "False"]: + self.spinUpOutputDir = vos.getFullPath(iniItems.globalOptions['spinUpOutputDir'], self.outNCDir) + if iniItems.globalOptions['spinUpOutputDir'] == "True": + self.spinUpOutputDir = self.outNCDir + "/spin-up/" + + # setting up the convergence parameters + self.setupConvergence(iniItems) def setupConvergence(self,iniItems): @@ -32,22 +67,14 @@ def setupConvergence(self,iniItems): # TODO: including the convergence of ResvSto (reservoir storage) # self.minConvForResvSto = float(iniItems.globalOptions['minConvForResvSto']) - - self.iniLandSurface = {} - # landCover types included in the simulation: - self.coverTypes = ["forest","grassland"] - # - if iniItems.landSurfaceOptions['includeIrrigation'] == "True":\ - self.coverTypes += ["irrPaddy","irrNonPaddy"] - for coverType in self.coverTypes: - self.iniLandSurface[coverType] = None - - self.endStateDir = iniItems.endStateDir + + # directory for storing end states (format: pcraster maps) + self.endStateDir = iniItems.endStateDir def getIniStates(self,model): - if self.numberOfLayers == 2: - + if self.numberOfLayers == 2: + self.iniSoilSto = max(1E-20,\ vos.getMapVolume(\ model.landSurface.topWaterLayer +\ @@ -56,8 +83,8 @@ def getIniStates(self,model): model.groundwater.storGroundwater, model.routing.cellArea)) # unit: m3 - if self.numberOfLayers == 3: - + if self.numberOfLayers == 3: + self.iniSoilSto = max(1E-20,\ vos.getMapVolume(\ model.landSurface.topWaterLayer +\ @@ -97,14 +124,14 @@ def soilStorageVolume(self, state, cellAreaMap): state['landSurface']['topWaterLayer'] + state['landSurface']['storUpp000005'] +\ state['landSurface']['storUpp005030'] + state['landSurface']['storLow030150'] +\ state['groundwater']['storGroundwater'], cellAreaMap) # unit: m3 - - + + def groundwaterStorageVolume(self, state, cellAreaMap): return vos.getMapVolume(state['groundwater']['storGroundwater'], cellAreaMap) # unit: m3 - + def channelStorageVolume(self, state, cellAreaMap): return vos.getMapVolume(state['routing']['channelStorage'], cellAreaMap) # unit: m3 - + def totalStorageVolume(self, state, cellAreaMap): return self.soilStorageVolume(state, cellAreaMap) + self.groundwaterStorageVolume(state, cellAreaMap) +\ vos.getMapVolume(\ @@ -114,46 +141,57 @@ def totalStorageVolume(self, state, cellAreaMap): cellAreaMap) # unit: m3 - def checkConvergence(self,beginState, endState, spinUpRun, cellAreaMap): - - #calculate convergence of soil storage - + def checkConvergence(self, beginState, endState, spinUpRun, cellAreaMap): + + # calculate convergence of soil storage + beginSoilSto = max(1E-20,self.soilStorageVolume(beginState, cellAreaMap)) endSoilSto = self.soilStorageVolume(endState, cellAreaMap) - + convSoilSto = math.fabs(100*(endSoilSto-beginSoilSto)/beginSoilSto) - - logging.getLogger('spinup').info('Delta SoilStorage = %.2f percent ; SpinUp No. %i of %i' \ - %(convSoilSto, spinUpRun, self.noSpinUps)) - - #calculate convergence of ground water storage - + + logger.info('Delta SoilStorage = %.2f percent ; SpinUp No. %i of %i' \ + %(convSoilSto, spinUpRun, self.noSpinUps)) + + # calculate convergence of ground water storage + beginGwatSto = max(1E-20,self.groundwaterStorageVolume(beginState, cellAreaMap)) endGwatSto = self.groundwaterStorageVolume(endState, cellAreaMap) - + convGwatSto = math.fabs(100*(endGwatSto-beginGwatSto)/beginGwatSto) - - logging.getLogger('spinup').info('Delta GwatStorage = %.2f percent' %(convGwatSto)) - - #calculate convergence of channel storage - + + logger.info('Delta GwatStorage = %.2f percent' %(convGwatSto)) + + # calculate convergence of channel storage + beginChanSto = max(1E-20,self.channelStorageVolume(beginState, cellAreaMap)) endChanSto = self.channelStorageVolume(endState, cellAreaMap) - + convChanSto = math.fabs(100*(endChanSto-beginChanSto)/beginChanSto) - - logging.getLogger('spinup').info('Delta ChanStorage = %.2f percent' \ + + logger.info('Delta ChanStorage = %.2f percent' \ %(convChanSto)) - #calculate convergence of total water storage + # calculate convergence of total water storage beginTotlSto = max(1E-20,self.totalStorageVolume(beginState, cellAreaMap)) endTotlSto = self.totalStorageVolume(endState, cellAreaMap) convTotlSto = math.fabs(100*(endTotlSto-beginTotlSto)/beginTotlSto) - - logging.getLogger('spinup').info('Delta TotlStorage = %.2f percent' \ + + logger.info('Delta TotlStorage = %.2f percent' \ %(convTotlSto)) - + + if self.spinUpOutputDir != None: + logger.info('Move all netcdf files resulted from the spin-up run to the spin-up directory: '+self.spinUpOutputDir) + + # cleaning up the spin-up directory: + if os.path.exists(self.spinUpOutputDir): shutil.rmtree(self.spinUpOutputDir) + os.makedirs(self.spinUpOutputDir) + + # move files + for filename in glob.glob(os.path.join(self.outNCDir, '*.nc')): + shutil.move(filename, self.spinUpOutputDir) + return convSoilSto <= self.minConvForSoilSto and convGwatSto <= self.minConvForGwatSto\ - and convChanSto <= self.minConvForChanSto and convTotlSto <= self.minConvForTotlSto + and convChanSto <= self.minConvForChanSto and convTotlSto <= self.minConvForTotlSto diff --git a/model/variable_list.py b/model/variable_list.py old mode 100755 new mode 100644 index c319cc7c3..249396257 --- a/model/variable_list.py +++ b/model/variable_list.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + ''' List of variables. @@ -14,6 +38,19 @@ description = {} comment = {} latex_symbol = {} +pcr_short_name = {} + +# actualET +pcrglobwb_variable_name = 'actualET' +netcdf_short_name[pcrglobwb_variable_name] = 'land_surface_evaporation' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "eact" # precipitation pcrglobwb_variable_name = 'precipitation' @@ -25,6 +62,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "pr" # temperature pcrglobwb_variable_name = 'temperature' @@ -36,6 +74,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "ta" # referencePotET pcrglobwb_variable_name = 'referencePotET' @@ -47,6 +86,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "e0p" # totalLandSurfacePotET pcrglobwb_variable_name = 'totalLandSurfacePotET' @@ -91,6 +131,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "intstor" # snowCoverSWE pcrglobwb_variable_name = 'snowCoverSWE' @@ -102,6 +143,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "snowcov" # snowFreeWater pcrglobwb_variable_name = 'snowFreeWater' @@ -113,6 +155,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "snowliq" # topWaterLayer pcrglobwb_variable_name = 'topWaterLayer' @@ -135,6 +178,40 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "sUpp" + +# storUpp000005 +pcrglobwb_variable_name = 'storUpp000005' +netcdf_short_name[pcrglobwb_variable_name] = 'upper_soil_storage_5cm' +netcdf_unit[pcrglobwb_variable_name] = 'm' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = 'upper_soil_storage_5cm' # first 5 cm of soil +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# storUpp005030 +pcrglobwb_variable_name = 'storUpp005030' +netcdf_short_name[pcrglobwb_variable_name] = 'upper_soil_storage_5_30cm' +netcdf_unit[pcrglobwb_variable_name] = 'm' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = 'upper_soil_storage_5_30cm' # from 5 to 30 cm of soil +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# storLow030150 +pcrglobwb_variable_name = 'storLow030150' +netcdf_short_name[pcrglobwb_variable_name] = 'lower_soil_storage_30_150cm' +netcdf_unit[pcrglobwb_variable_name] = 'm' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = 'lower_soil_storage_30_150cm' # from 30 to 150 cm of soil +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None # storLowTotal pcrglobwb_variable_name = 'storLowTotal' @@ -146,6 +223,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "sLow" # interceptEvap pcrglobwb_variable_name = 'interceptEvap' @@ -157,6 +235,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "int_evap" # actSnowFreeWaterEvap pcrglobwb_variable_name = 'actSnowFreeWaterEvap' @@ -168,6 +247,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "scf_evap" # topWaterLayerEvap pcrglobwb_variable_name = 'topWaterLayerEvap' @@ -186,10 +266,11 @@ netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' -netcdf_long_name[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = 'actual_soil_evaporation' description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "esact" # actTranspiTotal pcrglobwb_variable_name = 'actTranspiTotal' @@ -201,6 +282,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "tact" # actTranspiUppTotal pcrglobwb_variable_name = 'actTranspiUppTotal' @@ -212,6 +294,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "tactUpp" # actTranspiLowTotal pcrglobwb_variable_name = 'actTranspiLowTotal' @@ -223,6 +306,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "tactLow" # directRunoff pcrglobwb_variable_name = 'directRunoff' @@ -234,6 +318,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "qDr" # interflowTotal pcrglobwb_variable_name = 'interflowTotal' @@ -245,6 +330,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "qSf" # baseflow pcrglobwb_variable_name = 'baseflow' @@ -256,6 +342,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "qBf" # infiltration pcrglobwb_variable_name = 'infiltration' @@ -267,6 +354,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "infl" # gwRecharge pcrglobwb_variable_name = 'gwRecharge' @@ -278,6 +366,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = "negative values indicating (net) capillary rise from groundater store" latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "rch" # gwNetCapRise pcrglobwb_variable_name = 'gwNetCapRise' @@ -298,7 +387,18 @@ netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' netcdf_long_name[pcrglobwb_variable_name] = None description[pcrglobwb_variable_name] = None -comment[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = "not including water consumption for livestock" +latex_symbol[pcrglobwb_variable_name] = None + +# irrGrossDemandVolume +pcrglobwb_variable_name = 'irrGrossDemandVolume' +netcdf_short_name[pcrglobwb_variable_name] = 'irrigation_gross_demand_volume' +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = "not including water consumption for livestock" latex_symbol[pcrglobwb_variable_name] = None # nonIrrGrossDemand @@ -312,6 +412,17 @@ comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +# nonIrrGrossDemandVolume +pcrglobwb_variable_name = 'nonIrrGrossDemandVolume' +netcdf_short_name[pcrglobwb_variable_name] = 'non_irrigation_gross_demand_volume' +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + # totalGrossDemand pcrglobwb_variable_name = 'totalGrossDemand' netcdf_short_name[pcrglobwb_variable_name] = 'total_gross_demand' @@ -323,6 +434,17 @@ comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +# totalGrossDemandVolume +pcrglobwb_variable_name = 'totalGrossDemandVolume' +netcdf_short_name[pcrglobwb_variable_name] = 'total_gross_demand_volume' +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + # satDegUpp pcrglobwb_variable_name = 'satDegUpp' netcdf_short_name[pcrglobwb_variable_name] = 'upper_soil_saturation_degree' @@ -355,6 +477,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "sGw" # storGroundwaterFossil pcrglobwb_variable_name = 'storGroundwaterFossil' @@ -389,8 +512,19 @@ comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None -# nonFossilGroundWaterAbstraction -pcrglobwb_variable_name = 'nonFossilGroundWaterAbstraction' +# surfaceWaterAbstractionVolume +pcrglobwb_variable_name = 'surfaceWaterAbstractionVolume' +netcdf_short_name[pcrglobwb_variable_name] = 'surface_water_abstraction_volume' +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# nonFossilGroundwaterAbstraction +pcrglobwb_variable_name = 'nonFossilGroundwaterAbstraction' netcdf_short_name[pcrglobwb_variable_name] = 'non_fossil_groundwater_abstraction' netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' @@ -400,9 +534,42 @@ comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None -# otherWaterSourceAbstraction -pcrglobwb_variable_name = 'otherWaterSourceAbstraction' -netcdf_short_name[pcrglobwb_variable_name] = 'other_water_source_abstraction' +# fossilGroundwaterAbstraction +pcrglobwb_variable_name = 'fossilGroundwaterAbstraction' +netcdf_short_name[pcrglobwb_variable_name] = 'fossil_groundwater_abstraction' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# totalGroundwaterAbstraction +pcrglobwb_variable_name = 'totalGroundwaterAbstraction' +netcdf_short_name[pcrglobwb_variable_name] = 'total_groundwater_abstraction' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Non fossil and fossil groundwater abstraction.' +latex_symbol[pcrglobwb_variable_name] = None + +# totalGroundwaterAbstractionVolume +pcrglobwb_variable_name = 'totalGroundwaterAbstractionVolume' +netcdf_short_name[pcrglobwb_variable_name] = 'total_groundwater_abstraction_volume' +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Non fossil and fossil groundwater abstraction.' +latex_symbol[pcrglobwb_variable_name] = None + +# desalinationAbstraction +pcrglobwb_variable_name = 'desalinationAbstraction' +netcdf_short_name[pcrglobwb_variable_name] = 'desalination_source_abstraction' netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' @@ -411,9 +578,20 @@ comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None +# desalinationAbstractionVolume +pcrglobwb_variable_name = 'desalinationAbstractionVolume' +netcdf_short_name[pcrglobwb_variable_name] = 'desalination_source_abstraction_volume' +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + # totalAbstraction pcrglobwb_variable_name = 'totalAbstraction' -netcdf_short_name[pcrglobwb_variable_name] = 'total__abstraction' +netcdf_short_name[pcrglobwb_variable_name] = 'total_abstraction' netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' @@ -455,6 +633,17 @@ comment[pcrglobwb_variable_name] = "Values equal to 0 indicate either zero allocation or zero water demand." latex_symbol[pcrglobwb_variable_name] = None +# fracDesalinatedWaterAllocation +pcrglobwb_variable_name = 'fracDesalinatedWaterAllocation' +netcdf_short_name[pcrglobwb_variable_name] = 'fraction_of_desalinated_water_allocation' +netcdf_unit[pcrglobwb_variable_name] = '1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = "Values equal to 0 indicate either zero allocation or zero water demand." +latex_symbol[pcrglobwb_variable_name] = None + # totalFracWaterSourceAllocation pcrglobwb_variable_name = 'totalFracWaterSourceAllocation' netcdf_short_name[pcrglobwb_variable_name] = 'total_fraction_water_allocation' @@ -510,6 +699,17 @@ comment[pcrglobwb_variable_name] = 'Including from water bodies.' latex_symbol[pcrglobwb_variable_name] = None +# fractionTotalEvaporation +pcrglobwb_variable_name = 'fractionTotalEvaporation' +netcdf_short_name[pcrglobwb_variable_name] = 'total_evaporation_fraction' +netcdf_unit[pcrglobwb_variable_name] = '1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = 'ratio_between_actual_and_potential_values_of_total_evaporation' +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Including from water bodies.' +latex_symbol[pcrglobwb_variable_name] = None + # runoff pcrglobwb_variable_name = 'runoff' netcdf_short_name[pcrglobwb_variable_name] = 'land_surface_runoff' @@ -520,6 +720,7 @@ description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = "direct_runoff + interflow + baseflow, but not including local runoff from water bodies." latex_symbol[pcrglobwb_variable_name] = None +pcr_short_name[pcrglobwb_variable_name] = "qLoc" # accuRunoff pcrglobwb_variable_name = 'accuRunoff' @@ -535,9 +736,9 @@ # accuBaseflow pcrglobwb_variable_name = 'accuBaseflow' netcdf_short_name[pcrglobwb_variable_name] = 'accumulated_land_surface_baseflow' -netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' -netcdf_monthly_total_unit[pcrglobwb_variable_name] = "m3.month-1" -netcdf_yearly_total_unit[pcrglobwb_variable_name] = "m3.year-1" +netcdf_unit[pcrglobwb_variable_name] = 'm3.s-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None netcdf_long_name[pcrglobwb_variable_name] = None description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None @@ -587,6 +788,17 @@ comment[pcrglobwb_variable_name] = "Including runoff from water bodies." latex_symbol[pcrglobwb_variable_name] = None +# net_liquid_water_to_soil +pcrglobwb_variable_name = 'net_liquid_water_to_soil' +netcdf_short_name[pcrglobwb_variable_name] = 'net_liquid_water_to_soil' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + # totalActiveStorageThickness pcrglobwb_variable_name = 'totalActiveStorageThickness' netcdf_short_name[pcrglobwb_variable_name] = 'total_thickness_of_active_water_storage' @@ -595,7 +807,7 @@ netcdf_yearly_total_unit[pcrglobwb_variable_name] = None netcdf_long_name[pcrglobwb_variable_name] = None description[pcrglobwb_variable_name] = None -comment[pcrglobwb_variable_name] = "Not including fossil groundwater (unmetDemand)." +comment[pcrglobwb_variable_name] = "Not including fossil groundwater." latex_symbol[pcrglobwb_variable_name] = None # totalWaterStorageThickness @@ -606,7 +818,18 @@ netcdf_yearly_total_unit[pcrglobwb_variable_name] = None netcdf_long_name[pcrglobwb_variable_name] = None description[pcrglobwb_variable_name] = None -comment[pcrglobwb_variable_name] = "Including fossil groundwater (unmetDemand)." +comment[pcrglobwb_variable_name] = "Including fossil groundwater." +latex_symbol[pcrglobwb_variable_name] = None + +# totalWaterStorageVolume +pcrglobwb_variable_name = 'totalWaterStorageVolume' +netcdf_short_name[pcrglobwb_variable_name] = 'total_volume_of_water_storage' +netcdf_unit[pcrglobwb_variable_name] = 'm3' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = "Including fossil groundwater." latex_symbol[pcrglobwb_variable_name] = None # surfaceWaterStorage @@ -631,6 +854,17 @@ comment[pcrglobwb_variable_name] = 'The values given are for every lake and reservoir ids (not per cells) and after lake/reservoir releases/outflows.' latex_symbol[pcrglobwb_variable_name] = None +# channelStorage +pcrglobwb_variable_name = 'channelStorage' +netcdf_short_name[pcrglobwb_variable_name] = 'channel_storage' +netcdf_unit[pcrglobwb_variable_name] = 'm3' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + # snowMelt pcrglobwb_variable_name = 'snowMelt' netcdf_short_name[pcrglobwb_variable_name] = 'snow_melt' @@ -666,7 +900,7 @@ # nonIrrWaterConsumption pcrglobwb_variable_name = 'nonIrrWaterConsumption' -netcdf_short_name[pcrglobwb_variable_name] = 'consumption_for_non_irrigation_demand' +netcdf_short_name[pcrglobwb_variable_name] = 'consumptive_water_use_for_non_irrigation_demand' netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' @@ -677,11 +911,33 @@ # nonIrrReturnFlow pcrglobwb_variable_name = 'nonIrrReturnFlow' -netcdf_short_name[pcrglobwb_variable_name] = 'return_flow_from_non_irrigation_demand' +netcdf_short_name[pcrglobwb_variable_name] = 'return_flow_from_non_irrigation_demand_withdrawal' netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' -netcdf_long_name[pcrglobwb_variable_name] = 'return_flow_from_non_irrigation_demand_to_surface_water_bodies' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# irrWaterConsumption +pcrglobwb_variable_name = 'irrWaterConsumption' +netcdf_short_name[pcrglobwb_variable_name] = 'consumptive_water_use_for_irrigation_demand' +netcdf_unit[pcrglobwb_variable_name] = None +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# irrReturnFlow +pcrglobwb_variable_name = 'irrReturnFlow' +netcdf_short_name[pcrglobwb_variable_name] = 'return_flow_from_irrigation_demand_withdrawal' +netcdf_unit[pcrglobwb_variable_name] = None +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None description[pcrglobwb_variable_name] = None comment[pcrglobwb_variable_name] = None latex_symbol[pcrglobwb_variable_name] = None @@ -697,9 +953,229 @@ comment[pcrglobwb_variable_name] = 'Excluding surface water bodies.' latex_symbol[pcrglobwb_variable_name] = None +# fraction_of_surface_water +pcrglobwb_variable_name = 'dynamicFracWat' +netcdf_short_name[pcrglobwb_variable_name] = 'fraction_of_surface_water' +netcdf_unit[pcrglobwb_variable_name] = '1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Fraction of surface water over the cell area.' +latex_symbol[pcrglobwb_variable_name] = None + +# totalPotentialMaximumGrossDemand +pcrglobwb_variable_name = 'totalPotentialMaximumGrossDemand' +netcdf_short_name[pcrglobwb_variable_name] = 'totalPotentialMaximumGrossDemand' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# groundwaterAbsReturnFlow +pcrglobwb_variable_name = 'groundwaterAbsReturnFlow' +netcdf_short_name[pcrglobwb_variable_name] = 'return_flow_from_groundwater_abstraction' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = 'return_flow_from_groundwater_abstraction' +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# irrigationTranspiration +pcrglobwb_variable_name = 'irrigationTranspiration' +netcdf_short_name[pcrglobwb_variable_name] = 'transpiration_from_irrigation' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area (not only irrigation fraction).' +latex_symbol[pcrglobwb_variable_name] = None + +# floodDepth +pcrglobwb_variable_name = 'floodDepth' +netcdf_short_name[pcrglobwb_variable_name] = 'flood_innundation_depth' +netcdf_unit[pcrglobwb_variable_name] = 'm' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flood innundation depth above the channel flood plain. Not including flood overtopping reservoirs and lakes.' +latex_symbol[pcrglobwb_variable_name] = None + +# floodVolume +pcrglobwb_variable_name = 'floodVolume' +netcdf_short_name[pcrglobwb_variable_name] = 'flood_innundation_volume' +netcdf_unit[pcrglobwb_variable_name] = 'm3' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flood innundation volume above the channel storage capacity. Not including flood overtopping reservoirs and lakes.' +latex_symbol[pcrglobwb_variable_name] = None + +# irrPaddyWaterWithdrawal +pcrglobwb_variable_name = 'irrPaddyWaterWithdrawal' +netcdf_short_name[pcrglobwb_variable_name] = 'paddy_irrigation_withdrawal' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area.' +latex_symbol[pcrglobwb_variable_name] = None + +# irrNonPaddyWaterWithdrawal +pcrglobwb_variable_name = 'irrNonPaddyWaterWithdrawal' +netcdf_short_name[pcrglobwb_variable_name] = 'non_paddy_irrigation_withdrawal' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area.' +latex_symbol[pcrglobwb_variable_name] = None + +# irrigationWaterWithdrawal +pcrglobwb_variable_name = 'irrigationWaterWithdrawal' +netcdf_short_name[pcrglobwb_variable_name] = 'irrigation_withdrawal' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area.' +latex_symbol[pcrglobwb_variable_name] = None + +# domesticWaterWithdrawal +pcrglobwb_variable_name = 'domesticWaterWithdrawal' +netcdf_short_name[pcrglobwb_variable_name] = 'domestic_water_withdrawal' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area.' +latex_symbol[pcrglobwb_variable_name] = None + +# industryWaterWithdrawal +pcrglobwb_variable_name = 'industryWaterWithdrawal' +netcdf_short_name[pcrglobwb_variable_name] = 'industry_water_withdrawal' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area.' +latex_symbol[pcrglobwb_variable_name] = None + +# livestockWaterWithdrawal +pcrglobwb_variable_name = 'livestockWaterWithdrawal' +netcdf_short_name[pcrglobwb_variable_name] = 'livestock_water_withdrawal' +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area.' +latex_symbol[pcrglobwb_variable_name] = None + +# domesticWaterWithdrawalVolume +pcrglobwb_variable_name = 'domesticWaterWithdrawalVolume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# industryWaterWithdrawalVolume +pcrglobwb_variable_name = 'industryWaterWithdrawalVolume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# livestockWaterWithdrawalVolume +pcrglobwb_variable_name = 'livestockWaterWithdrawalVolume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# irrigationWaterWithdrawalVolume +pcrglobwb_variable_name = 'irrigationWaterWithdrawalVolume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# domesticWaterConsumptionVolume +pcrglobwb_variable_name = 'domesticWaterConsumptionVolume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# industryWaterConsumptionVolume +pcrglobwb_variable_name = 'industryWaterConsumptionVolume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# livestockWaterConsumptionVolume +pcrglobwb_variable_name = 'livestockWaterConsumptionVolume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# precipitation_at_irrigation +pcrglobwb_variable_name = 'precipitation_at_irrigation' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area (not only irrigation fraction).' +latex_symbol[pcrglobwb_variable_name] = None + # evaporation_from_irrigation pcrglobwb_variable_name = 'evaporation_from_irrigation' -netcdf_short_name[pcrglobwb_variable_name] = 'evaporation_from_irrigation' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' @@ -708,6 +1184,222 @@ comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area (not only irrigation fraction).' latex_symbol[pcrglobwb_variable_name] = None +# netLqWaterToSoil_at_irrigation +pcrglobwb_variable_name = 'netLqWaterToSoil_at_irrigation' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area (not only irrigation fraction).' +latex_symbol[pcrglobwb_variable_name] = None + +# transpiration_from_irrigation +pcrglobwb_variable_name = 'transpiration_from_irrigation' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = 'Flux values given are over the entire cell area (not only irrigation fraction).' +latex_symbol[pcrglobwb_variable_name] = None + +# precipitation_at_irrigation_volume +pcrglobwb_variable_name = 'precipitation_at_irrigation_volume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# evaporation_from_irrigation_volume +pcrglobwb_variable_name = 'evaporation_from_irrigation_volume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# netLqWaterToSoil_at_irrigation_volume +pcrglobwb_variable_name = 'netLqWaterToSoil_at_irrigation_volume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# transpiration_from_irrigation_volume +pcrglobwb_variable_name = 'transpiration_from_irrigation_volume' +netcdf_short_name[pcrglobwb_variable_name] = pcrglobwb_variable_name +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = 'm3.month-1' +netcdf_yearly_total_unit[pcrglobwb_variable_name] = 'm3.year-1' +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + + + +############################################################################################################# +# MODFLOW variable lists (below) +############################################################################################################# + +# groundwaterHeadLayer1 +pcrglobwb_variable_name = 'groundwaterHeadLayer1' +netcdf_short_name[pcrglobwb_variable_name] = 'groundwater_head_for_layer_1' +netcdf_unit[pcrglobwb_variable_name] = 'm.' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# groundwaterHeadLayer2 +pcrglobwb_variable_name = 'groundwaterHeadLayer2' +netcdf_short_name[pcrglobwb_variable_name] = 'groundwater_head_for_layer_2' +netcdf_unit[pcrglobwb_variable_name] = 'm.' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# groundwaterDepthLayer1 +pcrglobwb_variable_name = 'groundwaterDepthLayer1' +netcdf_short_name[pcrglobwb_variable_name] = 'groundwater_depth_for_layer_1' +netcdf_unit[pcrglobwb_variable_name] = 'm.' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# groundwaterDepthLayer2 +pcrglobwb_variable_name = 'groundwaterDepthLayer2' +netcdf_short_name[pcrglobwb_variable_name] = 'groundwater_depth_for_layer_2' +netcdf_unit[pcrglobwb_variable_name] = 'm.' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# groundwaterHead +pcrglobwb_variable_name = 'groundwaterHead' +netcdf_short_name[pcrglobwb_variable_name] = 'groundwater_head_for_top_layer' +netcdf_unit[pcrglobwb_variable_name] = 'm.' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# groundwaterDepth +pcrglobwb_variable_name = 'groundwaterDepth' +netcdf_short_name[pcrglobwb_variable_name] = 'groundwater_depth_for_top_layer' +netcdf_unit[pcrglobwb_variable_name] = 'm3.day-1' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# relativeGroundwaterHead +pcrglobwb_variable_name = 'relativeGroundwaterHead' +netcdf_short_name[pcrglobwb_variable_name] = 'relativeGroundwaterHead' +netcdf_unit[pcrglobwb_variable_name] = 'm' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + +# groundwaterVolumeEstimate +pcrglobwb_variable_name = 'groundwaterVolumeEstimate' +netcdf_short_name[pcrglobwb_variable_name] = 'groundwater_volume_estimate' +netcdf_unit[pcrglobwb_variable_name] = 'm3' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = "Note that the calculated values are until a certain aquifer/layer bottom elevation. Please check the assumption. Values can be negative." +latex_symbol[pcrglobwb_variable_name] = None + +# groundwaterThicknessEstimate +pcrglobwb_variable_name = 'groundwaterThicknessEstimate' +netcdf_short_name[pcrglobwb_variable_name] = 'groundwater_thickness_estimate' +netcdf_unit[pcrglobwb_variable_name] = 'm' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = "Note that the calculated values are until a certain aquifer/layer bottom elevation. Please check the assumption. Values can be negative." +latex_symbol[pcrglobwb_variable_name] = None + +# top_uppermost_layer (for two layer model) +pcrglobwb_variable_name = 'top_uppermost_layer' +netcdf_short_name[pcrglobwb_variable_name] = 'top_elevation_of_uppermost_layer' +netcdf_unit[pcrglobwb_variable_name] = 'm' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = "Zero elevation values indicate mean sea level." +latex_symbol[pcrglobwb_variable_name] = None + +# bottom_uppermost_layer (for two layer model) +pcrglobwb_variable_name = 'bottom_uppermost_layer' +netcdf_short_name[pcrglobwb_variable_name] = 'bottom_elevation_of_uppermost_layer' +netcdf_unit[pcrglobwb_variable_name] = 'm' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = "Zero elevation values indicate mean sea level. This elevation is also the top_elevation_of_lowermost_layer." +latex_symbol[pcrglobwb_variable_name] = None + +# bottom_lowermost_layer (for two layer model) +pcrglobwb_variable_name = 'bottom_lowermost_layer' +netcdf_short_name[pcrglobwb_variable_name] = 'bottom_elevation_of_lowermost_layer' +netcdf_unit[pcrglobwb_variable_name] = 'm' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = "Zero elevation values indicate mean sea level." +latex_symbol[pcrglobwb_variable_name] = None + +# test variable +pcrglobwb_variable_name = 'test' +netcdf_short_name[pcrglobwb_variable_name] = 'test' +netcdf_unit[pcrglobwb_variable_name] = 'undefined' +netcdf_monthly_total_unit[pcrglobwb_variable_name] = None +netcdf_yearly_total_unit[pcrglobwb_variable_name] = None +netcdf_long_name[pcrglobwb_variable_name] = None +description[pcrglobwb_variable_name] = None +comment[pcrglobwb_variable_name] = None +latex_symbol[pcrglobwb_variable_name] = None + + #~ # remove/clear pcrglobwb_variable_name #~ pcrglobwb_variable_name = None #~ del pcrglobwb_variable_name diff --git a/model/virtualOS.py b/model/virtualOS.py old mode 100755 new mode 100644 index 2821010e7..d89d8c09b --- a/model/virtualOS.py +++ b/model/virtualOS.py @@ -1,9 +1,31 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # EHS (20 March 2013): This is the list of general functions. # The list is continuation from Rens's and Dominik's. +import shutil import subprocess import datetime import random @@ -12,6 +34,8 @@ import re import math import sys +import types +import calendar import netCDF4 as nc import numpy as np @@ -21,19 +45,42 @@ import logging logger = logging.getLogger(__name__) +# file cache to minimize/reduce opening/closing files. +filecache = dict() + # Global variables: MV = 1e20 smallNumber = 1E-39 -# file cache to minimize/reduce opening/closing files. -filecache = dict() +# tuple of netcdf file suffixes (extensions) that can be used: +netcdf_suffixes = ('.nc4','.nc') + +def checkVariableInNC(ncFile,varName): + + logger.debug('Check whether the variable: '+str(varName)+' is defined in the file: '+str(ncFile)) + + if ncFile in filecache.keys(): + f = filecache[ncFile] + #~ print "Cached: ", ncFile + else: + f = nc.Dataset(ncFile) + filecache[ncFile] = f + #~ print "New: ", ncFile + + varName = str(varName) + + return varName in f.variables.keys() + -def netcdf2PCRobjCloneWithoutTime(ncFile,varName, +def netcdf2PCRobjCloneWithoutTime(ncFile, varName, cloneMapFileName = None,\ - LatitudeLongitude = False,\ - specificFillValue = None): + LatitudeLongitude = True,\ + specificFillValue = None,\ + absolutePath = None): + + if absolutePath != None: ncFile = getFullPath(ncFile, absolutePath) - logger.info('reading variable: '+str(varName)+' from the file: '+str(ncFile)) + logger.debug('reading variable: '+str(varName)+' from the file: '+str(ncFile)) # # EHS (19 APR 2013): To convert netCDF (tss) file to PCR file. @@ -43,11 +90,11 @@ def netcdf2PCRobjCloneWithoutTime(ncFile,varName, # Get netCDF file and variable name: if ncFile in filecache.keys(): f = filecache[ncFile] - print "Cached: ", ncFile + #~ print "Cached: ", ncFile else: f = nc.Dataset(ncFile) filecache[ncFile] = f - print "New: ", ncFile + #~ print "New: ", ncFile #print ncFile #f = nc.Dataset(ncFile) @@ -95,7 +142,9 @@ def netcdf2PCRobjCloneWithoutTime(ncFile,varName, yIdxSta = int(np.where(abs(f.variables['lat'][:] - (yULClone - 0.5*cellsizeInput)) == minY)[0]) yIdxEnd = int(math.ceil(yIdxSta + rowsClone /(cellsizeInput/cellsizeClone))) cropData = f.variables[varName][yIdxSta:yIdxEnd,xIdxSta:xIdxEnd] - factor = int(float(cellsizeInput)/float(cellsizeClone)) + factor = int(round(float(cellsizeInput)/float(cellsizeClone))) + + if factor > 1: logger.debug('Resample: input cell size = '+str(float(cellsizeInput))+' ; output/clone cell size = '+str(float(cellsizeClone))) # convert to PCR object and close f if specificFillValue != None: @@ -117,6 +166,7 @@ def netcdf2PCRobjCloneWithoutTime(ncFile,varName, # PCRaster object return (outPCR) + def netcdf2PCRobjClone(ncFile,varName,dateInput,\ useDoy = None, cloneMapFileName = None,\ @@ -131,15 +181,15 @@ def netcdf2PCRobjClone(ncFile,varName,dateInput,\ #~ print ncFile - logger.info('reading variable: '+str(varName)+' from the file: '+str(ncFile)) + logger.debug('reading variable: '+str(varName)+' from the file: '+str(ncFile)) if ncFile in filecache.keys(): f = filecache[ncFile] - print "Cached: ", ncFile + #~ print "Cached: ", ncFile else: f = nc.Dataset(ncFile) filecache[ncFile] = f - print "New: ", ncFile + #~ print "New: ", ncFile varName = str(varName) @@ -156,45 +206,128 @@ def netcdf2PCRobjClone(ncFile,varName,dateInput,\ except: pass + if varName == "kc": # the variable name in PCR-GLOBWB + try: + f.variables['kc'] = \ + f.variables['Cropcoefficient'] # the variable name in the netcdf file + except: + pass + + if varName == "interceptCapInput": # the variable name in PCR-GLOBWB + try: + f.variables['interceptCapInput'] = \ + f.variables['Interceptioncapacity'] # the variable name in the netcdf file + except: + pass + + if varName == "coverFractionInput": # the variable name in PCR-GLOBWB + try: + f.variables['coverFractionInput'] = \ + f.variables['Coverfraction'] # the variable name in the netcdf file + except: + pass + + if varName == "fracVegCover": # the variable name in PCR-GLOBWB + try: + f.variables['fracVegCover'] = \ + f.variables['vegetation_fraction'] # the variable name in the netcdf file + except: + pass + + if varName == "minSoilDepthFrac": # the variable name in PCR-GLOBWB + try: + f.variables['minSoilDepthFrac'] = \ + f.variables['minRootDepthFraction'] # the variable name in the netcdf file + except: + pass + + if varName == "maxSoilDepthFrac": # the variable name in PCR-GLOBWB + try: + f.variables['maxSoilDepthFrac'] = \ + f.variables['maxRootDepthFraction'] # the variable name in the netcdf file + except: + pass + + if varName == "arnoBeta": # the variable name in PCR-GLOBWB + try: + f.variables['arnoBeta'] = \ + f.variables['arnoSchemeBeta'] # the variable name in the netcdf file + except: + pass + # date date = dateInput if useDoy == "Yes": - idx = dateInput - 1 + logger.debug('Finding the date based on the given climatology doy index (1 to 366, or index 0 to 365)') + idx = int(dateInput) - 1 + elif useDoy == "month": # PS: WE NEED THIS ONE FOR NETCDF FILES that contain only 12 monthly values (e.g. cropCoefficientWaterNC). + logger.debug('Finding the date based on the given climatology month index (1 to 12, or index 0 to 11)') + # make sure that date is in the correct format + if isinstance(date, str) == True: date = \ + datetime.datetime.strptime(str(date),'%Y-%m-%d') + idx = int(date.month) - 1 else: + # make sure that date is in the correct format if isinstance(date, str) == True: date = \ datetime.datetime.strptime(str(date),'%Y-%m-%d') date = datetime.datetime(date.year,date.month,date.day) - # time index (in the netCDF file) - if useDoy == "month": - idx = int(date.month) - 1 - else: - nctime = f.variables['time'] # A netCDF time variable object. - if useDoy == "yearly":\ - date = datetime.datetime(date.year,int(1),int(1)) - if useDoy == "monthly":\ - date = datetime.datetime(date.year,date.month,int(1)) - try: - idx = nc.date2index(date, nctime, calendar = nctime.calendar, \ - select='exact') - except: - try: - idx = nc.date2index(date, nctime, calendar = nctime.calendar, \ - select='before') - msg = "\n" - msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" - msg += "No "+str(dateInput)+" is available. The 'before' option is used while selecting netcdf time." - msg += "\n" - except: - idx = nc.date2index(date, nctime, calendar = nctime.calendar, \ - select='after') - msg = "\n" - msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" - msg += "No "+str(dateInput)+" is available. The 'after' option is used while selecting netcdf time." - msg += "\n" - logger.info(msg) - logger.info(msg) + if useDoy == "yearly": + date = datetime.datetime(date.year,int(1),int(1)) + if useDoy == "monthly": + date = datetime.datetime(date.year,date.month,int(1)) + if useDoy == "yearly" or useDoy == "monthly" or useDoy == "daily_seasonal": + # if the desired year is not available, use the first year or the last year that is available + first_year_in_nc_file = findFirstYearInNCTime(f.variables['time']) + last_year_in_nc_file = findLastYearInNCTime(f.variables['time']) + # + if date.year < first_year_in_nc_file: + if date.day == 29 and date.month == 2 and calendar.isleap(date.year) and calendar.isleap(first_year_in_nc_file) == False: + date = datetime.datetime(first_year_in_nc_file,date.month,28) + else: + date = datetime.datetime(first_year_in_nc_file,date.month,date.day) + msg = "\n" + msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" + msg += "The date "+str(dateInput)+" is NOT available. " + msg += "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is used." + msg += "\n" + logger.warning(msg) + if date.year > last_year_in_nc_file: + if date.day == 29 and date.month == 2 and calendar.isleap(date.year) and calendar.isleap(last_year_in_nc_file) == False: + date = datetime.datetime(first_year_in_nc_file,date.month,28) + else: + date = datetime.datetime(first_year_in_nc_file,date.month,date.day) + msg = "\n" + msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" + msg += "The date "+str(dateInput)+" is NOT available. " + msg += "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is used." + msg += "\n" + logger.warning(msg) + try: + idx = nc.date2index(date, f.variables['time'], calendar = f.variables['time'].calendar, \ + select ='exact') + msg = "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is available. The 'exact' option is used while selecting netcdf time." + logger.debug(msg) + except: + msg = "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is NOT available. The 'exact' option CANNOT be used while selecting netcdf time." + logger.debug(msg) + try: + idx = nc.date2index(date, f.variables['time'], calendar = f.variables['time'].calendar, \ + select = 'before') + msg = "\n" + msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" + msg += "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is NOT available. The 'before' option is used while selecting netcdf time." + msg += "\n" + except: + idx = nc.date2index(date, f.variables['time'], calendar = f.variables['time'].calendar, \ + select = 'after') + msg = "\n" + msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" + msg += "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is NOT available. The 'after' option is used while selecting netcdf time." + msg += "\n" + logger.warning(msg) idx = int(idx) + logger.debug('Using the date index '+str(idx)) sameClone = True # check whether clone and input maps have the same attributes: @@ -225,7 +358,7 @@ def netcdf2PCRobjClone(ncFile,varName,dateInput,\ if sameClone == False: - logger.info('Crop to the clone map with lower left corner (x,y): '+str(xULClone)+' , '+str(yULClone)) + logger.debug('Crop to the clone map with lower left corner (x,y): '+str(xULClone)+' , '+str(yULClone)) # crop to cloneMap: #~ xIdxSta = int(np.where(f.variables['lon'][:] == xULClone + 0.5*cellsizeInput)[0]) minX = min(abs(f.variables['lon'][:] - (xULClone + 0.5*cellsizeInput))) # ; print(minX) @@ -237,9 +370,258 @@ def netcdf2PCRobjClone(ncFile,varName,dateInput,\ yIdxEnd = int(math.ceil(yIdxSta + rowsClone /(cellsizeInput/cellsizeClone))) cropData = f.variables[varName][idx,yIdxSta:yIdxEnd,xIdxSta:xIdxEnd] - logger.info('Resample: input cell size = '+str(float(cellsizeInput))+' ; output/clone cell size = '+str(float(cellsizeClone))) - factor = int(float(cellsizeInput)/float(cellsizeClone)) + factor = int(round(float(cellsizeInput)/float(cellsizeClone))) + if factor > 1: logger.debug('Resample: input cell size = '+str(float(cellsizeInput))+' ; output/clone cell size = '+str(float(cellsizeClone))) + + # convert to PCR object and close f + if specificFillValue != None: + outPCR = pcr.numpy2pcr(pcr.Scalar, \ + regridData2FinerGrid(factor,cropData,MV), \ + float(specificFillValue)) + else: + outPCR = pcr.numpy2pcr(pcr.Scalar, \ + regridData2FinerGrid(factor,cropData,MV), \ + float(f.variables[varName]._FillValue)) + + #f.close(); + f = None ; cropData = None + # PCRaster object + return (outPCR) + + + +def netcdf2PCRobjCloneJOYCE(ncFile,varName,dateInput,\ + useDoy = None, + cloneMapFileName = None,\ + LatitudeLongitude = True,\ + specificFillValue = None): + # + # EHS (19 APR 2013): To convert netCDF (tss) file to PCR file. + # --- with clone checking + # Only works if cells are 'square'. + # Only works if cellsizeClone <= cellsizeInput + # Get netCDF file and variable name: + #~ print ncFile + + logger.debug('reading variable: '+str(varName)+' from the file: '+str(ncFile)) + + if ncFile in filecache.keys(): + f = filecache[ncFile] + #~ print "Cached: ", ncFile + else: + f = nc.Dataset(ncFile) + filecache[ncFile] = f + #~ print "New: ", ncFile + + varName = str(varName) + + if LatitudeLongitude == True: + try: + f.variables['lat'] = f.variables['latitude'] + f.variables['lon'] = f.variables['longitude'] + except: + pass + + if varName == "evapotranspiration": + try: + f.variables['evapotranspiration'] = f.variables['referencePotET'] + except: + pass + + if varName == "kc": # the variable name in PCR-GLOBWB + try: + f.variables['kc'] = \ + f.variables['Cropcoefficient'] # the variable name in the netcdf file + except: + pass + + if varName == "interceptCapInput": # the variable name in PCR-GLOBWB + try: + f.variables['interceptCapInput'] = \ + f.variables['Interceptioncapacity'] # the variable name in the netcdf file + except: + pass + + if varName == "coverFractionInput": # the variable name in PCR-GLOBWB + try: + f.variables['coverFractionInput'] = \ + f.variables['Coverfraction'] # the variable name in the netcdf file + except: + pass + + if varName == "fracVegCover": # the variable name in PCR-GLOBWB + try: + f.variables['fracVegCover'] = \ + f.variables['vegetation_fraction'] # the variable name in the netcdf file + except: + pass + + if varName == "arnoBeta": # the variable name in PCR-GLOBWB + try: + f.variables['arnoBeta'] = \ + f.variables['arnoSchemeBeta'] # the variable name in the netcdf file + except: + pass + + # date + date = dateInput + if useDoy == "Yes": + logger.debug('Finding the date based on the given climatology doy index (1 to 366, or index 0 to 365)') + idx = int(dateInput) - 1 + else: + # make sure that date is in the correct format + if isinstance(date, str) == True: date = \ + datetime.datetime.strptime(str(date),'%Y-%m-%d') + date = datetime.datetime(date.year,date.month,date.day) + if useDoy == "month": + logger.debug('Finding the date based on the given climatology month index (1 to 12, or index 0 to 11)') + idx = int(date.month) - 1 + if useDoy == "yearly": + date = datetime.datetime(date.year,int(1),int(1)) + if useDoy == "monthly": + date = datetime.datetime(date.year,date.month,int(1)) + if useDoy == "yearly" or useDoy == "monthly" or useDoy == "daily_seasonal": + # if the desired year is not available, use the first year or the last year that is available + first_year_in_nc_file = findFirstYearInNCTime(f.variables['time']) + last_year_in_nc_file = findLastYearInNCTime(f.variables['time']) + # + if date.year < first_year_in_nc_file: + date = datetime.datetime(first_year_in_nc_file,date.month,date.day) + msg = "\n" + msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" + msg += "The date "+str(dateInput)+" is NOT available. " + msg += "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is used." + msg += "\n" + logger.warning(msg) + if date.year > last_year_in_nc_file: + date = datetime.datetime(last_year_in_nc_file,date.month,date.day) + msg = "\n" + msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" + msg += "The date "+str(dateInput)+" is NOT available. " + msg += "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is used." + msg += "\n" + logger.warning(msg) + try: + idx = nc.date2index(date, f.variables['time'], calendar = f.variables['time'].calendar, \ + select ='exact') + msg = "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is available. The 'exact' option is used while selecting netcdf time." + logger.debug(msg) + except: + msg = "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is NOT available. The 'exact' option CANNOT be used while selecting netcdf time." + logger.debug(msg) + try: + idx = nc.date2index(date, f.variables['time'], calendar = f.variables['time'].calendar, \ + select = 'before') + msg = "\n" + msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" + msg += "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is NOT available. The 'before' option is used while selecting netcdf time." + msg += "\n" + except: + idx = nc.date2index(date, f.variables['time'], calendar = f.variables['time'].calendar, \ + select = 'after') + msg = "\n" + msg += "WARNING related to the netcdf file: "+str(ncFile)+" ; variable: "+str(varName)+" !!!!!!"+"\n" + msg += "The date "+str(date.year)+"-"+str(date.month)+"-"+str(date.day)+" is NOT available. The 'after' option is used while selecting netcdf time." + msg += "\n" + logger.warning(msg) + + idx = int(idx) + logger.debug('Using the date index '+str(idx)) + + cropData = f.variables[varName][int(idx),:,:].copy() # still original data + factor = 1 # needed in regridData2FinerGrid + + # store latitudes and longitudes to a new variable + latitude = f.variables['lat'] + longitude = f.variables['lon'] + + # check the orientation of the latitude and flip it if necessary + we_have_to_flip = False + if (latitude[0]- latitude[1]) < 0.0: + we_have_to_flip = True + latitude = np.flipud(latitude) + + sameClone = True + # check whether clone and input maps have the same attributes: + if cloneMapFileName != None: + # get the attributes of cloneMap + attributeClone = getMapAttributesALL(cloneMapFileName) + cellsizeClone = attributeClone['cellsize'] + rowsClone = attributeClone['rows'] + colsClone = attributeClone['cols'] + xULClone = attributeClone['xUL'] + yULClone = attributeClone['yUL'] + # get the attributes of input (netCDF) + cellsizeInput = latitude[0]- latitude[1] + cellsizeInput = float(cellsizeInput) + rowsInput = len(latitude) + colsInput = len(longitude) + xULInput = longitude[0]-0.5*cellsizeInput + yULInput = latitude[0] +0.5*cellsizeInput + # check whether both maps have the same attributes + if cellsizeClone != cellsizeInput: sameClone = False + if rowsClone != rowsInput: sameClone = False + if colsClone != colsInput: sameClone = False + if xULClone != xULInput: sameClone = False + if yULClone != yULInput: sameClone = False + + # flip cropData if necessary + if we_have_to_flip: + #~ cropData = cropData[::-1,:] + #~ cropData = cropData[::-1,:].copy() + + #~ cropData = np.flipud(cropData) + + #~ cropData = np.flipud(cropData) + #~ cropData = np.flipud(cropData).copy() + + #~ original = cropData.copy() +#~ + #~ print id(cropData) + #~ print id(original) + + #~ cropData = None + #~ del cropData + #~ cropData = np.flipud(original).copy() + + #~ print type(cropData) + + #~ cropData2 = cropData[::-1,:] + + #~ cropData = None + #~ cropData = original[::-1,:] + #~ cropData = cropData[::-1,:] + + cropData = cropData[::-1,:] + + print type(cropData) + + print "Test test tet" + print id(cropData) + #~ print id(original) + + #~ cropData = cropData[::-1,:].copy() + + pcr_map = pcr.numpy2pcr(pcr.Scalar, cropData, -999.9) + pcr.report(pcr_map, "test2.map") + os.system("aguila test2.map") + + if sameClone == False: + + logger.debug('Crop to the clone map with lower left corner (x,y): '+str(xULClone)+' , '+str(yULClone)) + # crop to cloneMap: + minX = min(abs(longitude[:] - (xULClone + 0.5*cellsizeInput))) # ; print(minX) + xIdxSta = int(np.where(abs(longitude[:] - (xULClone + 0.5*cellsizeInput)) == minX)[0]) + xIdxEnd = int(math.ceil(xIdxSta + colsClone /(cellsizeInput/cellsizeClone))) + minY = min(abs(latitude[:] - (yULClone - 0.5*cellsizeInput))) # ; print(minY) + yIdxSta = int(np.where(abs(latitude[:] - (yULClone - 0.5*cellsizeInput)) == minY)[0]) + yIdxEnd = int(math.ceil(yIdxSta + rowsClone /(cellsizeInput/cellsizeClone))) + cropData = cropData[yIdxSta:yIdxEnd,xIdxSta:xIdxEnd] + + factor = int(round(float(cellsizeInput)/float(cellsizeClone))) + if factor > 1: logger.debug('Resample: input cell size = '+str(float(cellsizeInput))+' ; output/clone cell size = '+str(float(cellsizeClone))) + # convert to PCR object and close f if specificFillValue != None: outPCR = pcr.numpy2pcr(pcr.Scalar, \ @@ -255,6 +637,7 @@ def netcdf2PCRobjClone(ncFile,varName,dateInput,\ # PCRaster object return (outPCR) + def netcdf2PCRobjCloneWindDist(ncFile,varName,dateInput,useDoy = None, cloneMapFileName=None): # EHS (02 SEP 2013): This is a special function made by Niko Wanders (for his DA framework). @@ -431,15 +814,17 @@ def writePCRmapToDir(v,outFileName,outDir): # cloneMapFileName: If the inputMap and cloneMap have different clones, # resampling will be done. Then, fullFileName = getFullPath(outFileName,outDir) + logger.debug('Writing a pcraster map to : '+str(fullFileName)) pcr.report(v,fullFileName) def readPCRmapClone(v,cloneMapFileName,tmpDir,absolutePath=None,isLddMap=False,cover=None,isNomMap=False): # v: inputMapFileName or floating values # cloneMapFileName: If the inputMap and cloneMap have different clones, # resampling will be done. - logger.info('read file/values: '+str(v)) + logger.debug('read file/values: '+str(v)) if v == "None": - PCRmap = str("None") + #~ PCRmap = str("None") + PCRmap = None # 29 July: I made an experiment by changing the type of this object. elif not re.match(r"[0-9.-]*$",v): if absolutePath != None: v = getFullPath(v,absolutePath) # print(v) @@ -456,10 +841,11 @@ def readPCRmapClone(v,cloneMapFileName,tmpDir,absolutePath=None,isLddMap=False,c if isLddMap == True: PCRmap = pcr.ldd(PCRmap) if isNomMap == True: PCRmap = pcr.ifthen(pcr.scalar(PCRmap) > 0., PCRmap) if isNomMap == True: PCRmap = pcr.nominal(PCRmap) - co = 'rm '+str(tmpDir)+'*.*' - cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + if os.path.isdir(tmpDir): + shutil.rmtree(tmpDir) + os.makedirs(tmpDir) else: - PCRmap = pcr.scalar(float(v)) + PCRmap = pcr.spatial(pcr.scalar(float(v))) if cover != None: PCRmap = pcr.cover(PCRmap, cover) co = None; cOut = None; err = None; warp = None @@ -506,13 +892,13 @@ def gdalwarpPCR(input,output,cloneOut,tmpDir,isLddMap=False,isNominalMap=False): # # remove temporary files: co = 'rm '+str(tmpDir)+'*.*' - cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open(os.devnull),shell=True).communicate() # # converting files to tif: co = 'gdal_translate -ot Float64 '+str(input)+' '+str(tmpDir)+'tmp_inp.tif' if isLddMap == True: co = 'gdal_translate -ot Int32 '+str(input)+' '+str(tmpDir)+'tmp_inp.tif' if isNominalMap == True: co = 'gdal_translate -ot Int32 '+str(input)+' '+str(tmpDir)+'tmp_inp.tif' - cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open(os.devnull),shell=True).communicate() # # get the attributes of PCRaster map: cloneAtt = getMapAttributesALL(cloneOut) @@ -528,21 +914,21 @@ def gdalwarpPCR(input,output,cloneOut,tmpDir,isLddMap=False,isNominalMap=False): ' -srcnodata -3.4028234663852886e+38 -dstnodata mv '+ \ str(tmpDir)+'tmp_inp.tif '+ \ str(tmpDir)+'tmp_out.tif' - cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open(os.devnull),shell=True).communicate() # co = 'gdal_translate -of PCRaster '+ \ str(tmpDir)+'tmp_out.tif '+str(output) - cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open(os.devnull),shell=True).communicate() # co = 'mapattr -c '+str(cloneOut)+' '+str(output) - cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open(os.devnull),shell=True).communicate() # #~ co = 'aguila '+str(output) #~ print(co) - #~ cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + #~ cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open(os.devnull),shell=True).communicate() # co = 'rm '+str(tmpDir)+'tmp*.*' - cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open(os.devnull),shell=True).communicate() co = None; cOut = None; err = None del co; del cOut; del err stdout = None; del stdout @@ -553,12 +939,16 @@ def getFullPath(inputPath,absolutePath,completeFileName = True): # 19 Mar 2013 created by Edwin H. Sutanudjaja # Function: to get the full absolute path of a folder or a file - # list of suffixes (extensions) that can be used: - suffix = ('/','_','.nc4','.map','.nc','.dat','.txt','.asc','.ldd',\ + # replace all \ with / + inputPath = str(inputPath).replace("\\", "/") + absolutePath = str(absolutePath).replace("\\", "/") + + # tuple of suffixes (extensions) that can be used: + suffix = ('/','_','.nc4','.map','.nc','.dat','.txt','.asc','.ldd','.tbl',\ '.001','.002','.003','.004','.005','.006',\ '.007','.008','.009','.010','.011','.012') - if inputPath.startswith('/'): + if inputPath.startswith('/') or str(inputPath)[1] == ":": fullPath = str(inputPath) else: if absolutePath.endswith('/'): @@ -636,8 +1026,8 @@ def isLastDayOfMonth(date): return False def getMapAttributesALL(cloneMap,arcDegree=True): - co = ['mapattr -p %s ' %(cloneMap)] - cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + cOut,err = subprocess.Popen(str('mapattr -p %s ' %(cloneMap)), stdout=subprocess.PIPE,stderr=open(os.devnull),shell=True).communicate() + if err !=None or cOut == []: print "Something wrong with mattattr in virtualOS, maybe clone Map does not exist ? " sys.exit() @@ -654,8 +1044,7 @@ def getMapAttributesALL(cloneMap,arcDegree=True): return mapAttr def getMapAttributes(cloneMap,attribute,arcDegree=True): - co = ['mapattr -p %s ' %(cloneMap)] - cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + cOut,err = subprocess.Popen(str('mapattr -p %s ' %(cloneMap)), stdout=subprocess.PIPE,stderr=open(os.devnull),shell=True).communicate() #print cOut if err !=None or cOut == []: print "Something wrong with mattattr in virtualOS, maybe clone Map does not exist ? " @@ -711,7 +1100,7 @@ def getLastDayOfMonth(date): def getMinMaxMean(mapFile,ignoreEmptyMap=False): mn = pcr.cellvalue(pcr.mapminimum(mapFile),1)[0] mx = pcr.cellvalue(pcr.mapmaximum(mapFile),1)[0] - nrValues = pcr.cellvalue(pcr.maptotal(pcr.scalar(pcr.defined(mapFile))), 1 ) [0] #/ getNumNonMissingValues(mapFile) + nrValues = pcr.cellvalue(pcr.maptotal(pcr.scalar(pcr.defined(mapFile))), 1 )[0] #/ getNumNonMissingValues(mapFile) if nrValues == 0.0 and ignoreEmptyMap: return 0.0,0.0,0.0 else: @@ -862,8 +1251,7 @@ def waterBalanceCheck(fluxesIn,fluxesOut,preStorages,endStorages,processName,Pri msg += "\n" msg += "\n" - logger.info(msg) - logger.info(msg) + logger.error(msg) #~ pcr.report(inMap + dsMap - outMap,"wb.map") #~ os.system("aguila wb.map") @@ -880,6 +1268,8 @@ def waterBalanceCheck(fluxesIn,fluxesOut,preStorages,endStorages,processName,Pri #~ #return wb + + def waterBalance( fluxesIn, fluxesOut, deltaStorages, processName, PrintOnlyErrors, dateStr,threshold=1e-5): """ Returns the water balance for a list of input, output, and storage map files and """ @@ -952,11 +1342,154 @@ def waterBalance( fluxesIn, fluxesOut, deltaStorages, processName, PrintOn return inMap + dsMap - outMap -def swapRows(a): - #-swaps an array upside-down - b = a.copy() - for rowCnt in xrange(a.shape[0]): - revRowCnt= a.shape[0]-(rowCnt+1) - b[revRowCnt,:]= a[rowCnt,:] - return b + + +def waterAbstractionAndAllocation(water_demand_volume,available_water_volume,allocation_zones,\ + zone_area = None, + high_volume_treshold = 1000000., + debug_water_balance = True,\ + extra_info_for_water_balance_reporting = "", + ignore_small_values = True): + + logger.debug("Allocation of abstraction.") + + # demand volume in each cell (unit: m3) + if ignore_small_values: # ignore small values to avoid runding error + cellVolDemand = pcr.rounddown(pcr.max(0.0, water_demand_volume)) + else: + cellVolDemand = pcr.max(0.0, water_demand_volume) + + # total demand volume in each zone/segment (unit: m3) + zoneVolDemand = pcr.areatotal(cellVolDemand, allocation_zones) + + # total available water volume in each cell + if ignore_small_values: # ignore small values to avoid runding error + cellAvlWater = pcr.rounddown(pcr.max(0.00, available_water_volume)) + else: + cellAvlWater = pcr.max(0.00, available_water_volume) + + # total available water volume in each zone/segment (unit: m3) + # - to minimize numerical errors, separating cellAvlWater + if not isinstance(high_volume_treshold,types.NoneType): + # mask: 0 for small volumes ; 1 for large volumes (e.g. in lakes and reservoirs) + mask = pcr.cover(\ + pcr.ifthen(cellAvlWater > high_volume_treshold, pcr.boolean(1)), pcr.boolean(0)) + zoneAvlWater = pcr.areatotal( + pcr.ifthenelse(mask, 0.0, cellAvlWater), allocation_zones) + zoneAvlWater += pcr.areatotal( + pcr.ifthenelse(mask, cellAvlWater, 0.0), allocation_zones) + else: + zoneAvlWater = pcr.areatotal(cellAvlWater, allocation_zones) + + # total actual water abstraction volume in each zone/segment (unit: m3) + # - limited to available water + zoneAbstraction = pcr.min(zoneAvlWater, zoneVolDemand) + + # actual water abstraction volume in each cell (unit: m3) + cellAbstraction = getValDivZero(\ + cellAvlWater, zoneAvlWater, smallNumber)*zoneAbstraction + cellAbstraction = pcr.min(cellAbstraction, cellAvlWater) + if ignore_small_values: # ignore small values to avoid runding error + cellAbstraction = pcr.rounddown(pcr.max(0.00, cellAbstraction)) + # to minimize numerical errors, separating cellAbstraction + if not isinstance(high_volume_treshold,types.NoneType): + # mask: 0 for small volumes ; 1 for large volumes (e.g. in lakes and reservoirs) + mask = pcr.cover(\ + pcr.ifthen(cellAbstraction > high_volume_treshold, pcr.boolean(1)), pcr.boolean(0)) + zoneAbstraction = pcr.areatotal( + pcr.ifthenelse(mask, 0.0, cellAbstraction), allocation_zones) + zoneAbstraction += pcr.areatotal( + pcr.ifthenelse(mask, cellAbstraction, 0.0), allocation_zones) + else: + zoneAbstraction = pcr.areatotal(cellAbstraction, allocation_zones) + + # allocation water to meet water demand (unit: m3) + cellAllocation = getValDivZero(\ + cellVolDemand, zoneVolDemand, smallNumber)*zoneAbstraction + + #~ # extraAbstraction to minimize numerical errors: + #~ zoneDeficitAbstraction = pcr.max(0.0,\ + #~ pcr.areatotal(cellAllocation , allocation_zones) -\ + #~ pcr.areatotal(cellAbstraction, allocation_zones)) + #~ remainingCellAvlWater = pcr.max(0.0, cellAvlWater - cellAbstraction) + #~ cellAbstraction += zoneDeficitAbstraction * getValDivZero(\ + #~ remainingCellAvlWater, + #~ pcr.areatotal(remainingCellAvlWater, allocation_zones), + #~ smallNumber) + #~ # + #~ # extraAllocation to minimize numerical errors: + #~ zoneDeficitAllocation = pcr.max(0.0,\ + #~ pcr.areatotal(cellAbstraction, allocation_zones) -\ + #~ pcr.areatotal(cellAllocation , allocation_zones)) + #~ remainingCellDemand = pcr.max(0.0, cellVolDemand - cellAllocation) + #~ cellAllocation += zoneDeficitAllocation * getValDivZero(\ + #~ remainingCellDemand, + #~ pcr.areatotal(remainingCellDemand, allocation_zones), + #~ smallNumber) + + if debug_water_balance and not isinstance(zone_area,types.NoneType): + + zoneAbstraction = pcr.cover(pcr.areatotal(cellAbstraction, allocation_zones)/zone_area, 0.0) + zoneAllocation = pcr.cover(pcr.areatotal(cellAllocation , allocation_zones)/zone_area, 0.0) + + waterBalanceCheck([zoneAbstraction],\ + [zoneAllocation],\ + [pcr.scalar(0.0)],\ + [pcr.scalar(0.0)],\ + 'abstraction - allocation per zone/segment (PS: Error here may be caused by rounding error.)' ,\ + True,\ + extra_info_for_water_balance_reporting,threshold=1e-4) + + return cellAbstraction, cellAllocation + + +def findLastYearInNCFile(ncFile): + + # open a netcdf file: + if ncFile in filecache.keys(): + f = filecache[ncFile] + else: + f = nc.Dataset(ncFile) + filecache[ncFile] = f + + # last datetime + last_datetime_year = findLastYearInNCTime(f.variables['time']) + + return last_datetime_year + +def findLastYearInNCTime(ncTimeVariable): + + # last datetime + last_datetime = nc.num2date(ncTimeVariable[len(ncTimeVariable) - 1],\ + ncTimeVariable.units,\ + ncTimeVariable.calendar) + + return last_datetime.year + +def findFirstYearInNCTime(ncTimeVariable): + + # first datetime + first_datetime = nc.num2date(ncTimeVariable[0],\ + ncTimeVariable.units,\ + ncTimeVariable.calendar) + + return first_datetime.year + +def cmd_line(command_line,using_subprocess = True): + + msg = "Call: "+str(command_line) + logger.debug(msg) + + co = command_line + if using_subprocess: + cOut,err = subprocess.Popen(co, stdout=subprocess.PIPE,stderr=open('/dev/null'),shell=True).communicate() + else: + os.system(co) + +def plot_variable(pcr_variable, filename = "test.map"): + + pcr.report(pcr_variable, filename) + cmd = 'aguila '+str(filename) + os.system(cmd) + diff --git a/model/waterBodies.py b/model/waterBodies.py old mode 100755 new mode 100644 index f242d76d3..3b863e611 --- a/model/waterBodies.py +++ b/model/waterBodies.py @@ -1,5 +1,26 @@ -#!/usr/bin/ python +#!/usr/bin/env python # -*- coding: utf-8 -*- +# +# PCR-GLOBWB (PCRaster Global Water Balance) Global Hydrological Model +# +# Copyright (C) 2016, Ludovicus P. H. (Rens) van Beek, Edwin H. Sutanudjaja, Yoshihide Wada, +# Joyce H. C. Bosmans, Niels Drost, Inge E. M. de Graaf, Kor de Jong, Patricia Lopez Lopez, +# Stefanie Pessenteiner, Oliver Schmitz, Menno W. Straatsma, Niko Wanders, Dominik Wisser, +# and Marc F. P. Bierkens, +# Faculty of Geosciences, Utrecht University, Utrecht, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os import types @@ -32,7 +53,7 @@ def __init__(self,iniItems,landmask): # option to perform a run with only natural lakes (without reservoirs) self.onlyNaturalWaterBodies = False if "onlyNaturalWaterBodies" in iniItems.routingOptions.keys() and iniItems.routingOptions['onlyNaturalWaterBodies'] == "True": - logger.info("WARNING!! Using only natural water bodies identified in the year 1900. All reservoirs in 1900 are assumed as lakes.") + logger.info("Using only natural water bodies identified in the year 1900. All reservoirs in 1900 are assumed as lakes.") self.onlyNaturalWaterBodies = True self.dateForNaturalCondition = "1900-01-01" # The run for a natural condition should access only this date. @@ -59,7 +80,6 @@ def __init__(self,iniItems,landmask): self.maxResvrFrac = 0.75 def getParameterFiles(self,currTimeStep,cellArea,ldd,\ - cellLengthFD,cellSizeInArcDeg,\ initial_condition_dictionary = None): # parameters for Water Bodies: fracWat @@ -249,7 +269,7 @@ def getParameterFiles(self,currTimeStep,cellArea,ldd,\ # for a natural run (self.onlyNaturalWaterBodies == True) # which uses only the year 1900, assume all reservoirs are lakes if self.onlyNaturalWaterBodies == True and date_used == self.dateForNaturalCondition: - logger.info("WARNING!! Using only natural water bodies identified in the year 1900. All reservoirs in 1900 are assumed as lakes.") + logger.info("Using only natural water bodies identified in the year 1900. All reservoirs in 1900 are assumed as lakes.") self.waterBodyTyp = \ pcr.ifthen(pcr.scalar(self.waterBodyTyp) > 0.,\ pcr.nominal(1)) @@ -257,10 +277,10 @@ def getParameterFiles(self,currTimeStep,cellArea,ldd,\ # check that all lakes and/or reservoirs have types, ids, surface areas and outlets: test = pcr.defined(self.waterBodyTyp) & pcr.defined(self.waterBodyArea) &\ pcr.defined(self.waterBodyIds) & pcr.boolean(pcr.areamaximum(pcr.scalar(self.waterBodyOut), self.waterBodyIds)) - a,b,c = vos.getMinMaxMean(pcr.scalar(test) - pcr.scalar(1.0)) + a,b,c = vos.getMinMaxMean(pcr.cover(pcr.scalar(test), 1.0) - pcr.scalar(1.0)) threshold = 1e-3 if abs(a) > threshold or abs(b) > threshold: - logger.info("WARNING !!!!! Missing information in some lakes and/or reservoirs.") + logger.warning("Missing information in some lakes and/or reservoirs.") # at the beginning of simulation period (timeStepPCR = 1) # - we have to define/get the initial conditions @@ -345,13 +365,13 @@ def update(self,newStorageAtLakeAndReservoirs,\ downstreamDemand) if self.debugWaterBalance:\ - vos.waterBalanceCheck([ self.inflow/self.waterBodyArea],\ - [self.waterBodyOutflow/self.waterBodyArea],\ - [ preStorage/self.waterBodyArea],\ - [self.waterBodyStorage/self.waterBodyArea],\ - 'WaterBodyStorage',\ + vos.waterBalanceCheck([ pcr.cover(self.inflow/self.waterBodyArea,0.0)],\ + [pcr.cover(self.waterBodyOutflow/self.waterBodyArea,0.0)],\ + [ pcr.cover(preStorage/self.waterBodyArea,0.0)],\ + [pcr.cover(self.waterBodyStorage/self.waterBodyArea,0.0)],\ + 'WaterBodyStorage (unit: m)',\ True,\ - currTimeStep.fulldate,threshold=1e-3) + currTimeStep.fulldate,threshold=5e-3) def moveFromChannelToWaterBody(self,\ newStorageAtLakeAndReservoirs,\ diff --git a/user_agreement/pcr-globwb_user_agreement.doc b/user_agreement/pcr-globwb_user_agreement.doc deleted file mode 100644 index 1c6e9d8bc..000000000 Binary files a/user_agreement/pcr-globwb_user_agreement.doc and /dev/null differ