Skip to content

Commit

Permalink
Update some fates scalar parameter representations.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bandre-ucar committed Feb 8, 2017
1 parent 189acf9 commit 829fa24
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
7 changes: 3 additions & 4 deletions components/clm/src/ED/biogeochem/EDSharedParamsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
56 changes: 28 additions & 28 deletions components/clm/src/ED/main/EDParamsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion components/clm/src/ED/main/FatesParametersInterface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 829fa24

Please sign in to comment.