load_parameters Subroutine

public subroutine load_parameters(met, air, ssnow, veg, climate, bgc, soil, canopy, rough, rad, sum_flux, bal, logn, vegparmnew, casabiome, casapool, casaflux, sum_casapool, sum_casaflux, casamet, casabal, phen, POP, spinup, EMSOIL, TFRZ, LUC_EXPT, POPLUC)

Uses

  • proc~~load_parameters~~UsesGraph proc~load_parameters load_parameters module~cable_luc_expt CABLE_LUC_EXPT proc~load_parameters->module~cable_luc_expt module~popluc_module POPLUC_Module proc~load_parameters->module~popluc_module module~popmodule POPModule proc~load_parameters->module~popmodule module~cable_common_module cable_common_module module~cable_luc_expt->module~cable_common_module module~cable_def_types_mod cable_def_types_mod module~cable_luc_expt->module~cable_def_types_mod module~cable_io_vars_module cable_IO_vars_module module~cable_luc_expt->module~cable_io_vars_module module~casa_ncdf_module casa_ncdf_module module~cable_luc_expt->module~casa_ncdf_module netcdf netcdf module~cable_luc_expt->netcdf module~popluc_module->module~cable_luc_expt module~popluc_module->module~popmodule module~popluc_module->module~cable_common_module module~popluc_module->module~cable_io_vars_module module~casavariable casavariable module~popluc_module->module~casavariable module~pop_types POP_Types module~popluc_module->module~pop_types module~popluc_constants POPLUC_CONSTANTS module~popluc_module->module~popluc_constants module~popluc_types POPLUC_Types module~popluc_module->module~popluc_types module~typedef TypeDef module~popluc_module->module~typedef module~pop_constants POP_Constants module~popmodule->module~pop_constants module~popmodule->module~pop_types module~popmodule->module~typedef module~cable_runtime_opts_mod cable_runtime_opts_mod module~cable_common_module->module~cable_runtime_opts_mod module~cable_climate_type_mod cable_climate_type_mod module~cable_def_types_mod->module~cable_climate_type_mod module~cable_io_vars_module->module~cable_def_types_mod module~casadimension casadimension module~casavariable->module~casadimension module~pop_constants->module~typedef module~pop_types->module~pop_constants module~pop_types->module~typedef module~popluc_constants->module~typedef module~popluc_types->module~popluc_constants module~popluc_types->module~typedef module~casadimension->module~cable_def_types_mod

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).

Order of processes:

  1. 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.

  2. 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.

    • WARNING: I think this allocation should happen after ALL parameter and restart information has been loaded. As it stands, I think there is the potential for the restart file to contain variables of a different dimension to what is declared here.
  3. Assign the loaded parameter values to CABLE's parameter variables

  4. [IF CASA is being used] Assign the CASA parameters from CABLE parameters

    • WARNING: again this should happen after the restart file and met file information has been used to define CABLE parameters, otherwise they could be out of sync.
  5. [IF CASA is being used] Initialise CASA state variables

  6. Check that the total number of patches in the restart file matches the total number of patches from the default grid (abort if not).

    • WARNING: if a restart file exists, it should define the total number of patches, not the default grid.
  7. Load initialisations and parameter values from restart file, and overwrite default values with these.

  8. Overwrite parameter values with any found in the met forcing file. This could be just a subset of parameters.

  9. Ensure the consistency of ice points between soil and vegetation

  10. Construct derived parameters and zero initialisations for the groundwater routine, regardless of where parameters and other initialisations have loaded from

  11. Check for basic inconsistencies in parameter values

  12. Write per-site parameter values to log file if requested

Arguments

Type IntentOptional 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

Calls

