Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.4)

list(APPEND CMAKE_MODULE_PATH ${CIME_CMAKE_MODULE_DIRECTORY})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../share/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../components/cmeps/cmake")

FIND_PATH(NETCDFC_FOUND libnetcdf.a ${NETCDF_C_DIR}/lib)
FIND_PATH(NETCDFF_FOUND libnetcdff.a ${NETCDF_FORTRAN_DIR}/lib)
Expand All @@ -19,6 +20,23 @@ include(CIME_utils)

set(HLM_ROOT "../../")

if (DEFINED ENV{ESMF_ROOT})
list(APPEND CMAKE_MODULE_PATH $ENV{ESMF_ROOT}/cmake)
endif()
find_package(ESMF REQUIRED)

# This adds include directories needed for ESMF
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ESMF_F90COMPILEPATHS} ")
# This (which is *not* done in the share CMakeLists.txt) adds all directories and
# libraries needed when linking ESMF, including any dependencies of ESMF. (But note that
# this does *not* include the "-lesmf" itself). In particular, note that this includes any
# link flags needed to link against PIO, which is needed on some systems (including
# derecho); bringing in these PIO-related link flags via this ESMF mechanism allows us to
# avoid explicitly including PIO as a link library, which wouldn't work on systems where
# there is no separate PIO library and instead ESMF is built with its internal PIO
# library.
link_libraries(${ESMF_INTERFACE_LINK_LIBRARIES})

# Add source directories from other share code (csm_share, etc.)
add_subdirectory(${HLM_ROOT}/share/src csm_share)
add_subdirectory(${HLM_ROOT}/share/unit_test_stubs/util csm_share_stubs)
Expand Down Expand Up @@ -90,6 +108,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})

# Directories and libraries to include in the link step
link_directories(${CMAKE_CURRENT_BINARY_DIR})
link_libraries(esmf)

# Add the main test directory
add_subdirectory(${HLM_ROOT}/src/fates/testing)
1 change: 1 addition & 0 deletions biogeophys/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
list(APPEND fates_sources
FatesHydroWTFMod.F90
LeafBiophysicsMod.F90
FatesPlantHydraulicsMod.F90)

sourcelist_to_parent(fates_sources)
3 changes: 0 additions & 3 deletions testing/cime_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ Next set up some other environment variables:

```bash
export ESMF_INSTALL_PREFIX=$ESMF_DIR/install_dir
export ESMF_NETCDF=split
export ESMF_NETCDF_INCLUDE=/usr/local/include
export ESMF_NETCDF_LIBPATH=/usr/local/lib
export ESMF_COMM=openmpi
export ESMF_COMPILER=gfortranclang
```
Expand Down
5 changes: 3 additions & 2 deletions testing/functional_testing/math_utils/FatesTestMathUtils.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
program FatesTestQuadSolvers

use FatesConstantsMod, only : r8 => fates_r8
use FatesUtilsMod, only : QuadraticRootsNSWC, QuadraticRootsSridharachary
use FatesUtilsMod, only : QuadraticRootsNSWC
use FatesUtilsMod, only : GetNeighborDistance

implicit none
Expand All @@ -15,6 +15,7 @@ program FatesTestQuadSolvers
real(r8) :: a(n), b(n), c(n) ! coefficients for quadratic solvers
real(r8) :: root1(n) ! real part of first root of quadratic solver
real(r8) :: root2(n) ! real part of second root of quadratic solver
logical :: err ! error

interface

Expand Down Expand Up @@ -42,7 +43,7 @@ end subroutine WriteQuadData
c = (/1.0_r8, 12.0_r8, 3.0_r8, 1.1_r8/)

do i = 1, n
call QuadraticRootsNSWC(a(i), b(i), c(i), root1(i), root2(i))
call QuadraticRootsNSWC(a(i), b(i), c(i), root1(i), root2(i), err)
end do

call WriteQuadData(out_file, n, a, b, c, root1, root2)
Expand Down
8 changes: 5 additions & 3 deletions testing/testing_shr/FatesFactoryMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module FatesFactoryMod
use FatesConstantsMod, only : isemi_stress_decid
use FatesConstantsMod, only : primaryland
use FatesConstantsMod, only : sec_per_day, days_per_year
use FatesConstantsMod, only : default_regeneration
use FatesGlobals, only : fates_log
use FatesGlobals, only : endrun => fates_endrun
use FatesCohortMod, only : fates_cohort_type
Expand Down Expand Up @@ -53,10 +54,9 @@ module FatesFactoryMod
use FatesAllometryMod, only : bdead_allom
use FatesAllometryMod, only : bstore_allom
use FatesAllometryMod, only : carea_allom
use FatesInterfaceTypesMod, only : hlm_parteh_mode
use FatesInterfaceTypesMod, only : hlm_parteh_mode, hlm_regeneration_model
use FatesInterfaceTypesMod, only : nleafage
use FatesSizeAgeTypeIndicesMod, only : get_age_class_index
use EDParamsMod, only : regeneration_model
use SyntheticPatchTypes, only : synthetic_patch_type
use shr_log_mod, only : errMsg => shr_log_errMsg

Expand Down Expand Up @@ -89,6 +89,8 @@ subroutine InitializeGlobals(step_size)
element_pos(carbon12_element) = 1
call InitPRTGlobalAllometricCarbon()

hlm_regeneration_model = default_regeneration

allocate(ema_24hr)
call ema_24hr%define(sec_per_day, step_size, moving_ema_window)
allocate(fixed_24hr)
Expand Down Expand Up @@ -445,7 +447,7 @@ subroutine PatchFactory(patch, age, area, num_swb, num_pft, num_levsoil,

allocate(patch)
call patch%Create(age, area, land_use_label_local, nocomp_pft_local, num_swb, &
num_pft, num_levsoil, tod_local, regeneration_model)
num_pft, num_levsoil, tod_local, default_regeneration)

patch%patchno = 1
patch%younger => null()
Expand Down