Skip to content
stefan fluck edited this page Feb 22, 2023 · 38 revisions
image-20200520212714236

Author: Stefan Fluck
Get in touch via discussions, or raise issues with the code in the Issues.

Quick Links

Quick Reference Table for geodata: All necessary attributes in the shapefiles for palmpy
Description of the Namelist parameters
INIFOR operation

TL;DR

To generate a static driver with palmpy, you first need to compile the necessary geodata. What is needed can be found the Quick Reference Table (not all files are required, depends on your choices). palmpy is operated with a special namelist, where you set if your static driver shall include terrain, buildings, 3d vegetation etc, and you say how large, it's resolution and where the domain shall be. To run palmpy, just install the required packages and run python make_static.py, select the namelist in the popup window, and it will generate a static driver for you, including parameters you can copy into your PALM p3d file.

Introduction

Welcome to palmpy! This useful collection of code will help you create static files for your PALM simulation. The code collection and this documentation assists you in the following tasks:

  • PALM static driver file generation
    • transform raster data and shapefiles into PALM-readable format
  • PALM dynamic driver file generation
    • COSMO data preprocessor scripts to make them usable with INIFOR
  • Runtime progress plot
    • plotting routine for tmp/casename.id/RUN_CONTROL data

...with a clear focus on the first task, as it is clearly the most labor-intensive and tedious step of them all. Part of the framework are also supporting files, such as conda environment setup files and bash routines, that support PALM simulation activities in general. Furthermore, this documentation is set up to be a helpful source of information regarding many operations around PALM, be it from geodata handling, to regridding operations and more. Refer to the Table of Contents above for a full overview of the contents.

This framework is the result of a master thesis at the Center for Aviation, ZHAW School of Engineering in Winterthur and is work in progress beyond the project deadline.

DISCLAIMER: No liability is assumed regarding the correctness of the provided routines. Users shall check the behavior and the produced results careful. The reporting of bugs is highly appreciated.

Overview

There are multiple componentes to this framework, namely

  • the palmpy python package
  • the make_static python script
  • supporting bash scripts
    • COSMO data preprocessing for INIFOR
    • Plotting scripts

The palmpy python package and the make_static script are tightly linked, as the make_static script will call palmpy functions during static file generation. Therefore, this documentation will mainly contain descriptions regarding these two components. The supporting bash scripts serve particular stand-alone purposes that are straightforward and do not require an indepth discussion.

In the section palmpy Installation you can find information on how to get it up and running!

In palmpy Functions, each submodule of the in python importable palmpy module is described. Furthermore, conversion "dialects" or dictionaries are described in there. Have a look at it here, how you create new conversion dictionaries.

Following that, the make_static script is described in detail. This includes a description of the applied paradigms and standards, what the possibilities are with palmpy and how the actual script operates.

In the section Geodata for palmpy, it is outlined how geodata needs to be processed for it to be compatible with palmpy. This is the most time consuming part of your work. Each type of input data is described, as well as all required features are compiled in a quick reference table for quick access.

In Create a static driver, the process how to create a static driver is described, including a description of the options available in the Namelist.

The Useful Information section acts as a knowledge base regarding various topics around PALM. As preparing a large-scale forcing of PALM with COSMO data may be difficult for new users, the section Dynamic Driver Generation with INFOR will provide guidance. Furthermore, information about 3D visualizations, lessons learned about PALM and multiple useful code snippets are also part of this section. Finally, guidance is given on how to perform certain geodata preprocessing steps in QGIS.

Reasons for this Choice of Setup

The goal of the master thesis behind this framework was to create a code structure that will facilitate the simulation setup in the future. Therefore, a way needed to be found that allows the efficient creation of new static driver files, while still providing enough flexibility to incorporate individual changes to the files. This was achieved by selecting Python as a base for the whole framework and outsource the most important functions of the static generation process into a python package. In this way, one could either use the provided make_static script to generate a static driver file, or one could just make use of palmpy functions and use the make_static script as a starting point for individual changes. The chosen approach therefore allows for maximum flexibility, while still providing an almost one-button-pushing solution that enables faster turnover times. Looking at the future, the provided code structures would, with some tweaks and a choice of sensible geodata, theoretically allow an automated execution of all steps and therefore a simulation on any spot on earth with a few clicks.