# Manual pages for LPJmL 4.0.001

## List of LPJmL programs

Command | Description
--- | ---
`adddrain` (1) | Adds river basin to coordinate file
`asc2clm` (1) | Convert CRU ASCII files to clm data files for LPJmL
`backtrace` (1) | Create backtrace from core file
`bin2cdf` (1) | Convert binary output files into NetCDF files
`catclm` (1) | Concatenate climate data files
`cdf2clm` (1) | convert NetCDF files into CLM files
`cdf2soil` (1) | convert NetCDF file into binary file
`cft2clm` (1) | convert binary land use data files to clm data files for LPJmL
`clm2cdf` (1) | convert CLM files into NetCDF files
`configure.sh` (1) | Configure LPJmL
`cru2clm` (1) | convert raw binary data files to clm data files for LPJmL
`cutclm` (1) | Cuts climate data files
`grid2clm` (1) | convert grid data file to clm data files for LPJmL
`lpjcat` (1) | Concatenates restart files from distributed LPJmL simulations.
`lpjcheck` (1) | Checks syntax of LPJmL configuration files
`lpj` (1) | Dynamic global vegetation model with river routing
`lpjfiles` (1) | Print list of input/output files of LPJmL
`lpjml` (1) | Dynamic global vegetation model with managed landuse and river routing
`lpjprint` (1) | Print contents of restart file of LPJmL model runs
`lpjrun` (1) | Run parallel LPJmL program interactively.
`lpjsave` (1) | Save input/output files of LPJmL using Tivoli Storage Manager TSM
`lpjsubmit` (1) | Submit parallel LoadLeveler job for LPJmL simulation
`printheader` (1) | Print header of clm files for LPJmL
`txt2clm` (1) | Convert CRU ASCII files to clm data files for LPJmL
`cat2bsq` (1) | Concatenates output files from distributed LPJmL simulations
`output_bsq` (1) | Concatenates all output files from distributed LPJmL simulations
`lpj_paths.sh` (1) | Set environmental variables used by LPJmL
`lpj_paths.csh` (1) | Set environmental variables used by LPJmL for C shell

## List of LPJmL file formats

Format | Description
--- | ---
clm (5) | Input data files for LPJmL runs
lpjml.conf (5) | Configuration file for LPJmL runs
lpjml_image.conf (5) | Configuration file for LPJmL runs coupled to IMAGE model
lpj.conf (5) | Configuration file for LPJmL runs with natural vegetation

## List of LPJmL related functions

### LPJmL core functions

Function | Description
--- | ---
close_image (3) | Closes socket connection to IMAGE model
failonerror (3) | prints error message and terminates program
fcloseoutput (3) | closes LPJmL output files
flux_sum (3) | calculates global carbon and water fluxes
fopenoutput (3) | opens LPJmL output files
fprintconfig (3) | print LPJml configuration
fprintflux (3) | print global carbon and water fluxes
freeclimate (3) | closes files and deallocates climate data
freeconfig (3) | deallocates memory for LPJmL configuration
freegrid (3) | deallocates memory of LPJmL grid
freeinput (3) | closes files and deallocates input data
freelanduse (3) | closes file and deallocates land use data
freewateruse (3) | closes file and deallocates water use data
fwriterestart (3) | writes restart file
getclimate (3) | gets climate data for specified year
getco2 (3) | gets atmospheric CO2 concentration
getlanduse (3) | gets land use data
getpopdens (3) | gets population density data
getwateruse (3) | gets water use data
initclimate (3) | initializes climate data
initconfig (3) | initializes LPJmL configuration for the sequential version
initdrain (3) | initializes river routing network
initinput (3) | initializes input data
initlanduse (3) | initializes land use data
initmpiconfig (3) | initializes LPJmL configuration for the MPI version
initpopdens (3) | initializes population density data
initwateruse (3) | initializes water use data
isopen (3) | determines whether output file is open
isroot (3) | determines whether task is root task
iterate (3) | main time loop for LPJmL
iterateyear (3) | year time loop for LPJmL without river routing
newgrid (3) | allocates LPJ grid cells
open_image (3) | opens socket connection to IMAGE model
printconfig (3) | prints LPJmL configuration
printflags (3) | prints LPJmL compilation flags and compiler used
readconfig (3) | reads LPJmL configuration
writecoords (3) | writes coordinate file
writecountrycode (3) | writes country code file
writeregioncode (3) | writes region code file

### Functions of the Pnet library

Function | Description
--- | ---
pnet_addconnect (3) | Add connection to network
pnet_dup (3) | Duplicate network
pnet_exchg (3) | Exchange input and output data
pnet_free (3) | Deallocate memory of Pnet struct
pnet_hi (3) | Get upper bound for local sublattice
pnet_inindex (3) | Get index for input buffer
pnet_init (3) | Initialize Pnet datatypye
pnet_inlen (3) | Get number of connections
pnet_input (3) | Get pointer to input buffer
pnet_lo (3) | Get lower bound for local sublattice
pnet_nodes (3) | Get total number of nodes
pnet_outindex (3) | Get index for output buffer
pnet_outlen (3) | Get length of output buffer
pnet_ouptut (3) | Get pointer to ouptut buffer
pnet_reverse (3) | Reverse direction of all connections
pnet_setup (3) | Initialize communication pattern
pnet_strerror (3) | Return string describing Pnet error