PPE setup interface
iterate_dict_to_set_value
iterate_dict_to_set_value(
case: case, settings_dict: dict, dict_name: str
)
Iterate through a dictionary and set the values in the case object
Parameters
case : CIME.case The case object to be updated settings_dict : dict Dictionary of settings to be applied to the case
Source code in tinkertool/setup/case.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
build_base_case
build_base_case(
basecaseroot: Path,
overwrite: bool,
case_settings: dict,
env_pe_settings: dict,
env_run_settings: dict,
env_build_settings: dict,
namelist_collection_dict: dict,
paramDataset: Dataset,
pdim: str,
) -> Path
Create and build the base case that all PPE cases are cloned from
Parameters
basecaseroot : Path The base case root directory overwrite : bool Overwrite existing cases case_settings : dict Dictionary of case settings env_pe_settings : dict Dictionary of environment parallel execution settings env_run_settings : dict Dictionary of environment run settings namelist_collection_dict : dict Dictionary of namelist collections for the different components verbose : int Verbosity level for logging
Returns
Path The root directory of the base case
Source code in tinkertool/setup/case.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
clone_base_case
clone_base_case(
baseroot: Path,
basecaseroot: Path,
overwrite: bool,
paramDataset: Dataset,
componentdict: dict,
ensemble_idx: str,
namelist_collection_dict: dict,
path_base_input: Path = Path(""),
keepexe: bool = False,
**kwargs
) -> Path
Clone the base case and update the namelist parameters
Parameters
baseroot : Path The base directory for the cases basecaseroot : Path The base case root directory overwrite : bool Overwrite existing cases paramDataset : xr.Dataset Dataset of namelist parameters to be updated componentdict : dict Dictionary of component names for the parameters ensemble_idx : str The ensemble index for the new case path_base_input : Path The path to the base input files keepexe : bool Keep the executable files **kwargs : dict Additional keyword arguments to be passed to the case updates
Returns
Path The root directory of the cloned case
Source code in tinkertool/setup/case.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
take
take(n, iterable)
Return first n items of the iterable as a list
Source code in tinkertool/setup/case.py
476 477 478 | |
format_value
format_value(value: str) -> str
Format a string for Fortran namelist: booleans and numerics are left as-is, comma-separated lists are handled, other strings are quoted.
Parameters
value : str The string to format.
Source code in tinkertool/setup/namelist.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
setup_usr_nlstring
setup_usr_nlstring(
user_nl_config: ConfigParser, component_name: str
) -> str
Takes inn configparser objects of default namelist settings for setting dianoistics and control namelist settings.
Parameters:
user_nl_config : configparser.ConfigParser A configparser object containing default namelist settings. component_name : str Name of the component for which the namelist settings are being set up, e.g. 'cam', 'clm', etc. Per now only 'blom' is the exception where the namelist section is not used.
Source code in tinkertool/setup/namelist.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
write_user_nl_file
write_user_nl_file(
caseroot: str, usernlfile: str, user_nl_str: str
) -> None
write user_nl string to file. Here we OVERWRITE the full file content, i.e. creating a new file. This implies that that the contral files should hold all key-value pairs.
Parameters
caseroot : str root directory of the case usernlfile : str name of the user_nl file, e.g. user_nl_cam, user_nl_clm ... user_nl_str : str string to be written to the user_nl file verbose : bool verbose output
Source code in tinkertool/setup/namelist.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
add_CIME_paths
add_CIME_paths(cesmroot: str | Path) -> None
Add CIME paths to the system path.
Parameters
cesmroot : str | Path Path to the CESM root directory.
Source code in tinkertool/setup/setup_cime_connection.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
add_CIME_paths_and_import
add_CIME_paths_and_import(cesmroot: str | Path) -> None
Add CIME paths to the system path and import necessary functions to build and clone cases.
Parameters
cesmroot : str Path to the CESM root directory.
Source code in tinkertool/setup/setup_cime_connection.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |