wrfhydropy.Model
- class wrfhydropy.Model(source_dir: str, model_config: str, hydro_namelist_config_file: str | None = None, hrldas_namelist_config_file: str | None = None, compile_options_config_file: str | None = None, compiler: str = 'gfort', pre_compile_cmd: str | None = None, compile_options: dict | None = None)[source]
Class for a WRF-Hydro model, which consitutes the model source code and compiled binary.
Methods
compile(compile_dir)Compiles WRF-Hydro using specified compiler and compile options.
copy_files(dest_dir[, symlink])Copy domain files to new directory :Parameters: * dest_dir -- The destination directory for files * symlink -- Symlink files instead of copy
- __init__(source_dir: str, model_config: str, hydro_namelist_config_file: str | None = None, hrldas_namelist_config_file: str | None = None, compile_options_config_file: str | None = None, compiler: str = 'gfort', pre_compile_cmd: str | None = None, compile_options: dict | None = None)[source]
Instantiate a Model object. :Parameters: * source_dir – Directory containing the source code, e.g.
‘wrf_hydro_nwm/src’.
model_config – The configuration of the model. Used to match a model to a domain configuration. Must be a key in both the *_namelists.json of in the source directory and the *_namelist_patches.json in the domain directory.
machine_spec – Optional dictionary of machine specification or string containing the name of a known machine. Known machine names include ‘cheyenne’. For an example of a machine specification see the ‘cheyenne’ machine specification using wrfhydropy.get_machine_spec(‘cheyenne’).
hydro_namelist_config_file – Path to a hydro namelist config file external to the model repository. Default(None) implies using the model src/hydro_namelists.json.
hrldas_namelist_config_file – As for hydro_namelist_config_file, but for hrldas namelist.
compile_options_config_file – As for hydro_namelist_config_file, but for compile options.
compiler – The compiler to use, must be one of ‘pgi’,’gfort’, ‘ifort’, or ‘luna’.
compile_options – Changes to default compile-time options.
Methods
__init__(source_dir, model_config[, ...])Instantiate a Model object. :Parameters: * source_dir -- Directory containing the source code, e.g. 'wrf_hydro_nwm/src'. * model_config -- The configuration of the model. Used to match a model to a domain configuration. Must be a key in both the _namelists.json of in the source directory and the *_namelist_patches.json in the domain directory. * **machine_spec* -- Optional dictionary of machine specification or string containing the name of a known machine. Known machine names include 'cheyenne'. For an example of a machine specification see the 'cheyenne' machine specification using wrfhydropy.get_machine_spec('cheyenne'). * hydro_namelist_config_file -- Path to a hydro namelist config file external to the model repository. Default(None) implies using the model src/hydro_namelists.json. * hrldas_namelist_config_file -- As for hydro_namelist_config_file, but for hrldas namelist. * compile_options_config_file -- As for hydro_namelist_config_file, but for compile options. * compiler -- The compiler to use, must be one of 'pgi','gfort', 'ifort', or 'luna'. * compile_options -- Changes to default compile-time options.
compile(compile_dir)Compiles WRF-Hydro using specified compiler and compile options.
copy_files(dest_dir[, symlink])Copy domain files to new directory :Parameters: * dest_dir -- The destination directory for files * symlink -- Symlink files instead of copy
Attributes
source_dirpathlib.Path object for source code directory.
model_configSpecified configuration for which the model is to be used, e.g. 'nwm_ana'.
compilerThe compiler chosen at compile time.
pre_compile_cmdCommand string to be executed prior to model compilation, e.g. to load modules.
compile_optionsHydro namelist for specified model config
hydro_namelist_config_fileHydro namelist file specified for model config
hrldas_namelist_config_fileHRLDAS namelist file specified for model config.
compile_options_config_fileCompile options file specified for model config.
hydro_namelistsHydro namelist for specified model config
hrldas_namelistsHRLDAS namelist for specified model config
compile_dirpathlib.Path object pointing to the compile directory.
git_hashThe git revision hash if seld.source_dir is a git repository
versionSource code version from .version file stored with the source code.
configure_logThe subprocess object generated at configure.
compile_logThe subprocess object generated at compile.
object_idA unique id to join object to compile directory.
table_filespathlib.Paths to *.TBL files generated at compile-time.
wrf_hydro_exepathlib.Path to wrf_hydro.exe file generated at compile-time.