TreeMig Code
Loading...
Searching...
No Matches
ReadState.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine readstate (stateyear, latstart, latend, lonstart, lonend, nspc)
 ReadState.
 

Function/Subroutine Documentation

◆ readstate()

subroutine readstate ( integer, intent(out) stateyear,
integer, intent(in) latstart,
integer, intent(in) latend,
integer, intent(in) lonstart,
integer, intent(in) lonend,
integer, intent(in) nspc )

ReadState.


  1. Initializes all state variables to zero
  2. Opens state file
  3. Reads in line by line in a buffer
    1. parses this buffer first into species name, lat, lon, year
    2. checks whether lat and lon are within the simulation domain
    3. checks whether the species name is one of the species to be simulated
    4. if checks ok, parses the entire line, taking into account the number of height classes of this species
    5. stores the read in values in the right location-species-height_class in cell
  • USE: FileListModule, FileHandlingModule, LoggerModuleAll_par
  • IN:
    • Parameters
      latStart,latEnd,lonStart,lonEnd: dimensions of simulation domain in relative coordinates, i.e. cell indices
      nspc: number of species
    • from ALL_par:
      • maxhc :INTEGER: max. number of height classes (0-maxhc)
      • maxlat, maxlon : INTEGER: number of rows/cols of simulation domain
      • spec(maxspc) :TYPE(SpecProperties) :: species properties; here a.o. all species parameters are put to spec
  • OUT:
    • Parameters
      stateyear:INTEGER : year of state output
    • via All_par:
      • stateGrid :TYPE(CurrStateInCell), dimension(:, :), allocatable : current state in each cell (the entire grid)
  • CALLS support routines:
    • LogError, LogInfo, LogWarning in LoggerModule
  • CALLED FROM:

Definition at line 31 of file ReadState.f90.