Defines the priority order of sources of parameter values for CABLE, determines the total number of patches over all grid cells, and writes parameter values to CABLE's parameter arrays.
WARNING: this needs reordering and tweaking to (a) remove the possibility of inconsistencies between the number of patches in the default parameter grid and a restart file, and (b) allow vegetation and soil type to be forced from the met file (this is more complicated than simply uncommenting the iveg and isoil reads from the met file - it requires the actual parameter values to be written after that read).
Load parameter values for each grid cell from default vegetation and soil types based on latitude and longitude. This includes determining the number of patches in each grid cell, and so the total number of patches.
Allocate CABLE (and CASA's [+phenology], if used) variables now that the dimension of arrays is known - i.e. now that we know how many grid cells and patches there are.
Assign the loaded parameter values to CABLE's parameter variables
[IF CASA is being used] Assign the CASA parameters from CABLE parameters
[IF CASA is being used] Initialise CASA state variables
Check that the total number of patches in the restart file matches the total number of patches from the default grid (abort if not).
Load initialisations and parameter values from restart file, and overwrite default values with these.
Overwrite parameter values with any found in the met forcing file. This could be just a subset of parameters.
Ensure the consistency of ice points between soil and vegetation
Construct derived parameters and zero initialisations for the groundwater routine, regardless of where parameters and other initialisations have loaded from
Check for basic inconsistencies in parameter values
Write per-site parameter values to log file if requested
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(met_type), | intent(inout) | :: | met | |||
type(air_type), | intent(inout) | :: | air | |||
type(soil_snow_type), | intent(out) | :: | ssnow | |||
type(veg_parameter_type), | intent(out) | :: | veg | |||
type(climate_type), | intent(inout) | :: | climate | |||
type(bgc_pool_type), | intent(out) | :: | bgc | |||
type(soil_parameter_type), | intent(out) | :: | soil | |||
type(canopy_type), | intent(out) | :: | canopy | |||
type(roughness_type), | intent(out) | :: | rough | |||
type(radiation_type), | intent(out) | :: | rad | |||
type(sum_flux_type), | intent(out) | :: | sum_flux | |||
type(balances_type), | intent(out) | :: | bal | |||
integer, | intent(in) | :: | logn | |||
logical, | intent(in) | :: | vegparmnew | |||
type(casa_biome), | intent(out) | :: | casabiome | |||
type(casa_pool), | intent(out) | :: | casapool | |||
type(casa_flux), | intent(out) | :: | casaflux | |||
type(casa_pool), | intent(out) | :: | sum_casapool | |||
type(casa_flux), | intent(out) | :: | sum_casaflux | |||
type(casa_met), | intent(out) | :: | casamet | |||
type(casa_balance), | intent(out) | :: | casabal | |||
type(phen_variable), | intent(out) | :: | phen | |||
type(POP_TYPE), | intent(inout) | :: | POP | |||
logical, | intent(in) | :: | spinup | |||
real, | intent(in) | :: | EMSOIL | |||
real, | intent(in) | :: | TFRZ | |||
type(LUC_EXPT_TYPE), | intent(inout) | :: | LUC_EXPT | |||
type(POPLUC_TYPE), | intent(inout) | :: | POPLUC |