cwatm_initial module¶
- class cwatm.cwatm_initial.CWATModel_ini[source]¶
Bases:
cwatm.management_modules.dynamicModel.DynamicModelCWatM model initialization class for hydrological system setup.
This class handles the complete initialization of the CWatM hydrological model, including loading of input data, setting up hydrological modules, configuring the spatial domain, and preparing all model state variables for simulation.
The initialization process includes: - Spatial domain definition (mask map, coordinate system) - Hydrological module instantiation and initialization - Initial condition loading for all state variables - Water demand and supply system setup - Routing and water body initialization - Output system configuration
- Variables
var (Variables) – Container for model state variables and parameters
conf (Config) – Container for model configuration settings
MaskMap (numpy.ndarray) – Spatial mask defining the model domain
output_module (outputTssMap) – Module handling time series and map outputs
misc_module (miscInitial) – Module for miscellaneous initialization tasks
init_module (initcondition) – Module for loading initial conditions
readmeteo_module (readmeteo) – Module for meteorological data reading
environflow_module (environflow) – Module for environmental flow calculations
evaporationPot_module (evaporationPot) – Module for potential evapotranspiration
inflow_module (inflow) – Module for external inflow handling
snowfrost_module (snow_frost) – Module for snow and frost processes
soil_module (soil) – Module for soil water processes
landcoverType_module (landcoverType) – Module for land cover and land use
evaporation_module (evaporation) – Module for actual evapotranspiration
groundwater_module (groundwater) – Module for groundwater processes
groundwater_modflow_module (groundwater_modflow) – Module for MODFLOW coupling (advanced groundwater)
waterdemand_module (water_demand) – Module for water demand calculations
wastewater_module (wastewater) – Module for wastewater treatment
capillarRise_module (capillarRise) – Module for capillary rise processes
interception_module (interception) – Module for rainfall interception
sealed_water_module (sealed_water) – Module for sealed/impervious surface processes
runoff_concentration_module (runoff_concentration) – Module for runoff concentration and routing
lakes_res_small_module (lakes_res_small) – Module for small lakes and reservoirs
routing_kinematic_module (routing_kinematic) – Module for kinematic wave routing
lakes_reservoirs_module (lakes_reservoirs) – Module for large lakes and reservoirs
waterquality1 (waterquality1) – Module for water quality calculations
Notes
The initialization order is critical as some modules depend on variables or parameters set by previous modules. Groundwater initialization occurs before meteorological reading to check for steady-state conditions. MODFLOW coupling is activated when ‘modflow_coupling’ is True in settings.
Global variables =================================== ========== ====================================================================== ===== Variable [self.var] Type Description Unit =================================== ========== ====================================================================== ===== modflow Flag True if modflow_coupling = True in settings file bool =================================== ========== ====================================================================== =====
- i = 1¶
- class cwatm.cwatm_initial.Config[source]¶
Bases:
objectConfiguration container class for CWatM model settings.
This class serves as a container for model configuration parameters and settings that are passed between different model components. Currently implemented as a simple namespace for dynamic attribute assignment.
Notes
This class is used to store configuration parameters that need to be accessible across different hydrological modules during model initialization and execution.
- class cwatm.cwatm_initial.Variables[source]¶
Bases:
objectContainer class for CWatM variable storage and initial condition loading.
This class provides methods for loading initial hydrological conditions either from settings files or netCDF initialization files.
- Variables
initmap (dict) – Dictionary storing initial condition maps during calibration mode
loadInit (bool) – Flag indicating whether to load initial conditions from netCDF files
initLoadFile (str) – Path to the initial condition netCDF file
- load_initial(name, default=0.0, number=None)[source]¶
Load initial hydrological conditions for model state variables.
First checks if the initial value is provided in the settings file. If not available, loads from the initialization netCDF file. This method supports both single values and multi-layer variables (e.g., soil layers, snow layers, runoff concentration layers).
- Parameters
name (str) – Name of the initial condition variable to load
default (float, optional) – Default value to use if no initial condition is found (default: 0.0)
number (int, optional) – Layer number for multi-layer variables (e.g., soil layers, snow layers) When provided, appended to variable name for identification
- Returns
Spatial map array or scalar value of the initial condition
- Return type
numpy.ndarray or float
Notes
During calibration mode (Flags[‘calib’]), loaded initial maps are stored in the initmap dictionary for potential reuse across calibration runs. Multi-layer variables are identified by appending the layer number to the base variable name.