From 829fa2430a137899b2ae731eae5fc886c5ab2b3f Mon Sep 17 00:00:00 2001 From: Ben Andre Date: Wed, 8 Feb 2017 14:54:28 -0700 Subject: [PATCH] Update some fates scalar parameter representations. The fates input file has two ways of indicating scalars, true scalars and 1-D arays with length 1. Inorder to check dimensions and compare code expectations vs what is on the file, we need to more clearly distinguish between these two ways or represeting scalars. Test suite: SMS_D_Ld5.f10_f10.ICLM45ED.yellowstone_intel.clm-edTest Test baseline: a651a4f Test namelist changes: addition of fates_paramfile Test answer changes: bit for bit Test summary: pass --- .../src/ED/biogeochem/EDSharedParamsMod.F90 | 7 +-- components/clm/src/ED/main/EDParamsMod.F90 | 56 +++++++++---------- .../src/ED/main/FatesParametersInterface.F90 | 3 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/components/clm/src/ED/biogeochem/EDSharedParamsMod.F90 b/components/clm/src/ED/biogeochem/EDSharedParamsMod.F90 index a6aaa26d9b..c3610b0553 100644 --- a/components/clm/src/ED/biogeochem/EDSharedParamsMod.F90 +++ b/components/clm/src/ED/biogeochem/EDSharedParamsMod.F90 @@ -52,7 +52,6 @@ subroutine RegisterParams(this, fates_params) ! that need to be synced with host values. use FatesParametersInterface, only : fates_parameters_type, param_string_length - use FatesParametersInterface, only : dimension_name_scalar, dimension_shape_scalar implicit none @@ -85,7 +84,7 @@ subroutine RegisterParamsScalar(this, fates_params) ! that need to be synced with host values. use FatesParametersInterface, only : fates_parameters_type, param_string_length - use FatesParametersInterface, only : dimension_name_allpfts, dimension_shape_scalar + use FatesParametersInterface, only : dimension_name_allpfts, dimension_shape_1d implicit none @@ -98,11 +97,11 @@ subroutine RegisterParamsScalar(this, fates_params) call this%Init() name = 'q10_mr' - call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_scalar, & + call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, & dimension_names=dim_names, sync_with_host=.true.) name = 'froz_q10' - call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_scalar, & + call fates_params%RegisterParameter(name=name, dimension_shape=dimension_shape_1d, & dimension_names=dim_names, sync_with_host=.true.) end subroutine RegisterParamsScalar diff --git a/components/clm/src/ED/main/EDParamsMod.F90 b/components/clm/src/ED/main/EDParamsMod.F90 index 344cf91606..dc67ebd869 100644 --- a/components/clm/src/ED/main/EDParamsMod.F90 +++ b/components/clm/src/ED/main/EDParamsMod.F90 @@ -74,54 +74,54 @@ subroutine FatesRegisterParams(fates_params) ! indicate whether they are fates parameters or host parameters ! that need to be synced with host values. - use FatesParametersInterface, only : fates_parameters_type, dimension_name_scalar, dimension_shape_scalar + use FatesParametersInterface, only : fates_parameters_type, dimension_name_scalar1d, dimension_shape_1d implicit none class(fates_parameters_type), intent(inout) :: fates_params - character(len=param_string_length), parameter :: dim_names_scalar(1) = (/dimension_name_scalar/) + character(len=param_string_length), parameter :: dim_names(1) = (/dimension_name_scalar1d/) call FatesParamsInit() - call fates_params%RegisterParameter(name=ED_name_grass_spread, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_grass_spread, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_comp_excln, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_comp_excln, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_grass_spread, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_grass_spread, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_comp_excln, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_comp_excln, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_stress_mort, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_stress_mort, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_dispersal, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_dispersal, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_maxspread, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_maxspread, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_minspread, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_minspread, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_init_litter, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_init_litter, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_nfires, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_nfires, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_understorey_death, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_understorey_death, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_profile_tol, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_profile_tol, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) - call fates_params%RegisterParameter(name=ED_name_ag_biomass, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=ED_name_ag_biomass, dimension_shape=dimension_shape_1d, & + dimension_names=dim_names) end subroutine FatesRegisterParams diff --git a/components/clm/src/ED/main/FatesParametersInterface.F90 b/components/clm/src/ED/main/FatesParametersInterface.F90 index 60bae8eb57..cfebf64f7f 100644 --- a/components/clm/src/ED/main/FatesParametersInterface.F90 +++ b/components/clm/src/ED/main/FatesParametersInterface.F90 @@ -22,7 +22,8 @@ module FatesParametersInterface ! parameters. Can't be done easily until this framework is being ! used to read variables. ! FIXME(bja, 2017-01) change 'param' to 'scalar'! - character(len=*), parameter, public :: dimension_name_scalar = 'param' + character(len=*), parameter, public :: dimension_name_scalar = '' + character(len=*), parameter, public :: dimension_name_scalar1d = 'param' character(len=*), parameter, public :: dimension_name_pft = 'pft' character(len=*), parameter, public :: dimension_name_segment = 'segment' character(len=*), parameter, public :: dimension_name_cwd = 'NCWD'