# wrfrun resources module

This module contains resources used by other wrfrun modules.

A `__init__.py` file will be generated by `generate_init.py` when building the package.

The main resource directory and each subdirectory has a `name_map.json` file which maps real name of files or directories to a simpler name. `generate_init.py` reads these JSON and generates variable names based on the name inside it.

For example, assume we have a directory which structure is like:

```
res
 |
 |---extension
 |      |
 |      |---plotgrids.ncl
 |      ----name_map.json
 |
 |---job_scheduler
 |      |
 |      |---pbs.template
 |      ----name_map.json
 |
 |---config.yaml.template
 ----name_map.json
```

And the content of each `name_map.json` is:

```json
{
    "extension": {
        "name": "EXT",
        "type": "dir",
    },
    "job_scheduler": {
        "name": "JOBSYS",
        "type": "dir",
    },
    "config.yaml.template": {
        "name": "CONFIG_TEMPLATE",
        "type": "file",
    }
}
```

```json
{
    "plotgrids.ncl": {
        "name": "PLOT_DOMAIN_NCL",
        "type": "file",
    }
}
```

```json
{
    "pbs.template": {
        "name": "PBS_TEMPLATE",
        "type": "file",
    }
}
```

Then, the generated variable names in `__init__.py` are:

```python
EXT_PLOT_DOMAIN_NCL = "..."
JOBSYS_PBS_TEMPLATE = "..."
CONFIG_TEMPLATE = "..."
```

