Hupselbrook Model Setup¶
SWAP plain-text configuration files (.swp, .crp, .dra, .bbc) consist of various switches (parameters with "SW" prefix), key-value pairs, and tables. These elements are grouped into sections corresponding to specific parts of the model. For example, the meteorological section includes parameters for climatological calculations, while the crop section handles parameters related to, e.g., crop water uptake. You can see the structure of the classic template of SWAP file inputs in the wiki section.
pyswap is built on Object Oriented Programming principle, similar to flopy package for MODFLOW model. Different parts of the model, or model components, are represented by separate classes (GeneralSettings, Meteorology, etc.). These components are then stacked together like lego blocks to build a complete model. This approach allows to easily build variants of a model by modifying or replacing individual components without changing the overall structure.
Tip
pySWAP is designed with type hinting in mind. When using a code editor like Visual Studio Code, typing `pyswap.` will show hints for available classes and functions. Similarly, hovering over a class signature will display available parameters, value ranges, and documentation.
from datetime import datetime as dt
import pyswap as psp
psp.setup_logging("DEBUG")
psp.get_swap(verbose=True)
Downloading SWAP 4.2.0 for linux...
Installing to: /home/runner/work/pySWAP/pySWAP/pyswap/libs/swap
Downloading from: https://github.com/SWAP-model/SWAP/releases/download/v4.2.0/swap4.2.0-linux
Downloading
✓ SWAP 4.2.0 successfully installed!
Executable path: /home/runner/work/pySWAP/pySWAP/pyswap/libs/swap/swap420
Updated version info file.
PosixPath('/home/runner/work/pySWAP/pySWAP/pyswap/libs/swap/swap420')
General settings¶
In pySWAP, each distinct section is represented as a class, similarily to flopy, a popular Python package running MODFLOW models. Therefore, in a sense, defining a model with pySWAP feels similar to defining it in a classic ASCII template, but gives you more options to work with your models further. Finally, when all necessary objects are defined, you create a Model instance. You can also define an empty Model instance, and add each section to that instance after it's created. Let's set up Metadata and GeneralSettings for the model. We will start with an empty model instance.
# starting with an empty model instance
ml = psp.Model()
meta = psp.components.Metadata(
author="John Doe",
institution="University of Somewhere",
email="john.doe@somewhere.com",
project="pySWAP test - hupselbrook",
swap_ver="4.2",
)
simset = psp.components.simsettings.GeneralSettings(
tstart="2002-01-01",
tend="2004-12-31",
extensions=["vap", "blc", "sba", "inc", "csv"],
nprintday=1,
swerror=1,
swscre=0,
swmonth=1,
swyrvar=0,
datefix="31 12",
inlist_csv=[
"rain",
"irrig",
"interc",
"runoff",
"drainage",
"dstor",
"epot",
"eact",
"tpot",
"tact",
"qbottom",
"gwl",
],
)
# attaching model components to the model instance
ml.metadata = meta
ml.generalsettings = simset
Note
At this stage there is one important difference to explain; you do not need to (and actually cannot) adjust the paths at the beginning. This is because pySWAP runs SWAP in a temporary directory and handles paths automatically. The same goes for file names; the default and frozen file names are "swap" for inputs (e.g., drainage file) and "result" for output.
After adding the two sections, you can view how the section would look like as a SWAP-compatible string, or see the current shape of the .swp file by calling ml.swp property. You may notice more parameters that you wanted to set. It's because by default, heat flow (HeatFlow), solute transport (SoluteTransport) and fixed irrigation (FixedIrrigation) modules are turned off in the model. There are also default settings for some parameters of Richard's equation (RichardsSettings). To change it, it's enough to define your own objects with desired settings and reassign them in the ml instance.
print(ml.swp)
PROJECT = 'pySWAP test - hupselbrook' SWWBA = 0 SWEND = 0 SWVAP = 1 SWBAL = 0 SWBLC = 1 SWSBA = 1 SWATE = 0 SWBMA = 0 SWDRF = 0 SWSWB = 0 SWINI = 0 SWINC = 1 SWCRP = 0 SWSTR = 0 SWIRG = 0 SWCSV = 1 SWCSV_TZ = 0 PATHWORK = './' PATHATM = './' PATHCROP = './' PATHDRAIN = './' SWSCRE = 0 SWERROR = 1 TSTART = 2002-01-01 TEND = 2004-12-31 NPRINTDAY = 1 SWMONTH = 1 SWYRVAR = 0 DATEFIX = 31 12 OUTFIL = 'result' SWHEADER = 0 INLIST_CSV = 'rain,irrig,interc,runoff,drainage,dstor,epot,eact,tpot,tact,qbottom,gwl' SWAFO = 0 SWAUN = 0 SWDISCRVERT = 0 SWKMEAN = 1 SWKIMPL = 0 DTMIN = 1e-06 DTMAX = 0.04 GWLCONV = 100.0 CRITDEVH1CP = 0.01 CRITDEVH2CP = 0.1 CRITDEVPONDDT = 0.0001 MAXIT = 30 MAXBACKTR = 3 SWIRFIX = 0 IRGFIL = 'swap' SWSNOW = 0 SWFROST = 0 SWHEA = 0 SWSOLU = 0
Meteorology¶
Setting up meteorological section additionally requires providing some climatological data in a specific CSV format. Those data are enclosed in a File type object. For meteorological data it's MetFile class. Let's create the Meteorology object with a MetFile attached to it.
Currently the other built-in method of getting the MetFile is using KNMI service or loading it from a CSV file. Read documentation of pyswap.components.meteorology module.
# here we additionally need to load the meteo data from testcase library
from pyswap import testcase
meteo_data = psp.components.meteorology.metfile_from_csv(
metfil="283.met", csv_path=testcase.get_path("hupselbrook", "met")
)
meteo = psp.components.meteorology.Meteorology(
lat=52.0,
alt=21.0,
swetr=0,
metfile=meteo_data,
swdivide=1,
swmetdetail=0,
altw=10.0,
angstroma=0.25,
angstromb=0.5,
)
ml.meteorology = meteo
17:26:28 - DEBUG - Validating Meteorology with rules: {'swetr': {1: ['swetsine'], 0: ['alt', 'altw', 'angstroma', 'angstromb', 'swmetdetail']}, 'swrain': {0: None, 1: ['rainflux'], 3: ['rainfil']}, 'swmetdetail': {1: ['nmetdetail']}}
Crop¶
Crop settings can be defined either fully in your Python script, or can be partly imported from the WOFOST crop database (depending on which crop file type you are going to use). In the Hupselbrook example, the crop rotation settings includes all three: simple setup for maize, detailed WOFOST model for potato and dynamic grass growth.
Each crop file is set up as Crop objects which in turn consists of subsections (ScheduledIrrigation, CropDevelopmentSettingsFixed, etc). This is identical to how the main Model is composed.
This section is somewhat long, so buckle up...
Simple (fixed) crop settings for maize¶
Two ways of defining tables (new from v0.2.9)¶
You can either define the tables here, in your code using the .create method of each SWAP table object [1] or use a YAML file to define your tables there [2]. The second option is particularily useful in cases where you need to define many tables. Both options yield the same result. Only the second option is used in the subsequent crop file definitions.
# Option [1] to define the tables and CropDevelopment object
maize_prep = psp.components.crop.Preparation(
swprep=0, swsow=0, swgerm=0, dvsend=3.0, swharv=0
)
scheduled_irrigation = psp.components.irrigation.ScheduledIrrigation(schedule=0)
DVS = [0.0, 0.3, 0.5, 0.7, 1.0, 1.4, 2.0]
# This is one way to create and validate tables in pySWAP.
maize_gctb = psp.components.crop.GCTB.create({
"DVS": DVS,
"LAI": [0.05, 0.14, 0.61, 4.10, 5.00, 5.80, 5.20],
})
maize_chtb = psp.components.crop.CHTB.create({
"DVS": DVS,
"CH": [1.0, 15.0, 40.0, 140.0, 170.0, 180.0, 175.0],
})
maize_rdtb = psp.components.crop.RDTB.create({
"DVS": [0.0, 0.3, 0.5, 0.7, 1.0, 2.0],
"RD": [5.0, 20.0, 50.0, 80.0, 90.0, 100.0],
})
maize_rdctb = psp.components.crop.RDCTB.create({
"RRD": [0.0, 1.0],
"RDENS": [1.0, 0.0],
})
maize_cropdev_settings = psp.components.crop.CropDevelopmentSettingsFixed(
idev=1,
lcc=168,
kdif=0.6,
kdir=0.75,
swgc=1,
gctb=maize_gctb,
swcf=2,
cftb=maize_chtb,
albedo=0.23,
rsc=61.0,
rsw=0.0,
swrd=1,
rdtb=maize_rdtb,
rdctb=maize_rdctb,
)
print(maize_cropdev_settings.gctb)
DVS LAI 0 0.0 0.05 1 0.3 0.14 2 0.5 0.61 3 0.7 4.10 4 1.0 5.00 5 1.4 5.80 6 2.0 5.20
# Option [2] to load the crop development settings from a YAML file (we take a predefined file from the data library)
from pyswap.testcase import get_path
maize_tables = get_path("hupselbrook", "maize_tables_yaml")
maize_cropdev_settings = psp.components.crop.CropDevelopmentSettingsFixed(
idev=1,
lcc=168,
kdif=0.6,
kdir=0.75,
swgc=1,
swcf=2,
albedo=0.23,
rsc=61.0,
rsw=0.0,
swrd=1,
)
maize_cropdev_settings.update_from_yaml(maize_tables)
17:26:28 - DEBUG - Loaded YAML content from: /home/runner/work/pySWAP/pySWAP/pyswap/testcase/data/1-hupselbrook/maize_swap.yaml
17:26:28 - DEBUG - Extracted parameters from YAML: ['GCTB', 'CHTB', 'RDTB', 'RDCTB']
17:26:28 - DEBUG - TableProcessor initialized.
17:26:28 - DEBUG - Processing YAML dict format for parameter: GCTB with keys: ['DVS', 'LAI']
17:26:28 - DEBUG - Matched array schema: GCTB
17:26:28 - DEBUG - Successfully validated GCTB
17:26:28 - DEBUG - Processed parameter from YAML: GCTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: CHTB with keys: ['DVS', 'CH']
17:26:28 - DEBUG - Matched array schema: CHTB
17:26:28 - DEBUG - Successfully validated CHTB
17:26:28 - DEBUG - Processed parameter from YAML: CHTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RDTB with keys: ['DVS', 'RD']
17:26:28 - DEBUG - Matched array schema: RDTB
17:26:28 - DEBUG - Successfully validated RDTB
17:26:28 - DEBUG - Processed parameter from YAML: RDTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RDCTB with keys: ['RRD', 'RDENS']
17:26:28 - DEBUG - Matched array schema: RDCTB
17:26:28 - DEBUG - Successfully validated RDCTB
17:26:28 - DEBUG - Processed parameter from YAML: RDCTB
print(maize_cropdev_settings.cftb)
None
maize_ox_stress = psp.components.crop.OxygenStress(
swoxygen=1,
swwrtnonox=0,
aeratecrit=0.5,
hlim1=-15.0,
hlim2u=-30.0,
hlim2l=-30.0,
)
maize_dr_stress = psp.components.crop.DroughtStress(
swdrought=1,
hlim3h=-325.0,
hlim3l=-600.0,
hlim4=-8000.0,
adcrh=0.5,
adcrl=0.1,
)
# shared with the fixed crop settings
maize_interception = psp.components.crop.Interception(swinter=1, cofab=0.25)
crpmaize = psp.components.crop.CropFile(
name="maizes",
prep=maize_prep,
scheduledirrigation=scheduled_irrigation,
cropdev_settings=maize_cropdev_settings,
oxygenstress=maize_ox_stress,
droughtstress=maize_dr_stress,
interception=maize_interception,
)
WOFOST settings for potato¶
For the WOFOST model, many more parameters are necessary. Therefore we can make use of calibrated parameters for crops from existing databases. pySWAP uses the de Wit's crop database to automatically load some available parameters. The remaining parameters still need to be supplied by the user. We will make use of that database below.
from pyswap import db
# Load the crop database
db = db.WOFOSTCropDB()
potato = db.load_crop_file("potato")
potato_params = potato.get_variety("Potato_701")
potato_prep = psp.components.crop.Preparation(
swprep=0,
swsow=0,
swgerm=2,
tsumemeopt=170.0,
tbasem=3.0,
teffmx=18.0,
hdrygerm=-500.0,
hwetgerm=-100.0,
zgerm=-10.0,
agerm=203.0,
dvsend=2.0,
swharv=0,
)
potato_cropdev_settings = psp.components.crop.CropDevelopmentSettingsWOFOST(
wofost_variety=potato_params,
swcf=2,
albedo=0.19,
laiem=0.0589,
ssa=0.0,
kdif=1.0,
rsc=207.0,
rsw=0.0,
kdir=0.75,
eff=0.45,
swrd=2,
rdc=50.0,
swdmi2rd=1,
)
potato_cropdev_settings.update_from_wofost()
potato_tables = get_path("hupselbrook", "potato_tables_yaml")
potato_cropdev_settings.update_from_yaml(potato_tables)
potato_ox_stress = psp.components.crop.OxygenStress(
swoxygen=1,
swwrtnonox=1,
aeratecrit=0.5,
hlim1=-10.0,
hlim2u=-25.0,
hlim2l=-25.0,
swrootradius=2,
root_radiuso2=0.00015,
)
potato_dr_stress = psp.components.crop.DroughtStress(
swdrought=1,
hlim3h=-300.0,
hlim3l=-500.0,
hlim4=-10000.0,
adcrh=0.5,
adcrl=0.1,
)
crppotato = psp.components.crop.CropFile(
name="potatod",
prep=potato_prep,
cropdev_settings=potato_cropdev_settings,
oxygenstress=potato_ox_stress,
droughtstress=potato_dr_stress,
# shared with the fixed crop settings
interception=maize_interception,
scheduledirrigation=scheduled_irrigation,
)
17:26:28 - DEBUG - Updating from WOFOST variety parameters: {'co2efftb': [[40.0, 0.0], [360.0, 1.0], [720.0, 1.11], [1000.0, 1.11], [2000.0, 1.11]], 'co2tratb': [[40.0, 0.0], [360.0, 1.0], [720.0, 0.9], [1000.0, 0.9], [2000.0, 0.9]], 'co2amaxtb': [[40.0, 0.0], [360.0, 1.0], [720.0, 1.6], [1000.0, 1.9], [2000.0, 1.9]], 'tbasem': 3.0, 'teffmx': 18.0, 'tsumem': 170, 'idsl': 0, 'tsum1': 150, 'tsum2': 1550, 'dtsmtb': [[0.0, 0.0], [2.0, 0.0], [13.0, 11.0], [30.0, 28.0]], 'dvsi': 0.0, 'dvsend': 2.0, 'vernbase': 14.0, 'vernsat': 70.0, 'verndvs': 0.3, 'vernrtb': [[-8.0, 0.0], [-4.0, 0.0], [3.0, 1.0], [10.0, 1.0], [17.0, 0.0], [20.0, 0.0]], 'tdwi': 75.0, 'rgrlai': 0.012, 'slatb': [[0.0, 0.003], [1.1, 0.003], [2.0, 0.0015]], 'spa': 0.0, 'ssatb': [[0.0, 0.0], [2.0, 0.0]], 'span': 37.0, 'tbase': 2.0, 'kdiftb': [[0.0, 1.0], [2.0, 1.0]], 'efftb': [[0.0, 0.45], [40.0, 0.45]], 'amaxtb': [[0.0, 30.0], [1.57, 30.0], [2.0, 0.0]], 'refco2l': 360, 'tmpftb': [[0.0, 0.01], [3.0, 0.01], [10.0, 0.75], [15.0, 1.0], [20.0, 1.0], [26.0, 0.75], [33.0, 0.01]], 'tmnftb': [[0.0, 0.0], [3.0, 1.0]], 'cvl': 0.72, 'cvo': 0.85, 'cvr': 0.72, 'cvs': 0.69, 'q10': 2.0, 'rml': 0.03, 'rmo': 0.0045, 'rmr': 0.01, 'rms': 0.015, 'rfsetb': [[0.0, 1.0], [2.0, 1.0]], 'frtb': [[0.0, 0.2], [1.0, 0.2], [1.36, 0.0], [2.0, 0.0]], 'fltb': [[0.0, 0.8], [1.0, 0.8], [1.27, 0.0], [1.36, 0.0], [2.0, 0.0]], 'fstb': [[0.0, 0.2], [1.0, 0.2], [1.27, 0.25], [1.36, 0.0], [2.0, 0.0]], 'fotb': [[0.0, 0.0], [1.0, 0.0], [1.27, 0.75], [1.36, 1.0], [2.0, 1.0]], 'perdl': 0.03, 'rdrrtb': [[0.0, 0.0], [1.5, 0.0], [1.51, 0.02], [2.0, 0.02]], 'rdrstb': [[0.0, 0.0], [1.5, 0.0], [1.51, 0.02], [2.0, 0.02]], 'cfet': 1.0, 'depnr': 3.0, 'iairdu': 0, 'iox': 0, 'rdi': 10.0, 'rri': 1.2, 'rdmcr': 50.0, 'nmaxlv_tb': [[0.0, 0.06], [0.4, 0.05], [0.7, 0.045], [1.0, 0.045], [2.0, 0.04], [2.1, 0.04]], 'nmaxrt_fr': 0.5, 'nmaxst_fr': 0.5, 'nmaxso': 0.0136, 'ncrit_fr': 1.0, 'nresidlv': 0.02, 'nresidst': 0.01, 'nresidrt': 0.01, 'tcnt': 10, 'nfix_fr': 0.0, 'pmaxlv_tb': [[0.0, 0.015], [0.4, 0.0125], [0.7, 0.0113], [1.0, 0.0113], [2.0, 0.01], [2.1, 0.01]], 'pmaxrt_fr': 0.5, 'pmaxst_fr': 0.5, 'pmaxso': 0.00176, 'pcrit_fr': 1.0, 'presidlv': 0.0019, 'presidst': 0.0009, 'presidrt': 0.0009, 'tcpt': 10, 'kmaxlv_tb': [[0.0, 0.057], [0.4, 0.048], [0.7, 0.043], [1.0, 0.043], [2.0, 0.038], [2.1, 0.038]], 'kmaxrt_fr': 0.5, 'kmaxst_fr': 0.5, 'kmaxso': 0.0176, 'kcrit_fr': 1.0, 'kresidlv': 0.0173, 'kresidst': 0.0087, 'kresidrt': 0.0087, 'tckt': 10, 'dvs_npk_stop': 1.6, 'dvs_npk_transl': 0.8, 'nlai_npk': 1.0, 'nsla_npk': 0.5, 'npart': 1.0, 'nlue_npk': 1.1, 'npk_translrt_fr': 0.5, 'rdrlv_npk': 0.05, 'rnuptakemax': 7.2, 'rpuptakemax': 0.8, 'rkuptakemax': 7.4}
17:26:28 - DEBUG - TableProcessor initialized.
17:26:28 - DEBUG - Matched array schema: CO2EFFTB
17:26:28 - DEBUG - Successfully validated CO2EFFTB
17:26:28 - DEBUG - Processed parameter from WOFOST: co2efftb
17:26:28 - DEBUG - Matched array schema: CO2TRATB
17:26:28 - DEBUG - Successfully validated CO2TRATB
17:26:28 - DEBUG - Processed parameter from WOFOST: co2tratb
17:26:28 - DEBUG - Matched array schema: CO2AMAXTB
17:26:28 - DEBUG - Successfully validated CO2AMAXTB
17:26:28 - DEBUG - Processed parameter from WOFOST: co2amaxtb
17:26:28 - DEBUG - Matched array schema: DTSMTB
17:26:28 - DEBUG - Successfully validated DTSMTB
17:26:28 - DEBUG - Processed parameter from WOFOST: dtsmtb
17:26:28 - DEBUG - Matched array schema: VERNRTB
17:26:28 - DEBUG - Successfully validated VERNRTB
17:26:28 - DEBUG - Processed parameter from WOFOST: vernrtb
17:26:28 - DEBUG - Matched array schema: SLATB
17:26:28 - DEBUG - Successfully validated SLATB
17:26:28 - DEBUG - Processed parameter from WOFOST: slatb
17:26:28 - WARNING - No matching array schema found for: ssatb
17:26:28 - WARNING - Failed to process parameter from WOFOST: ssatb, removing from update
17:26:28 - WARNING - No matching array schema found for: kdiftb
17:26:28 - WARNING - Failed to process parameter from WOFOST: kdiftb, removing from update
17:26:28 - WARNING - No matching array schema found for: efftb
17:26:28 - WARNING - Failed to process parameter from WOFOST: efftb, removing from update
17:26:28 - DEBUG - Matched array schema: AMAXTB
17:26:28 - DEBUG - Successfully validated AMAXTB
17:26:28 - DEBUG - Processed parameter from WOFOST: amaxtb
17:26:28 - DEBUG - Matched array schema: TMPFTB
17:26:28 - DEBUG - Successfully validated TMPFTB
17:26:28 - DEBUG - Processed parameter from WOFOST: tmpftb
17:26:28 - DEBUG - Matched array schema: TMNFTB
17:26:28 - DEBUG - Successfully validated TMNFTB
17:26:28 - DEBUG - Processed parameter from WOFOST: tmnftb
17:26:28 - DEBUG - Matched array schema: RFSETB
17:26:28 - DEBUG - Successfully validated RFSETB
17:26:28 - DEBUG - Processed parameter from WOFOST: rfsetb
17:26:28 - DEBUG - Matched array schema: FRTB
17:26:28 - DEBUG - Successfully validated FRTB
17:26:28 - DEBUG - Processed parameter from WOFOST: frtb
17:26:28 - DEBUG - Matched array schema: FLTB
17:26:28 - DEBUG - Successfully validated FLTB
17:26:28 - DEBUG - Processed parameter from WOFOST: fltb
17:26:28 - DEBUG - Matched array schema: FSTB
17:26:28 - DEBUG - Successfully validated FSTB
17:26:28 - DEBUG - Processed parameter from WOFOST: fstb
17:26:28 - DEBUG - Matched array schema: FOTB
17:26:28 - DEBUG - Successfully validated FOTB
17:26:28 - DEBUG - Processed parameter from WOFOST: fotb
17:26:28 - DEBUG - Matched array schema: RDRRTB
17:26:28 - DEBUG - Successfully validated RDRRTB
17:26:28 - DEBUG - Processed parameter from WOFOST: rdrrtb
17:26:28 - DEBUG - Matched array schema: RDRSTB
17:26:28 - DEBUG - Successfully validated RDRSTB
17:26:28 - DEBUG - Processed parameter from WOFOST: rdrstb
17:26:28 - WARNING - No matching array schema found for: nmaxlv_tb
17:26:28 - WARNING - Failed to process parameter from WOFOST: nmaxlv_tb, removing from update
17:26:28 - WARNING - No matching array schema found for: pmaxlv_tb
17:26:28 - WARNING - Failed to process parameter from WOFOST: pmaxlv_tb, removing from update
17:26:28 - WARNING - No matching array schema found for: kmaxlv_tb
17:26:28 - WARNING - Failed to process parameter from WOFOST: kmaxlv_tb, removing from update
17:26:28 - DEBUG - Loaded YAML content from: /home/runner/work/pySWAP/pySWAP/pyswap/testcase/data/1-hupselbrook/potato_swap.yaml
17:26:28 - DEBUG - Extracted parameters from YAML: ['CHTB', 'RDCTB']
17:26:28 - DEBUG - TableProcessor initialized.
17:26:28 - DEBUG - Processing YAML dict format for parameter: CHTB with keys: ['DVS', 'CH']
17:26:28 - DEBUG - Matched array schema: CHTB
17:26:28 - DEBUG - Successfully validated CHTB
17:26:28 - DEBUG - Processed parameter from YAML: CHTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RDCTB with keys: ['RRD', 'RDENS']
17:26:28 - DEBUG - Matched array schema: RDCTB
17:26:28 - DEBUG - Successfully validated RDCTB
17:26:28 - DEBUG - Processed parameter from YAML: RDCTB
Dynamic grass model¶
This one requires many parameters that are unavailable in the crop database pySWAP uses. Therefore, all tables and parameters have to be defined manually.
# I keep this here as a nice example of hybrid definition of model variables: all
# tables, except this one, which is kind of annoyingly long and simple, are defined
# in the yaml file.
grass_lsda = psp.components.crop.LSDA.create({
"SEQNR": [float(i) for i in range(1, 21)],
"LSDA": [21.25] * 20,
})
grass_settings = psp.components.crop.CropDevelopmentSettingsGrass(
swcf=2,
albedo=0.23,
rsc=100.0,
rsw=0.0,
tdwi=1000.00,
laiem=0.63000,
rgrlai=0.00700,
swtsum=1,
ssa=0.0004,
span=30.00,
tbase=0.00,
kdif=0.60,
kdir=0.75,
eff=0.50,
cvl=0.6850,
cvr=0.6940,
cvs=0.6620,
q10=2.0000,
rml=0.0300,
rmr=0.0150,
rms=0.0150,
perdl=0.050,
swrd=3,
swdmi2rd=1,
wrtmax=3000.0,
swrdc=0,
lsda=grass_lsda,
)
grass_ox_stress = psp.components.crop.OxygenStress(
swoxygen=1, hlim1=0.0, hlim2u=1.0, hlim2l=-1.0, swwrtnonox=0
)
grass_drought_stress = psp.components.crop.DroughtStress(
swdrought=1,
swjarvis=4,
alphcrit=0.7,
hlim3h=-200.0,
hlim3l=-800.0,
hlim4=-8000.0,
adcrh=0.5,
adcrl=0.1,
)
grass_salt_stress = psp.components.crop.SaltStress(swsalinity=0)
grass_interception = psp.components.crop.Interception(swinter=1, cofab=0.25)
grass_co2 = psp.components.crop.CO2Correction(swco2=0)
grass_management = psp.components.crop.GrasslandManagement(
seqgrazmow=[2] * 20,
swharvest=1,
swdmmow=2,
lsda=grass_lsda,
maxdaymow=42,
swlossmow=0,
mowrest=700.0,
swpotrelmf=1,
relmf=0.90,
)
grass_tables = get_path("hupselbrook", "grass_tables_yaml")
# The file can contain multiple tables for crop and management settings, some of which
# may not be present in the currently updated class. Those will be automatically ignored
# so only matching tables will be updated.
grass_settings.update_from_yaml(grass_tables, grass=True)
grass_management.update_from_yaml(grass_tables, grass=True)
grass_irrigation = psp.components.irrigation.ScheduledIrrigation(schedule=0)
crpgrass = psp.components.crop.CropFile(
name="grassd",
cropdev_settings=grass_settings,
oxygenstress=grass_ox_stress,
droughtstress=grass_drought_stress,
saltstress=grass_salt_stress,
interception=grass_interception,
co2correction=grass_co2,
grasslandmanagement=grass_management,
scheduledirrigation=grass_irrigation,
)
17:26:28 - DEBUG - Loaded YAML content from: /home/runner/work/pySWAP/pySWAP/pyswap/testcase/data/1-hupselbrook/grass_swap.yaml
17:26:28 - DEBUG - Extracted parameters from YAML: ['CHTB', 'SLATB', 'AMAXTB', 'TMPFTB', 'TMNFTB', 'RFSETB', 'FRTB', 'FLTB', 'FSTB', 'RDRRTB', 'RDRSTB', 'RLWTB', 'RDCTB', 'DMMOWTB', 'DMMOWDELAY']
17:26:28 - DEBUG - TableProcessor initialized.
17:26:28 - DEBUG - Processing YAML dict format for parameter: CHTB with keys: ['DNR', 'CH']
17:26:28 - DEBUG - Matched array schema: CHTB
17:26:28 - DEBUG - Successfully validated CHTB
17:26:28 - DEBUG - Processed parameter from YAML: CHTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: SLATB with keys: ['DNR', 'SLA']
17:26:28 - DEBUG - Matched array schema: SLATB
17:26:28 - DEBUG - Successfully validated SLATB
17:26:28 - DEBUG - Processed parameter from YAML: SLATB
17:26:28 - DEBUG - Processing YAML dict format for parameter: AMAXTB with keys: ['DNR', 'AMAX']
17:26:28 - DEBUG - Matched array schema: AMAXTB
17:26:28 - DEBUG - Successfully validated AMAXTB
17:26:28 - DEBUG - Processed parameter from YAML: AMAXTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: TMPFTB with keys: ['TAVD', 'TMPF']
17:26:28 - DEBUG - Matched array schema: TMPFTB
17:26:28 - DEBUG - Successfully validated TMPFTB
17:26:28 - DEBUG - Processed parameter from YAML: TMPFTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: TMNFTB with keys: ['TMNR', 'TMNF']
17:26:28 - DEBUG - Matched array schema: TMNFTB
17:26:28 - DEBUG - Successfully validated TMNFTB
17:26:28 - DEBUG - Processed parameter from YAML: TMNFTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RFSETB with keys: ['DNR', 'RFSE']
17:26:28 - DEBUG - Matched array schema: RFSETB
17:26:28 - DEBUG - Successfully validated RFSETB
17:26:28 - DEBUG - Processed parameter from YAML: RFSETB
17:26:28 - DEBUG - Processing YAML dict format for parameter: FRTB with keys: ['DNR', 'FR']
17:26:28 - DEBUG - Matched array schema: FRTB
17:26:28 - DEBUG - Successfully validated FRTB
17:26:28 - DEBUG - Processed parameter from YAML: FRTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: FLTB with keys: ['DNR', 'FL']
17:26:28 - DEBUG - Matched array schema: FLTB
17:26:28 - DEBUG - Successfully validated FLTB
17:26:28 - DEBUG - Processed parameter from YAML: FLTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: FSTB with keys: ['DNR', 'FS']
17:26:28 - DEBUG - Matched array schema: FSTB
17:26:28 - DEBUG - Successfully validated FSTB
17:26:28 - DEBUG - Processed parameter from YAML: FSTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RDRRTB with keys: ['DNR', 'RDRR']
17:26:28 - DEBUG - Matched array schema: RDRRTB
17:26:28 - DEBUG - Successfully validated RDRRTB
17:26:28 - DEBUG - Processed parameter from YAML: RDRRTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RDRSTB with keys: ['DNR', 'RDRS']
17:26:28 - DEBUG - Matched array schema: RDRSTB
17:26:28 - DEBUG - Successfully validated RDRSTB
17:26:28 - DEBUG - Processed parameter from YAML: RDRSTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RLWTB with keys: ['RW', 'RL']
17:26:28 - DEBUG - Matched array schema: RLWTB
17:26:28 - DEBUG - Successfully validated RLWTB
17:26:28 - DEBUG - Processed parameter from YAML: RLWTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RDCTB with keys: ['RRD', 'RDENS']
17:26:28 - DEBUG - Matched array schema: RDCTB
17:26:28 - DEBUG - Successfully validated RDCTB
17:26:28 - DEBUG - Processed parameter from YAML: RDCTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: DMMOWTB with keys: ['DNR', 'DMMOW']
17:26:28 - DEBUG - Matched array schema: DMMOWTB
17:26:28 - DEBUG - Successfully validated DMMOWTB
17:26:28 - DEBUG - Processed parameter from YAML: DMMOWTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: DMMOWDELAY with keys: ['DMMOWDELAY', 'DAYDELAY']
17:26:28 - DEBUG - Matched array schema: DMMOWDELAY
17:26:28 - DEBUG - Successfully validated DMMOWDELAY
17:26:28 - DEBUG - Processed parameter from YAML: DMMOWDELAY
17:26:28 - DEBUG - Loaded YAML content from: /home/runner/work/pySWAP/pySWAP/pyswap/testcase/data/1-hupselbrook/grass_swap.yaml
17:26:28 - DEBUG - Extracted parameters from YAML: ['CHTB', 'SLATB', 'AMAXTB', 'TMPFTB', 'TMNFTB', 'RFSETB', 'FRTB', 'FLTB', 'FSTB', 'RDRRTB', 'RDRSTB', 'RLWTB', 'RDCTB', 'DMMOWTB', 'DMMOWDELAY']
17:26:28 - DEBUG - TableProcessor initialized.
17:26:28 - DEBUG - Processing YAML dict format for parameter: CHTB with keys: ['DNR', 'CH']
17:26:28 - DEBUG - Matched array schema: CHTB
17:26:28 - DEBUG - Successfully validated CHTB
17:26:28 - DEBUG - Processed parameter from YAML: CHTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: SLATB with keys: ['DNR', 'SLA']
17:26:28 - DEBUG - Matched array schema: SLATB
17:26:28 - DEBUG - Successfully validated SLATB
17:26:28 - DEBUG - Processed parameter from YAML: SLATB
17:26:28 - DEBUG - Processing YAML dict format for parameter: AMAXTB with keys: ['DNR', 'AMAX']
17:26:28 - DEBUG - Matched array schema: AMAXTB
17:26:28 - DEBUG - Successfully validated AMAXTB
17:26:28 - DEBUG - Processed parameter from YAML: AMAXTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: TMPFTB with keys: ['TAVD', 'TMPF']
17:26:28 - DEBUG - Matched array schema: TMPFTB
17:26:28 - DEBUG - Successfully validated TMPFTB
17:26:28 - DEBUG - Processed parameter from YAML: TMPFTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: TMNFTB with keys: ['TMNR', 'TMNF']
17:26:28 - DEBUG - Matched array schema: TMNFTB
17:26:28 - DEBUG - Successfully validated TMNFTB
17:26:28 - DEBUG - Processed parameter from YAML: TMNFTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RFSETB with keys: ['DNR', 'RFSE']
17:26:28 - DEBUG - Matched array schema: RFSETB
17:26:28 - DEBUG - Successfully validated RFSETB
17:26:28 - DEBUG - Processed parameter from YAML: RFSETB
17:26:28 - DEBUG - Processing YAML dict format for parameter: FRTB with keys: ['DNR', 'FR']
17:26:28 - DEBUG - Matched array schema: FRTB
17:26:28 - DEBUG - Successfully validated FRTB
17:26:28 - DEBUG - Processed parameter from YAML: FRTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: FLTB with keys: ['DNR', 'FL']
17:26:28 - DEBUG - Matched array schema: FLTB
17:26:28 - DEBUG - Successfully validated FLTB
17:26:28 - DEBUG - Processed parameter from YAML: FLTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: FSTB with keys: ['DNR', 'FS']
17:26:28 - DEBUG - Matched array schema: FSTB
17:26:28 - DEBUG - Successfully validated FSTB
17:26:28 - DEBUG - Processed parameter from YAML: FSTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RDRRTB with keys: ['DNR', 'RDRR']
17:26:28 - DEBUG - Matched array schema: RDRRTB
17:26:28 - DEBUG - Successfully validated RDRRTB
17:26:28 - DEBUG - Processed parameter from YAML: RDRRTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RDRSTB with keys: ['DNR', 'RDRS']
17:26:28 - DEBUG - Matched array schema: RDRSTB
17:26:28 - DEBUG - Successfully validated RDRSTB
17:26:28 - DEBUG - Processed parameter from YAML: RDRSTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RLWTB with keys: ['RW', 'RL']
17:26:28 - DEBUG - Matched array schema: RLWTB
17:26:28 - DEBUG - Successfully validated RLWTB
17:26:28 - DEBUG - Processed parameter from YAML: RLWTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: RDCTB with keys: ['RRD', 'RDENS']
17:26:28 - DEBUG - Matched array schema: RDCTB
17:26:28 - DEBUG - Successfully validated RDCTB
17:26:28 - DEBUG - Processed parameter from YAML: RDCTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: DMMOWTB with keys: ['DNR', 'DMMOW']
17:26:28 - DEBUG - Matched array schema: DMMOWTB
17:26:28 - DEBUG - Successfully validated DMMOWTB
17:26:28 - DEBUG - Processed parameter from YAML: DMMOWTB
17:26:28 - DEBUG - Processing YAML dict format for parameter: DMMOWDELAY with keys: ['DMMOWDELAY', 'DAYDELAY']
17:26:28 - DEBUG - Matched array schema: DMMOWDELAY
17:26:28 - DEBUG - Successfully validated DMMOWDELAY
17:26:28 - DEBUG - Processed parameter from YAML: DMMOWDELAY
Main Crop object¶
the three CropFile objects defined above will be converted by pySWAP to .crp files and used in the simulation. They need to be added to the main Crop object defining the basic settings for crop simulation inside .swp model.
croprotation = psp.components.crop.CROPROTATION.create({
"CROPSTART": [dt(2002, 5, 1), dt(2003, 5, 10), dt(2004, 1, 1)],
"CROPEND": [dt(2002, 10, 15), dt(2003, 9, 29), dt(2004, 12, 31)],
"CROPFIL": ["'maizes'", "'potatod'", "'grassd'"],
"CROPTYPE": [1, 2, 3],
})
crop = psp.components.crop.Crop(
swcrop=1,
rds=200.0,
croprotation=croprotation,
cropfiles={"maizes": crpmaize, "potatod": crppotato, "grassd": crpgrass},
)
ml.crop = crop
crop.cropfiles["maizes"].crp
17:26:28 - DEBUG - Validating Preparation with rules: {'swprep': {1: ['zprep', 'hprep', 'maxprepdelay']}, 'swsow': {1: ['zsow', 'hsow', 'ztempsow', 'tempsow', 'maxsowdelay']}, 'swgerm': {1: ['tsumemeopt', 'tbasem', 'teffmx'], 2: ['tsumemeopt', 'tbasem', 'teffmx', 'hdrygerm', 'hwetgerm', 'zgerm', 'agerm']}}
17:26:28 - DEBUG - Validating CropDevelopmentSettingsFixed with rules: {}
17:26:28 - DEBUG - Validating OxygenStress with rules: {'swoxygen': {1: ['hlim1', 'hlim2u', 'hlim2l'], 2: ['q10_microbial', 'specific_resp_humus', 'srl', 'swrootradius', 'dry_mat_cont_roots', 'air_filled_root_por', 'spec_weight_root_tissue', 'var_a', 'root_radiuso2']}, 'swrootradius': {1: ['dry_mat_cont_roots', 'air_filled_root_por', 'spec_weight_root_tissue', 'var_a'], 2: ['root_radiuso2']}, 'swwrtnonox': {1: ['aeratecrit']}}
17:26:28 - DEBUG - Validating DroughtStress with rules: {'swdrought': {1: ['hlim3h', 'hlim3l', 'hlim4', 'adcrh', 'adcrl'], 2: ['wiltpoint', 'kstem', 'rxylem', 'rootradius', 'kroot', 'rootcoefa', 'swhydrlift', 'rooteff', 'stephr', 'criterhr', 'taccur']}}
17:26:28 - DEBUG - Validating SaltStress with rules: {'swsalinity': {1: ['saltmax', 'saltslope'], 2: ['salthead']}}
17:26:28 - DEBUG - Validating CompensateRWUStress with rules: {'swcompensate': {1: ['swstressor', 'alphacrit'], 2: ['swstressor', 'dcritrtz']}}
17:26:28 - DEBUG - Validating Interception with rules: {'swinter': {1: ['cofab'], 2: ['intertb']}}
17:26:28 - DEBUG - Validating ScheduledIrrigation with rules: {'schedule': {1: ['startirr', 'endirr', 'cirrs', 'isuas', 'tcs', 'dcs', 'dcslim', 'tcsfix']}, 'tcs': {1: ['tc1tb'], 2: ['tc2tb', 'phfieldcapacity'], 3: ['tc3tb', 'phfieldcapacity'], 4: ['tc4tb', 'phfieldcapacity'], 6: ['irgthreshold'], 7: ['tc7tb', 'dcrit', 'swcirrthres'], 8: ['tc8tb', 'dcrit', 'swcirrthres']}, 'swcirrthres': {1: ['cirrthres', 'perirrsurp']}, 'tcsfix': {1: ['irgdayfix']}, 'dcs': {1: ['phfieldcapacity', 'tc1tb', 'raithreshold'], 2: ['tc2tb']}, 'dcslim': {1: ['irgdepmin', 'irgdepmax']}}
'SWPREP = 0\nSWSOW = 0\nSWGERM = 0\nSWHARV = 0\nDVSEND = 3.0\nSWCF = 2\n DVS CH\n 0.0 1.0\n 0.3 15.0\n 0.5 40.0\n 0.7 140.0\n 1.0 170.0\n 1.4 180.0\n 2.0 175.0\n\nALBEDO = 0.23\nRSC = 61.00\nRSW = 0.00\nKDIF = 0.60\nKDIR = 0.75\nSWRD = 1\nRDTB = \n0.0 5.0\n0.3 20.0\n0.5 50.0\n0.7 80.0\n1.0 90.0\n2.0 100.0\n\nRDCTB = \n0.0 1.0\n1.0 0.0\n\nIDEV = 1\nLCC = 168\nSWGC = 1\nGCTB = \n0.0 0.05\n0.3 0.14\n0.5 0.61\n0.7 4.10\n1.0 5.00\n1.4 5.80\n2.0 5.20\n\nSWOXYGEN = 1\nSWWRTNONOX = 0\nAERATECRIT = 0.5\nHLIM1 = -15.0\nHLIM2U = -30.0\nHLIM2L = -30.0\nSWDROUGHT = 1\nHLIM3H = -325.0\nHLIM3L = -600.0\nHLIM4 = -8000.0\nADCRH = 0.5\nADCRL = 0.1\nSWSALINITY = 0\nSWCOMPENSATE = 0\nSWINTER = 1\nCOFAB = 0.25\nSCHEDULE = 0'
Irrigation¶
The irrigation section is relatively short, and if the fixed irrigation application is used, a dataframe of the irrigation events will be necessary.
irrig_events = psp.components.irrigation.IRRIGEVENTS.create({
"IRDATE": ["2002-01-05"],
"IRDEPTH": [5.0],
"IRCONC": [1000.0],
"IRTYPE": [1],
})
fixed_irrigation = psp.components.irrigation.FixedIrrigation(
swirfix=1, swirgfil=0, irrigevents=irrig_events
)
ml.fixedirrigation = fixed_irrigation
Soil-water parameters section¶
This section is defining the soil water interaction parameters.
Soil moisture¶
soilmoisture = psp.components.soilwater.SoilMoisture(swinco=2, gwli=-75.0)
ml.soilmoisture = soilmoisture
Surface flow¶
surfaceflow = psp.components.soilwater.SurfaceFlow(
swpondmx=0, pondmx=0.2, rsro=0.5, rsroexp=1.0, swrunon=0
)
ml.surfaceflow = surfaceflow
Evaporation¶
evaporation = psp.components.soilwater.Evaporation(
cfevappond=1.25, swcfbs=0, rsoil=30.0, swredu=1, cofredbl=0.35, rsigni=0.5
)
ml.evaporation = evaporation
Soil profile¶
soil_profile = psp.components.soilwater.SOILPROFILE.create({
"ISUBLAY": [1, 2, 3, 4],
"ISOILLAY": [1, 1, 2, 2],
"HSUBLAY": [10.0, 20.0, 30.0, 140.0],
"HCOMP": [1.0, 5.0, 5.0, 10.0],
"NCOMP": [10, 4, 6, 14],
})
soil_hydraulic_functions = psp.components.soilwater.SOILHYDRFUNC.create({
"ORES": [0.01, 0.02],
"OSAT": [0.42, 0.38],
"ALFA": [0.0276, 0.0213],
"NPAR": [1.491, 1.951],
"KSATFIT": [12.52, 12.68],
"LEXP": [-1.060, 0.168],
"ALFAW": [0.0542, 0.0426],
"H_ENPR": [0.0, 0.0],
"KSATEXM": [12.52, 12.68],
"BDENS": [1315.0, 1315.0],
})
soilprofile = psp.components.soilwater.SoilProfile(
swsophy=0,
soilprofile=soil_profile,
swhyst=0,
tau=0.2,
soilhydrfunc=soil_hydraulic_functions,
swmacro=0,
)
ml.soilprofile = soilprofile
Drainage¶
dra = psp.components.drainage.DraFile(
dramet=2,
swdivd=1,
cofani=[1.0, 1.0],
swdislay=0,
lm2=11.0,
shape=0.8,
wetper=30.0,
zbotdr=-80.0,
entres=20.0,
ipos=2,
basegw=-200.0,
khtop=25.0,
)
drainage = psp.components.drainage.Drainage(swdra=1, drafile=dra)
ml.lateraldrainage = drainage
Bottom boundary conditions¶
bottom_boundary = psp.components.boundary.BottomBoundary(swbbcfile=0, swbotb=6)
ml.bottomboundary = bottom_boundary
result = ml.run()
17:26:28 - DEBUG - Validating GeneralSettings with rules: {'swscre': {0: None, 1: None, 3: None}, 'swerror': {0: None, 1: None}, 'swmonth': {0: ['period', 'swres', 'swodat'], 1: None}, 'swdat': {0: None, 1: ['outdatin']}, 'swheader': {0: None, 1: None}, 'swyrvar': {0: ['datefix'], 1: ['outdat']}, 'swafo': {0: None, 1: ['critdevmasbal', 'swdiscrvert'], 2: ['critdevmasbal', 'swdiscrvert']}, 'swaun': {0: None, 1: ['critdevmasbal', 'swdiscrvert'], 2: ['critdevmasbal', 'swdiscrvert']}, 'swdiscrvert': {0: None, 1: ['numnodnew', 'dznew']}, 'swcsv': {1: ['inlist_csv']}, 'swcsv_tz': {1: ['inlist_csv_tz']}}
17:26:28 - DEBUG - Validating RichardsSettings with rules: {}
17:26:28 - DEBUG - Validating Meteorology with rules: {'swetr': {1: ['swetsine'], 0: ['alt', 'altw', 'angstroma', 'angstromb', 'swmetdetail']}, 'swrain': {0: None, 1: ['rainflux'], 3: ['rainfil']}, 'swmetdetail': {1: ['nmetdetail']}}
17:26:28 - DEBUG - Validating Crop with rules: {'swcrop': {1: ['rds', 'croprotation', 'cropfiles']}, 'prep': None}
17:26:28 - DEBUG - Validating FixedIrrigation with rules: {'swirfix': {1: ['swirgfil'], 'swirgfil': {0: ['irrigevents'], 1: ['irgfile']}}}
17:26:28 - DEBUG - Validating SoilMoisture with rules: {'swinco': {1: ['head_soildepth'], 2: ['gwli'], 3: ['inifil']}}
17:26:28 - DEBUG - Validating SurfaceFlow with rules: {'swpondmx': {0: ['pondmx'], 1: ['pondmxtb']}, 'swrunon': {1: ['rufil']}}
17:26:28 - DEBUG - Validating Evaporation with rules: {'swcfbs': {1: ['cfbs']}, 'swredu': {1: ['cofredbl', 'rsigni'], 2: ['cofredbo']}}
17:26:28 - DEBUG - Validating SoilProfile with rules: {'swsophy': {0: ['soilhydrfunc'], 1: ['filenamesophy']}, 'swhyst': {1: ['tau'], 2: ['tau']}}
17:26:28 - DEBUG - Validating SnowAndFrost with rules: {'swsnow': {1: ['snowinco', 'teprrain', 'teprsnow', 'snowcoef']}, 'swfrost': {1: ['tfrostst', 'tfrostend']}}
17:26:28 - DEBUG - Validating Drainage with rules: {'swdra': {1: ['drafile'], 2: ['drafile']}}
17:26:28 - DEBUG - Validating BottomBoundary with rules: {}
17:26:28 - DEBUG - Validating HeatFlow with rules: {'swhea': {1: ['swcalt', 'swtopbhea', 'swbotbhea']}, 'swcalt': {1: ['tampli', 'tmean', 'timref', 'ddamp'], 2: ['soiltextures', 'initsoiltemp', 'swtopbhea', 'swbotbhea']}, 'swtopbhea': {2: ['tsoilfile']}, 'swbotbhea': {2: ['bbctsoil']}}
17:26:28 - DEBUG - Validating SoluteTransport with rules: {'swsolu': {1: ['cpre', 'cdrain', 'swbotbc', 'swsp', 'misc', 'ddif', 'tscf', 'swdc', 'swbr']}, 'swbotbc': {1: ['cseep'], 2: ['cseeparrtb']}, 'swsp': {1: ['frexp', 'cref']}, 'swdc': {1: ['gampar', 'rtheta', 'bexp']}, 'swbr': {1: ['daquif', 'poros', 'kfsat', 'decsat', 'cdraini', 'inissoil']}}
17:26:28 - INFO - Validation successful.
17:26:28 - INFO - Preparing files...
17:26:28 - INFO - swap.swp saved successfully.
17:26:28 - INFO - swap.dra saved successfully.
17:26:28 - DEBUG - Validating Preparation with rules: {'swprep': {1: ['zprep', 'hprep', 'maxprepdelay']}, 'swsow': {1: ['zsow', 'hsow', 'ztempsow', 'tempsow', 'maxsowdelay']}, 'swgerm': {1: ['tsumemeopt', 'tbasem', 'teffmx'], 2: ['tsumemeopt', 'tbasem', 'teffmx', 'hdrygerm', 'hwetgerm', 'zgerm', 'agerm']}}
17:26:28 - DEBUG - Validating CropDevelopmentSettingsFixed with rules: {}
17:26:28 - DEBUG - Validating OxygenStress with rules: {'swoxygen': {1: ['hlim1', 'hlim2u', 'hlim2l'], 2: ['q10_microbial', 'specific_resp_humus', 'srl', 'swrootradius', 'dry_mat_cont_roots', 'air_filled_root_por', 'spec_weight_root_tissue', 'var_a', 'root_radiuso2']}, 'swrootradius': {1: ['dry_mat_cont_roots', 'air_filled_root_por', 'spec_weight_root_tissue', 'var_a'], 2: ['root_radiuso2']}, 'swwrtnonox': {1: ['aeratecrit']}}
17:26:28 - DEBUG - Validating DroughtStress with rules: {'swdrought': {1: ['hlim3h', 'hlim3l', 'hlim4', 'adcrh', 'adcrl'], 2: ['wiltpoint', 'kstem', 'rxylem', 'rootradius', 'kroot', 'rootcoefa', 'swhydrlift', 'rooteff', 'stephr', 'criterhr', 'taccur']}}
17:26:28 - DEBUG - Validating SaltStress with rules: {'swsalinity': {1: ['saltmax', 'saltslope'], 2: ['salthead']}}
17:26:28 - DEBUG - Validating CompensateRWUStress with rules: {'swcompensate': {1: ['swstressor', 'alphacrit'], 2: ['swstressor', 'dcritrtz']}}
17:26:28 - DEBUG - Validating Interception with rules: {'swinter': {1: ['cofab'], 2: ['intertb']}}
17:26:28 - DEBUG - Validating ScheduledIrrigation with rules: {'schedule': {1: ['startirr', 'endirr', 'cirrs', 'isuas', 'tcs', 'dcs', 'dcslim', 'tcsfix']}, 'tcs': {1: ['tc1tb'], 2: ['tc2tb', 'phfieldcapacity'], 3: ['tc3tb', 'phfieldcapacity'], 4: ['tc4tb', 'phfieldcapacity'], 6: ['irgthreshold'], 7: ['tc7tb', 'dcrit', 'swcirrthres'], 8: ['tc8tb', 'dcrit', 'swcirrthres']}, 'swcirrthres': {1: ['cirrthres', 'perirrsurp']}, 'tcsfix': {1: ['irgdayfix']}, 'dcs': {1: ['phfieldcapacity', 'tc1tb', 'raithreshold'], 2: ['tc2tb']}, 'dcslim': {1: ['irgdepmin', 'irgdepmax']}}
17:26:28 - INFO - maizes.crp saved successfully.
17:26:28 - DEBUG - Validating Preparation with rules: {'swprep': {1: ['zprep', 'hprep', 'maxprepdelay']}, 'swsow': {1: ['zsow', 'hsow', 'ztempsow', 'tempsow', 'maxsowdelay']}, 'swgerm': {1: ['tsumemeopt', 'tbasem', 'teffmx'], 2: ['tsumemeopt', 'tbasem', 'teffmx', 'hdrygerm', 'hwetgerm', 'zgerm', 'agerm']}}
17:26:28 - DEBUG - Validating CropDevelopmentSettingsWOFOST with rules: {'swcf': {1: ['cftb'], 2: ['chtb', 'albedo', 'rsc', 'rsw']}, 'swrd': {1: ['rdtb'], 2: ['rdi', 'rri', 'rdc', 'swdmi2rd'], 3: ['rlwtb', 'wrtmax']}, 'idsl': {1: ['dlc', 'dlo'], 2: ['dlc', 'dlo', 'vernsat', 'vernbase', 'verndvs', 'verntb']}}
17:26:28 - DEBUG - Validating OxygenStress with rules: {'swoxygen': {1: ['hlim1', 'hlim2u', 'hlim2l'], 2: ['q10_microbial', 'specific_resp_humus', 'srl', 'swrootradius', 'dry_mat_cont_roots', 'air_filled_root_por', 'spec_weight_root_tissue', 'var_a', 'root_radiuso2']}, 'swrootradius': {1: ['dry_mat_cont_roots', 'air_filled_root_por', 'spec_weight_root_tissue', 'var_a'], 2: ['root_radiuso2']}, 'swwrtnonox': {1: ['aeratecrit']}}
17:26:28 - DEBUG - Validating DroughtStress with rules: {'swdrought': {1: ['hlim3h', 'hlim3l', 'hlim4', 'adcrh', 'adcrl'], 2: ['wiltpoint', 'kstem', 'rxylem', 'rootradius', 'kroot', 'rootcoefa', 'swhydrlift', 'rooteff', 'stephr', 'criterhr', 'taccur']}}
17:26:28 - DEBUG - Validating SaltStress with rules: {'swsalinity': {1: ['saltmax', 'saltslope'], 2: ['salthead']}}
17:26:28 - DEBUG - Validating CompensateRWUStress with rules: {'swcompensate': {1: ['swstressor', 'alphacrit'], 2: ['swstressor', 'dcritrtz']}}
17:26:28 - DEBUG - Validating Interception with rules: {'swinter': {1: ['cofab'], 2: ['intertb']}}
17:26:28 - DEBUG - Validating ScheduledIrrigation with rules: {'schedule': {1: ['startirr', 'endirr', 'cirrs', 'isuas', 'tcs', 'dcs', 'dcslim', 'tcsfix']}, 'tcs': {1: ['tc1tb'], 2: ['tc2tb', 'phfieldcapacity'], 3: ['tc3tb', 'phfieldcapacity'], 4: ['tc4tb', 'phfieldcapacity'], 6: ['irgthreshold'], 7: ['tc7tb', 'dcrit', 'swcirrthres'], 8: ['tc8tb', 'dcrit', 'swcirrthres']}, 'swcirrthres': {1: ['cirrthres', 'perirrsurp']}, 'tcsfix': {1: ['irgdayfix']}, 'dcs': {1: ['phfieldcapacity', 'tc1tb', 'raithreshold'], 2: ['tc2tb']}, 'dcslim': {1: ['irgdepmin', 'irgdepmax']}}
17:26:28 - INFO - potatod.crp saved successfully.
17:26:28 - DEBUG - Validating CropDevelopmentSettingsGrass with rules: {}
17:26:28 - DEBUG - Validating OxygenStress with rules: {'swoxygen': {1: ['hlim1', 'hlim2u', 'hlim2l'], 2: ['q10_microbial', 'specific_resp_humus', 'srl', 'swrootradius', 'dry_mat_cont_roots', 'air_filled_root_por', 'spec_weight_root_tissue', 'var_a', 'root_radiuso2']}, 'swrootradius': {1: ['dry_mat_cont_roots', 'air_filled_root_por', 'spec_weight_root_tissue', 'var_a'], 2: ['root_radiuso2']}, 'swwrtnonox': {1: ['aeratecrit']}}
17:26:28 - DEBUG - Validating DroughtStress with rules: {'swdrought': {1: ['hlim3h', 'hlim3l', 'hlim4', 'adcrh', 'adcrl'], 2: ['wiltpoint', 'kstem', 'rxylem', 'rootradius', 'kroot', 'rootcoefa', 'swhydrlift', 'rooteff', 'stephr', 'criterhr', 'taccur']}}
17:26:28 - DEBUG - Validating SaltStress with rules: {'swsalinity': {1: ['saltmax', 'saltslope'], 2: ['salthead']}}
17:26:28 - DEBUG - Validating CompensateRWUStress with rules: {'swcompensate': {1: ['swstressor', 'alphacrit'], 2: ['swstressor', 'dcritrtz']}}
17:26:28 - DEBUG - Validating Interception with rules: {'swinter': {1: ['cofab'], 2: ['intertb']}}
17:26:28 - DEBUG - Validating ScheduledIrrigation with rules: {'schedule': {1: ['startirr', 'endirr', 'cirrs', 'isuas', 'tcs', 'dcs', 'dcslim', 'tcsfix']}, 'tcs': {1: ['tc1tb'], 2: ['tc2tb', 'phfieldcapacity'], 3: ['tc3tb', 'phfieldcapacity'], 4: ['tc4tb', 'phfieldcapacity'], 6: ['irgthreshold'], 7: ['tc7tb', 'dcrit', 'swcirrthres'], 8: ['tc8tb', 'dcrit', 'swcirrthres']}, 'swcirrthres': {1: ['cirrthres', 'perirrsurp']}, 'tcsfix': {1: ['irgdayfix']}, 'dcs': {1: ['phfieldcapacity', 'tc1tb', 'raithreshold'], 2: ['tc2tb']}, 'dcslim': {1: ['irgdepmin', 'irgdepmax']}}
17:26:28 - DEBUG - Validating GrasslandManagement with rules: {'swharvest': {2: ['dateharvest']}, 'swdmgrz': {1: ['dmgrazing'], 2: ['dmgrztb', 'maxdaygrz', 'tagprest', 'dewrest', 'lsda']}, 'swdmmow': {1: ['dmharvest', 'daylastharvest', 'dmlastharvest', 'maxdaymow'], 2: ['dmmowtb', 'dmmowdelay']}}
17:26:28 - DEBUG - Validating CO2Correction with rules: {'swco2': {1: ['atmofil', 'co2amaxtb', 'co2efftb', 'co2tratb']}}
17:26:29 - INFO - grassd.crp saved successfully.
17:26:29 - INFO - Atmospheric.co2 saved successfully.
17:26:29 - INFO - 283.met saved successfully.
17:26:29 - INFO - running swap .... Swap normal completion!
17:26:29 - WARNING - Warning from module Readswap : simulation with additonal Ksat value (Ksatexm)
result.yearly_summary["EPOT"].plot()
<Axes: xlabel='DATETIME'>