Skip to content

Commit 4634cec

Browse files
authored
Added API description
1 parent a285fca commit 4634cec

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
# dales-lib
22
This is a dedicated fork of Dales, the Dutch Atmospheric Large-Eddy Simulation model.
33
The purpose of dales-lib is to be embedded within a column of an atmospheric model,
4-
having its own MPI communicator. More information follows...
4+
having its own MPI communicator and extensive fortran API that allows it to be called from other (Fortran) codes. The API is to some extent tailored to be called from the OMUSE wrapper of DALES: https://bitbucket.org/omuse/omuse/branch/meteo.
5+
6+
### API functions
7+
8+
The API source code is located in `daleslib.f90`, it contains the public functions
9+
10+
* `initialize(path,mpi_comm,date,time)`: initializes a dales model from a fortran namelist file in `path`. Optionally, one can pass an MPI (sub-)communicator `mpi_comm` for the DALES internal messaging, and integers `date` and `time` to set the stard date and time (used for zenith angle and time axes in netCDF output).
11+
* `step`: performs a dales time step; it is identical to the original DALES time step, except that it adds user-defined large scale forcings to the total tendencies.
12+
* `run_to(tstop)`: iteratively calls stepping until tyhe model time reached `tstop`.
13+
* `finalize`: clears model, deallocates all of its state arrays.
14+
* `get_model_time`: returns the model time in seconds since start time.
15+
* `allocate_3d(a)`: helper function to allocate the array`a` to the size of the model grid.
16+
* `gatherlayeravg(Al,Ag)`: helper function that gathers the array `Al` on all MPI tasks and writes the slab averages (vertical profile) to the array `Ag` on the rank-0 MPI task.
17+
* `gathervol(Al,Ag)`: helper function that gathers 3D arrays `Al` and glues them to the global 3D array `Ag` on the rank-0 MPI task.
18+
19+
Furthermore the API contains the global profile arrays `u_tend`, `v_tend`, `thl_tend`, `qt_tend` for large-scale tendencies of resp. x- and y-velocities, potential temperature and total humidity. These arrays can be modified at any moment and their values will be automatically picked up in the next time step.

0 commit comments

Comments
 (0)