Skip to content

Commit

Permalink
update minor fates landuse code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
glemieux committed Sep 5, 2023
1 parent 83931e9 commit c3b6d91
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
40 changes: 20 additions & 20 deletions components/elm/src/dyn_subgrid/dynFATESLandUseChangeMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,26 @@ subroutine dynFatesLandUseInit(bounds, landuse_filename)

if (use_fates_luh) then

! Generate the dyn_file_type object
! TO DO: check whether to initialize with start or end
dynFatesLandUse_file = dyn_file_type(landuse_filename, YEAR_POSITION_START_OF_TIMESTEP)
! dynFatesLandUse_file = dyn_file_type(landuse_filename, YEAR_POSITION_END_OF_TIMESTEP)

! Get initial land use data
num_points = (bounds%endg - bounds%begg + 1)
landuse_shape(1) = num_points ! Does this need an explicit array shape to be passed to the constructor?
do varnum = 1, num_landuse_transition_vars
landuse_transition_vars(varnum) = dyn_var_time_uninterp_type( &
dyn_file=dynFatesLandUse_file, varname=landuse_transition_varnames(varnum), &
dim1name=grlnd, conversion_factor=1.0_r8, &
do_check_sums_equal_1=.false., data_shape=landuse_shape)
end do
do varnum = 1, num_landuse_state_vars
landuse_state_vars(varnum) = dyn_var_time_uninterp_type( &
dyn_file=dynFatesLandUse_file, varname=landuse_state_varnames(varnum), &
dim1name=grlnd, conversion_factor=1.0_r8, &
do_check_sums_equal_1=.false., data_shape=landuse_shape)
end do
! Generate the dyn_file_type object
! TO DO: check whether to initialize with start or end
dynFatesLandUse_file = dyn_file_type(landuse_filename, YEAR_POSITION_START_OF_TIMESTEP)
! dynFatesLandUse_file = dyn_file_type(landuse_filename, YEAR_POSITION_END_OF_TIMESTEP)

! Get initial land use data
num_points = (bounds%endg - bounds%begg + 1)
landuse_shape(1) = num_points ! Does this need an explicit array shape to be passed to the constructor?
do varnum = 1, num_landuse_transition_vars
landuse_transition_vars(varnum) = dyn_var_time_uninterp_type( &
dyn_file=dynFatesLandUse_file, varname=landuse_transition_varnames(varnum), &
dim1name=grlnd, conversion_factor=1.0_r8, &
do_check_sums_equal_1=.false., data_shape=landuse_shape)
end do
do varnum = 1, num_landuse_state_vars
landuse_state_vars(varnum) = dyn_var_time_uninterp_type( &
dyn_file=dynFatesLandUse_file, varname=landuse_state_varnames(varnum), &
dim1name=grlnd, conversion_factor=1.0_r8, &
do_check_sums_equal_1=.false., data_shape=landuse_shape)
end do
end if

! Since fates needs state data during initialization, make sure to call
Expand Down
10 changes: 4 additions & 6 deletions components/elm/src/main/elmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1042,12 +1042,10 @@ subroutine dynamics_driv(this, bounds_clump, top_as_inst, &
this%fates(nc)%bc_in(s)%site_area=col_pp%wtgcell(c)*grc_pp%area(g)*m2_per_km2

if (use_fates_luh) then
! if (do_landuse_update) then
this%fates(nc)%bc_in(s)%hlm_luh_states = landuse_states(:,g)
this%fates(nc)%bc_in(s)%hlm_luh_state_names = landuse_state_varnames
this%fates(nc)%bc_in(s)%hlm_luh_transitions = landuse_transitions(:,g)
this%fates(nc)%bc_in(s)%hlm_luh_transition_names = landuse_transition_varnames
! end if
this%fates(nc)%bc_in(s)%hlm_luh_states = landuse_states(:,g)
this%fates(nc)%bc_in(s)%hlm_luh_state_names = landuse_state_varnames
this%fates(nc)%bc_in(s)%hlm_luh_transitions = landuse_transitions(:,g)
this%fates(nc)%bc_in(s)%hlm_luh_transition_names = landuse_transition_varnames
end if

end do
Expand Down

0 comments on commit c3b6d91

Please sign in to comment.