Skip to content

Commit

Permalink
Merge pull request ESCOMP#537 from rgknox/fates-parteh-api
Browse files Browse the repository at this point in the history
Fates parteh api
  • Loading branch information
rgknox authored Oct 24, 2018
2 parents 7ec0960 + a4d012f commit 8602da3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/main/clm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ module clm_varctl
logical, public :: use_fates = .false. ! true => use fates

! These are INTERNAL to the FATES module
integer, public :: fates_parteh_mode = -9 ! 1 => carbon only
! 2 => C+N+P (not enabled yet)
! no others enabled
logical, public :: use_fates_spitfire = .false. ! true => use spitfire model
logical, public :: use_fates_logging = .false. ! true => turn on logging module
logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro
Expand Down
5 changes: 4 additions & 1 deletion src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ subroutine control_init( )
use_fates_planthydro, use_fates_ed_st3, &
use_fates_ed_prescribed_phys, &
use_fates_inventory_init, &
fates_inventory_ctrl_filename
fates_inventory_ctrl_filename, &
fates_parteh_mode


! CLM 5.0 nitrogen flags
Expand Down Expand Up @@ -630,6 +631,7 @@ subroutine control_spmd()
call mpi_bcast (use_fates_inventory_init, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_paramfile, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_parteh_mode, 1, MPI_INTEGER, 0, mpicom, ier)

! flexibleCN nitrogen model
call mpi_bcast (use_flexibleCN, 1, MPI_LOGICAL, 0, mpicom, ier)
Expand Down Expand Up @@ -956,6 +958,7 @@ subroutine control_print ()
write(iulog, *) ' use_fates_spitfire = ', use_fates_spitfire
write(iulog, *) ' use_fates_logging = ', use_fates_logging
write(iulog, *) ' fates_paramfile = ', fates_paramfile
write(iulog, *) ' fates_parteh_mode = ', fates_parteh_mode
write(iulog, *) ' use_fates_planthydro = ', use_fates_planthydro
write(iulog, *) ' use_fates_ed_st3 = ',use_fates_ed_st3
write(iulog, *) ' use_fates_ed_prescribed_phys = ',use_fates_ed_prescribed_phys
Expand Down
19 changes: 16 additions & 3 deletions src/utils/clmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ module CLMFatesInterfaceMod

use SoilStateType , only : soilstate_type
use clm_varctl , only : iulog
use clm_varctl , only : use_vertsoilc
use clm_varctl , only : use_vertsoilc
use clm_varctl , only : fates_parteh_mode
use clm_varctl , only : use_fates_spitfire
use clm_varctl , only : use_fates_planthydro
use clm_varctl , only : use_fates_ed_st3
Expand Down Expand Up @@ -101,6 +102,7 @@ module CLMFatesInterfaceMod
use FatesInterfaceMod , only : allocate_bcout
use FatesInterfaceMod , only : SetFatesTime
use FatesInterfaceMod , only : set_fates_ctrlparms
use FatesInterfaceMod , only : InitPARTEHGlobals

use FatesHistoryInterfaceMod, only : fates_history_interface_type
use FatesRestartInterfaceMod, only : fates_restart_interface_type
Expand Down Expand Up @@ -236,7 +238,7 @@ subroutine init(this, bounds_proc )
logical :: verbose_output
integer :: pass_masterproc
integer :: pass_vertsoilc
integer :: pass_spitfire
integer :: pass_spitfire
integer :: pass_ed_st3
integer :: pass_ed_prescribed_phys
integer :: pass_logging
Expand Down Expand Up @@ -291,6 +293,8 @@ subroutine init(this, bounds_proc )
call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) ! RGK: FATES IGNORES
! AND DOESNT TOUCH
! THE BARE SOIL PATCH
call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode)


if(is_restart()) then
pass_is_restart = 1
Expand Down Expand Up @@ -459,7 +463,7 @@ subroutine init(this, bounds_proc )
this%fates(nc)%sites(s)%lon = grc%londeg(g)

end do


! Initialize site-level static quantities dictated by the HLM
! currently ground layering depth
Expand Down Expand Up @@ -491,8 +495,17 @@ subroutine init(this, bounds_proc )

end do
!$OMP END PARALLEL DO

! This will initialize all globals associated with the chosen
! Plant Allocation and Reactive Transport hypothesis. This includes
! mapping tables and global variables. These will be read-only
! and only required once per machine instance (thus no requirements
! to have it instanced on each thread

call InitPARTEHGlobals()



call this%init_history_io(bounds_proc)

! Report Fates Parameters (debug flag in lower level routines)
Expand Down

0 comments on commit 8602da3

Please sign in to comment.