proc~~load_parameters~~CallsGraph proc~load_parameters load_parameters nf90_inq_dimid nf90_inq_dimid proc~load_parameters->nf90_inq_dimid nf90_inquire_dimension nf90_inquire_dimension proc~load_parameters->nf90_inquire_dimension nf90_open nf90_open proc~load_parameters->nf90_open pop_io pop_io proc~load_parameters->pop_io proc~alloc_casavariable alloc_casavariable proc~load_parameters->proc~alloc_casavariable proc~alloc_phenvariable alloc_phenvariable proc~load_parameters->proc~alloc_phenvariable proc~alloc_sum_casavariable alloc_sum_casavariable proc~load_parameters->proc~alloc_sum_casavariable proc~allocate_cable_vars allocate_cable_vars proc~load_parameters->proc~allocate_cable_vars proc~casa_init casa_init proc~load_parameters->proc~casa_init proc~casa_readbiome casa_readbiome proc~load_parameters->proc~casa_readbiome proc~casa_readphen casa_readphen proc~load_parameters->proc~casa_readphen proc~check_parameter_values check_parameter_values proc~load_parameters->proc~check_parameter_values proc~consistency_ice_veg_soil consistency_ice_veg_soil proc~load_parameters->proc~consistency_ice_veg_soil proc~derived_parameters derived_parameters proc~load_parameters->proc~derived_parameters proc~get_default_params get_default_params proc~load_parameters->proc~get_default_params proc~get_parameters_met get_parameters_met proc~load_parameters->proc~get_parameters_met proc~get_restart_data get_restart_data proc~load_parameters->proc~get_restart_data proc~handle_err HANDLE_ERR proc~load_parameters->proc~handle_err proc~nc_abort nc_abort proc~load_parameters->proc~nc_abort proc~pop_init POP_init proc~load_parameters->proc~pop_init proc~popluc_init POPLUC_Init proc~load_parameters->proc~popluc_init proc~report_parameters report_parameters proc~load_parameters->proc~report_parameters proc~write_cnp_params write_cnp_params proc~load_parameters->proc~write_cnp_params proc~write_default_params write_default_params proc~load_parameters->proc~write_default_params interface~alloc_cbm_var alloc_cbm_var proc~allocate_cable_vars->interface~alloc_cbm_var 100 100 proc~casa_init->100 2 2 proc~casa_init->2 5 5 proc~casa_init->5 proc~read_casa_restart_nc READ_CASA_RESTART_NC proc~casa_init->proc~read_casa_restart_nc proc~cable_pft_params cable_pft_params proc~get_default_params->proc~cable_pft_params proc~cable_soil_params cable_soil_params proc~get_default_params->proc~cable_soil_params proc~countpatch countPatch proc~get_default_params->proc~countpatch proc~get_land_index get_land_index proc~get_default_params->proc~get_land_index proc~luc_expt_set_tiles LUC_EXPT_SET_TILES proc~get_default_params->proc~luc_expt_set_tiles proc~read_gridinfo read_gridinfo proc~get_default_params->proc~read_gridinfo proc~read_soilcolor read_soilcolor proc~get_default_params->proc~read_soilcolor proc~spatialsoil spatialSoil proc~get_default_params->proc~spatialsoil interface~readpar readpar proc~get_parameters_met->interface~readpar nf90_inq_varid nf90_inq_varid proc~get_parameters_met->nf90_inq_varid proc~get_restart_data->nf90_inq_dimid proc~get_restart_data->nf90_inquire_dimension proc~get_restart_data->proc~nc_abort proc~get_restart_data->interface~readpar nf90_close nf90_close proc~get_restart_data->nf90_close nf90_get_var nf90_get_var proc~get_restart_data->nf90_get_var proc~get_restart_data->nf90_inq_varid proc~extrarestart extraRestart proc~get_restart_data->proc~extrarestart nf90_strerror nf90_strerror proc~handle_err->nf90_strerror proc~nc_abort->nf90_strerror proc~alloc_pop alloc_POP proc~pop_init->proc~alloc_pop proc~initpop2d_poisson InitPOP2D_Poisson proc~pop_init->proc~initpop2d_poisson proc~layer_recruitment_single_patch layer_recruitment_single_patch proc~pop_init->proc~layer_recruitment_single_patch proc~zeropop ZeroPOP proc~pop_init->proc~zeropop proc~alloc_popluc alloc_POPLUC proc~popluc_init->proc~alloc_popluc proc~pop_init_single POP_init_single proc~popluc_init->proc~pop_init_single proc~popluc_set_params POPLUC_set_params proc~popluc_init->proc~popluc_set_params proc~read_luc_restart_nc READ_LUC_RESTART_NC proc~popluc_init->proc~read_luc_restart_nc proc~zeropopluc ZeroPOPLUC proc~popluc_init->proc~zeropopluc proc~report_parameters->proc~cable_pft_params proc~report_parameters->proc~cable_soil_params proc~init_veg_from_vegin init_veg_from_vegin proc~write_default_params->proc~init_veg_from_vegin proc~alloc_air_type alloc_air_type interface~alloc_cbm_var->proc~alloc_air_type proc~alloc_balances_type alloc_balances_type interface~alloc_cbm_var->proc~alloc_balances_type proc~alloc_bgc_pool_type alloc_bgc_pool_type interface~alloc_cbm_var->proc~alloc_bgc_pool_type proc~alloc_canopy_type alloc_canopy_type interface~alloc_cbm_var->proc~alloc_canopy_type proc~alloc_climate_type alloc_climate_type interface~alloc_cbm_var->proc~alloc_climate_type proc~alloc_met_type alloc_met_type interface~alloc_cbm_var->proc~alloc_met_type proc~alloc_radiation_type alloc_radiation_type interface~alloc_cbm_var->proc~alloc_radiation_type proc~alloc_roughness_type alloc_roughness_type interface~alloc_cbm_var->proc~alloc_roughness_type proc~alloc_soil_parameter_type alloc_soil_parameter_type interface~alloc_cbm_var->proc~alloc_soil_parameter_type proc~alloc_soil_snow_type alloc_soil_snow_type interface~alloc_cbm_var->proc~alloc_soil_snow_type proc~alloc_sum_flux_type alloc_sum_flux_type interface~alloc_cbm_var->proc~alloc_sum_flux_type proc~alloc_veg_parameter_type alloc_veg_parameter_type interface~alloc_cbm_var->proc~alloc_veg_parameter_type proc~readpar_i readpar_i interface~readpar->proc~readpar_i proc~readpar_r readpar_r interface~readpar->proc~readpar_r proc~readpar_r2 readpar_r2 interface~readpar->proc~readpar_r2 proc~readpar_r2d readpar_r2d interface~readpar->proc~readpar_r2d proc~readpar_rd readpar_rd interface~readpar->proc~readpar_rd proc~extrarestart->proc~nc_abort proc~extrarestart->interface~readpar proc~extrarestart->nf90_get_var proc~extrarestart->nf90_inq_varid proc~redistr_i redistr_i proc~extrarestart->proc~redistr_i proc~redistr_r redistr_r proc~extrarestart->proc~redistr_r proc~redistr_r2 redistr_r2 proc~extrarestart->proc~redistr_r2 proc~redistr_r2d redistr_r2d proc~extrarestart->proc~redistr_r2d proc~redistr_rd redistr_rd proc~extrarestart->proc~redistr_rd proc~cumexponential CumExponential proc~initpop2d_poisson->proc~cumexponential proc~exponential Exponential proc~initpop2d_poisson->proc~exponential proc~get_allometry GET_ALLOMETRY proc~layer_recruitment_single_patch->proc~get_allometry 1166 1166 proc~luc_expt_set_tiles->1166 proc~pop_init_single->proc~initpop2d_poisson proc~pop_init_single->proc~layer_recruitment_single_patch proc~pop_init_single->proc~zeropop proc~read_casa_restart_nc->nf90_inq_dimid proc~read_casa_restart_nc->nf90_inquire_dimension proc~read_casa_restart_nc->nf90_open proc~read_casa_restart_nc->proc~handle_err proc~read_casa_restart_nc->nf90_close proc~read_casa_restart_nc->nf90_get_var proc~read_casa_restart_nc->nf90_inq_varid nf90_get_att nf90_get_att proc~read_casa_restart_nc->nf90_get_att proc~read_gridinfo->nf90_inq_dimid proc~read_gridinfo->nf90_inquire_dimension proc~read_gridinfo->nf90_open proc~read_gridinfo->proc~nc_abort proc~read_gridinfo->nf90_close proc~read_gridinfo->nf90_get_var proc~read_gridinfo->nf90_inq_varid proc~read_luc_restart_nc->nf90_inq_dimid proc~read_luc_restart_nc->nf90_inquire_dimension proc~read_luc_restart_nc->nf90_open proc~read_luc_restart_nc->proc~handle_err proc~read_luc_restart_nc->nf90_close proc~read_luc_restart_nc->nf90_get_var proc~read_luc_restart_nc->nf90_inq_varid 1000 1000 proc~read_luc_restart_nc->1000 proc~read_soilcolor->nf90_inq_dimid proc~read_soilcolor->nf90_inquire_dimension proc~read_soilcolor->nf90_open proc~read_soilcolor->proc~nc_abort proc~read_soilcolor->nf90_close proc~read_soilcolor->nf90_get_var proc~read_soilcolor->nf90_inq_varid proc~spatialsoil->nf90_open proc~spatialsoil->proc~nc_abort proc~spatialsoil->nf90_close proc~spatialsoil->nf90_get_var proc~spatialsoil->nf90_inq_varid proc~allometry Allometry proc~get_allometry->proc~allometry proc~getheight GetHeight proc~get_allometry->proc~getheight proc~williams_allometry Williams_Allometry proc~get_allometry->proc~williams_allometry proc~readpar_i->proc~nc_abort proc~readpar_i->nf90_get_var proc~readpar_i->nf90_inq_varid nf90_inquire_variable nf90_inquire_variable proc~readpar_i->nf90_inquire_variable proc~readpar_r->proc~nc_abort proc~readpar_r->nf90_get_var proc~readpar_r->nf90_inq_varid proc~readpar_r->nf90_inquire_variable proc~readpar_r2->proc~nc_abort proc~readpar_r2->nf90_get_var proc~readpar_r2->nf90_inq_varid proc~readpar_r2->nf90_inquire_variable proc~readpar_r2d->proc~nc_abort proc~readpar_r2d->nf90_get_var proc~readpar_r2d->nf90_inq_varid proc~readpar_r2d->nf90_inquire_variable proc~readpar_rd->proc~nc_abort proc~readpar_rd->nf90_get_var proc~readpar_rd->nf90_inq_varid proc~readpar_rd->nf90_inquire_variable float float proc~redistr_r->float proc~redistr_r2->float proc~redistr_r2d->float proc~redistr_rd->float

Called by

proc~~load_parameters~~CalledByGraph proc~load_parameters load_parameters proc~mpidrv_master mpidrv_master proc~mpidrv_master->proc~load_parameters proc~serialdrv serialdrv proc~serialdrv->proc~load_parameters program~cable_offline_driver cable_offline_driver program~cable_offline_driver->proc~mpidrv_master program~cable_offline_driver->proc~serialdrv