Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Growth respiration #24

Merged
merged 353 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
353 commits
Select commit Hold shift + click to select a range
f90412b
refactor pft area normalization to avoid checking sumarea in pft loop
glemieux Apr 11, 2024
e77dda4
convert loop to single line call
glemieux Apr 11, 2024
b835a84
simplify indexing across all pfts for given landuse type now that we
glemieux Apr 11, 2024
1508b7b
more minor typo fixes
glemieux Apr 11, 2024
81f04e3
initial commit
Apr 13, 2024
762681d
trying to get test to work
Apr 15, 2024
a522342
allow read in of parameters
Apr 16, 2024
dfb4260
start adding allometry calculations
Apr 16, 2024
fc3e66c
get plotting to work
Apr 16, 2024
4ecaeed
add parameter file as argument to program
Apr 16, 2024
0a52c52
plot all allometries
Apr 17, 2024
c6e95bc
add function docstring
Apr 17, 2024
101974e
add more comments and instructions
Apr 17, 2024
e800023
absolute path for parameter file
Apr 17, 2024
c4bc8e6
remove if allocated statement
Apr 17, 2024
98cb1a4
automatically find netcdf paths
Apr 17, 2024
e5571ed
get working on derecho, save figures
adrifoster Apr 17, 2024
73cd037
Convert an array index from real to int, satisfing nag compiler.
samsrabin Apr 18, 2024
c03a4ba
Change crop_lu_pft_vector from real to int.
samsrabin Apr 18, 2024
c1a7453
Merge pull request #21 from samsrabin/luh2_nocomp_merge-ssr
ckoven Apr 18, 2024
a3dd198
add quadratic test; refactor to allow picking which test to run
Apr 19, 2024
5163a3f
some pylint changes
Apr 19, 2024
f2a805b
some pythonic updates
Apr 22, 2024
79b7369
check for executable instead of unit test
Apr 22, 2024
ac21898
more clear dictionary key
Apr 22, 2024
af5cb13
upading dict lambdas
Apr 22, 2024
0e98671
fix need to call 2 separate registervar subroutines
Apr 23, 2024
b25df0e
clean up
Apr 23, 2024
c611b0d
syntax style updates
rgknox Apr 23, 2024
b105d56
PascalCase
ckoven Apr 23, 2024
34dcc5f
shortening line lengths
ckoven Apr 24, 2024
fd80f6a
trying to fix ldflags
Apr 30, 2024
fb610ac
push cmakelists
Apr 30, 2024
5a5dea1
vasrious changes in response to review comments
ckoven Apr 30, 2024
530c99d
Update biogeochem/FatesLandUseChangeMod.F90
ckoven Apr 30, 2024
d74a625
Merge pull request #20 from glemieux/landuse_v2-edinit-refac_norm
ckoven Apr 30, 2024
d5b0640
Update main/FatesInterfaceMod.F90
ckoven May 1, 2024
5f79a10
Update fire/SFMainMod.F90
adrifoster May 1, 2024
0538d93
Update fire/SFNesterovMod.F90
adrifoster May 1, 2024
a99035f
comment updates
May 1, 2024
f30bdc9
merge in main
May 1, 2024
d864fac
remove dewpoint constants
May 1, 2024
b49d1ab
fix need to clean builds
adrifoster May 1, 2024
9ddf52a
merge in change from fire_refactor branch
May 1, 2024
5d5d205
migrating unit testing to folder unit_testing
rgknox May 1, 2024
e377e62
Merge pull request #2 from rgknox/allometry_unit_test-rearranged
adrifoster May 2, 2024
c348a7d
aded error check if trying to go back into potential veg mode
ckoven May 2, 2024
a35f3ea
Merge branch 'luh2_nocomp_merge_merge' into luh2_nocomp_merge
ckoven May 2, 2024
9775af6
remove old cmakelists
May 2, 2024
c76e7f4
Merge branch 'main' into allometry_unit_test
May 3, 2024
1a5c198
fix merge conflict
May 3, 2024
8f870d5
Merge branch 'fire_refactor' into fire_weather_wind
May 3, 2024
f61c792
Finally named that constant defining fraction of energy going to phot…
rgknox May 6, 2024
35cd297
cleaned up description a tad
rgknox May 6, 2024
4a34bd5
remove defunct use calls to fire_fdi_a and b
glemieux May 6, 2024
d076c07
Update main/EDTypesMod.F90
adrifoster May 6, 2024
ebdb992
updated directory structure
May 6, 2024
b2e4194
add grass specific agw,sap,leaf allometry
XiulinGao May 7, 2024
dce7256
update default allometry params for grass PFTs
XiulinGao May 7, 2024
3b4e563
Merge pull request #1171 from adrifoster/fire_refactor
glemieux May 7, 2024
b05fe49
merge in main
May 7, 2024
5ee5750
move pfunit test to new testing dir
May 7, 2024
797798d
small pylint fix
May 7, 2024
94d0d3b
Merge branch 'main' into fire_weather_wind
May 7, 2024
5ee375b
fixing some typos
May 7, 2024
0b415cf
minor typo and renaming corrections
glemieux May 7, 2024
153b0bd
add landuse mode checks for setting site_secondarylands...
glemieux May 7, 2024
25d3d52
edit generic allom subrountine for grass PFT
XiulinGao May 7, 2024
838de56
update default allom mode for grass PFT in param file
XiulinGao May 7, 2024
063eb10
Merge branch 'luh2_nocomp_merge' into edpatchdyn-refactor-condense-co…
glemieux May 8, 2024
e36df66
fix missing end subroutine
glemieux May 8, 2024
e622877
Added watt to mole conversion and fixed the photon to electron conver…
rgknox May 8, 2024
19e0b16
remove target and fix missing indexing definition
glemieux May 8, 2024
69558bc
fix patch name typo
glemieux May 8, 2024
affe544
bug fix
XiulinGao May 8, 2024
c090218
fix incorrect argument order for new subroutine
glemieux May 8, 2024
ff16157
Merge pull request #18 from glemieux/edpatchdyn-refactor-condense-common
glemieux May 8, 2024
7fe31f9
Merge pull request #19 from glemieux/landusev2-sitefunc
glemieux May 8, 2024
3594045
fix procedure declaration
glemieux May 8, 2024
805d302
Added note on quadratic solves for conductance
rgknox May 9, 2024
dc3198b
Updated text about quadratic solvers
rgknox May 9, 2024
d01e236
crown area allometry bug fix
XiulinGao May 9, 2024
589c972
updated comment on intercellular e_i
rgknox May 9, 2024
8a7c384
cap leaf and crown area allometry
XiulinGao May 10, 2024
2951856
update dbh_maxheight for c3 and c4 grass
XiulinGao May 10, 2024
e1fb819
removing dependency on small nclmax
rgknox May 10, 2024
5fb8e97
final pass at the first version of dynamic patch arrays
rgknox May 10, 2024
aa370ba
Added ncl_p protections
rgknox May 10, 2024
d9f25a0
Reverted some changes where we update ncl_p, but it doesn't need to b…
rgknox May 10, 2024
6dc21d1
Revert some removed b4b code, will re-remove later under its own chan…
rgknox May 10, 2024
f7dd539
tunned some PFT params for grasses to make the default params produci…
XiulinGao May 10, 2024
6b4f3f9
Update tools/make_unstruct_grid/MakeUnstructGrid.py
rgknox May 10, 2024
1c10077
Merge pull request #1186 from adrifoster/allometry_unit_test
glemieux May 10, 2024
9b28a27
Merge pull request #1191 from mpaiao/mpaiao-pr-invinit
glemieux May 10, 2024
7e4091a
Merge pull request #1176 from rgknox/CreateUnstructuredGrid
glemieux May 10, 2024
6080ab6
fixing error in harvest rate calculations
ckoven May 10, 2024
94fddfd
conflict resolutions between v2 lu and api 35
rgknox May 13, 2024
f0185f7
Merge pull request #1195 from rgknox/named_ps2
glemieux May 13, 2024
827ab3f
minor build fixes
glemieux May 14, 2024
48c7894
conflict resolution in v2
rgknox May 15, 2024
556edd4
nclmax nlevleaf: reverting for b4b testing
rgknox May 16, 2024
f7318a0
bug fixes from luhv2 merge
rgknox May 17, 2024
d00ece6
added parameter file patch for api 36
rgknox May 17, 2024
7084c0d
updated parameter api update xml
rgknox May 20, 2024
37f0245
fixed logic on when to initialize patches when not in nocomp-fixedbio
rgknox May 20, 2024
a997af5
updated parameter check to ignore SP
rgknox May 22, 2024
8712862
conflict resolution
rgknox May 22, 2024
b4ab283
added memory cleanup to new patch allocated arrays
rgknox May 22, 2024
40e67cf
Moved patch dynamic reallocations, zeroing and nanning into FatesPatc…
rgknox May 23, 2024
e4576eb
Merge branch 'main' into remove_nclmax
rgknox May 23, 2024
256dd62
Updated nclmax and nlevleaf
rgknox May 23, 2024
1889a9f
Updates and fixes to zeroing and flushing
rgknox May 23, 2024
7d0876d
updated the group_nflx_ specifications for the variables
rgknox May 23, 2024
c82918f
Removed unnecessary dynamics flushing
rgknox May 28, 2024
b9a8f43
Added flush_all_hvars to be used by interface calls in cold-start and…
rgknox May 28, 2024
3d799f9
bug fix for history refactors
rgknox May 28, 2024
9d8f404
updates to c13 disc
rgknox May 29, 2024
7a3c437
update to cached gpp in c13 disc
rgknox May 29, 2024
d38bc59
remove merge conflict artifacts
glemieux May 29, 2024
9d8628e
shortened some restart var names
rgknox May 30, 2024
9c2444f
change nocomp_pft_area_vector check to first diff then sum for better…
glemieux Jun 4, 2024
737e81d
change check for buffer split to use fraction to keep
glemieux Jun 6, 2024
4b018ea
add check to avoid bareground patches
glemieux Jun 6, 2024
e407b81
Updated some text
rgknox Jun 10, 2024
8d028eb
removed redundant zero flush in history
rgknox Jun 10, 2024
d62cf3e
incremental progress towards more flux diagnostics
rgknox Jun 11, 2024
e2afc63
Started up the integrated flux balance tracking
rgknox Jun 11, 2024
b8e4eee
Merge pull request #1208 from rgknox/history-zerofixes
glemieux Jun 11, 2024
0d58b89
Updates to integrated flux diagnostics
rgknox Jun 11, 2024
50e675d
More work towards tracking integrated mass checks
rgknox Jun 11, 2024
7dd60f4
more updates to checks and balances
rgknox Jun 12, 2024
2bdc442
updates to checks and balances
rgknox Jun 12, 2024
441d18b
Merge branch 'main' into fire_weather_wind
Jun 12, 2024
d55ed92
updates to checks
rgknox Jun 13, 2024
b741717
updates to integration tests
rgknox Jun 13, 2024
76c5929
integrated mass checks, merge
rgknox Jun 13, 2024
812c7cc
simplify carea allometry wrap function to avoid redundant code
XiulinGao Jun 13, 2024
9857e2f
simplify calculation of biomass derivatives using biomass
XiulinGao Jun 14, 2024
362d6b2
integrated flux balance changes
rgknox Jun 14, 2024
020732a
Merge branch 'main' into history-flux-diags
rgknox Jun 14, 2024
df281a0
flux diagnostics
rgknox Jun 17, 2024
3eccbd1
updating integrated fluxes
rgknox Jun 17, 2024
170a0e9
moved integrated flux calculation to before history write call
rgknox Jun 17, 2024
f9e2b11
Merge branch 'main' into fire_weather_wind
adrifoster Jun 17, 2024
319c1fb
fix units on seed production in history
JessicaNeedham Jun 17, 2024
3c05ecf
Merge tag 'sci.1.76.4_api.35.1.0' into luh2_nocomp_merge
Jun 17, 2024
8bff2ef
remove old file
Jun 18, 2024
6297e8b
Merge branch 'fire_weather_wind' of https://github.com/adrifoster/fat…
Jun 18, 2024
bbe2607
integrated flux work
rgknox Jun 18, 2024
d353e34
Merge branch 'jfn-seed-prod-units' into history-flux-diags
rgknox Jun 18, 2024
889a6a6
initialize wind speed to 0.0
adrifoster Jun 19, 2024
1113228
bug fix to litter flux tracking
rgknox Jun 19, 2024
b52cc11
test_results
adrifoster Jun 19, 2024
b43cb3a
update split_patches to take optional area input
glemieux Jun 24, 2024
29621bc
fix split patch optional argument name error
glemieux Jun 24, 2024
9b724ea
correct bad merge
glemieux Jun 24, 2024
3c02ded
refactor checks to determine what is sent to buffer patch
glemieux Jun 24, 2024
7add4a1
make sure to skip the buffer patch split loop if the buffer patch is …
glemieux Jun 24, 2024
fe795df
refactor newp_area calculation to avoid potential precision error
glemieux Jun 24, 2024
28511d1
move the fraction to keep calculation earlier
glemieux Jun 24, 2024
e823830
check absolute value of buffer area to keep
glemieux Jun 24, 2024
2ec67f9
remove this check as we are now checking the new and remaining areas …
glemieux Jun 25, 2024
69e8f6a
correct whitespace
glemieux Jun 25, 2024
88ce982
Add logic to check for cases in which buffer should be inserted strai…
glemieux Jun 26, 2024
c9e7271
add sp mode check to litter initialization for bareground patches
glemieux Jun 27, 2024
bb3d58e
initialize current tag for event code logging
glemieux Jun 28, 2024
e0d46ea
Subtle syntax updates for flux diagnostics
rgknox Jul 1, 2024
3734281
Added integrated litter fluxes to diagnostics, and added harvest term…
rgknox Jul 1, 2024
c75423d
minor comment updates
rgknox Jul 1, 2024
84cc206
updated some time integrated flux terms
rgknox Jul 2, 2024
ea654d6
moved itegrated flux check later in call sequence so that termination…
rgknox Jul 3, 2024
4ae398b
Revert "initialize current tag for event code logging"
glemieux Jul 8, 2024
fd7f343
Merge pull request #1116 from ckoven/luh2_nocomp_merge
glemieux Jul 8, 2024
ea19532
Merge branch 'main' into remove_nclmax-merged
rgknox Jul 9, 2024
a2b3ead
changed ncan to nleaf
rgknox Jul 9, 2024
bcec046
fix on recruit l2fr
rgknox Jul 10, 2024
a2b71d0
make sure to define state_vector if not in land use mode
glemieux Jul 15, 2024
1982b00
Merge pull request #1223 from glemieux/landuse-v2-nanfix
glemieux Jul 17, 2024
85c6821
Merge tag 'sci.1.77.1_api.36.0.0' into remove_nclmax
glemieux Jul 19, 2024
fc20a61
Merge branch 'remove_nclmax' of github.com:rgknox/fates into remove_n…
rgknox Jul 23, 2024
dfe771c
initialize the transitions matrix to zero
glemieux Jul 23, 2024
d71c9f0
reverting nclmax to 3 for tests
rgknox Jul 24, 2024
cccfac6
More zeroing of dynamic arrays
rgknox Jul 25, 2024
e372f0b
Merge pull request #1231 from glemieux/init-trans_matrix
glemieux Jul 26, 2024
248595c
resetting nclmax to 2, since there is a bug that is preventing nclmax…
rgknox Jul 26, 2024
0897ba1
attempts to get b4b, unsuccesfull so far
rgknox Jul 30, 2024
d914891
zeroing psn_z
rgknox Jul 30, 2024
ed62e82
remove canopy closure clause
rgknox Jul 30, 2024
9b6b336
fixes to summed lai
rgknox Jul 31, 2024
8da0669
small additions to patch arrays
rgknox Jul 31, 2024
ae32bd4
Merge branch 'main' into remove_nclmax
rgknox Jul 31, 2024
639b3c2
Merge branch 'main' into xlg-grass-allometry-rgk
rgknox Aug 13, 2024
953eb7c
Added parameter checking for sapwood allometry 2 and woody pft, remov…
rgknox Aug 13, 2024
f73999b
Reverting changes to the parameter file. Those changes will be added …
rgknox Aug 13, 2024
8fe0407
Merge pull request #1 from rgknox/xlg-grass-allometry-rgk
XiulinGao Aug 14, 2024
a683a00
Merge pull request #1206 from XiulinGao/xlg-grass-allometry
rgknox Aug 14, 2024
b469786
Merge pull request #1198 from rgknox/remove_nclmax
rgknox Aug 14, 2024
9e57553
remove test_results.md
Aug 23, 2024
4b7bd88
move wind speed calculation to site loop
Aug 23, 2024
44aedff
Merge branch 'main' into fire_weather_wind
Aug 23, 2024
a497c70
fix merge conflicts
Aug 23, 2024
020013e
make suggested changes from review
Aug 23, 2024
04332a4
add new function to public statement
Aug 23, 2024
e06e0df
Merge pull request #1215 from adrifoster/fire_weather_wind
glemieux Aug 29, 2024
a235f11
first pass adding understory leaf longevity
JessicaNeedham Dec 9, 2023
8566508
add understory leaf turnover to trimming logic
JessicaNeedham Dec 18, 2023
858cd68
fix typo
JessicaNeedham Feb 13, 2024
4961637
update parameter file
JessicaNeedham Feb 13, 2024
7bfbabb
add patch files for updating param file
JessicaNeedham Feb 13, 2024
1240d32
address review comments - minor typo fixes
JessicaNeedham Jun 24, 2024
b8da4dd
update param names and valuess
JessicaNeedham Aug 12, 2024
2cb1a25
used a local variable leaf_long to reduce redundant code
rgknox Aug 12, 2024
1afa59e
update xml patch
JessicaNeedham Aug 12, 2024
595bf02
reverting parameter file default
rgknox Aug 14, 2024
8aa0aae
Adding api36.2 (or 36.1) parameter change xml file
rgknox Aug 13, 2024
ae54c1d
debugged and applied first pass of the api36.1 parameters
rgknox Aug 13, 2024
ca58099
updated naming convention of parameter changing files
rgknox Aug 14, 2024
3fcbd19
fixing record of api36.0 parameter file record parameter_files/archiv…
rgknox Aug 18, 2024
9b881e0
made new shrubPFT patch file and starting to add in new PFT
jenniferholm Jun 29, 2024
1b5e290
updating parameter batch file
jenniferholm Jul 17, 2024
6c94e74
updating parameter batch file, again
jenniferholm Aug 16, 2024
2f0b323
pftmap bug fix on xml file, made new params cdl file
jenniferholm Aug 16, 2024
068c7a1
adding back the mapping between elm/fates pft 10 & 9 respectively.
rgknox Aug 27, 2024
a43a72c
changed modparam tool to use float64
rgknox Aug 27, 2024
ba7ea1a
update arctic shrub patch file to use archived param file
glemieux Sep 26, 2024
651a732
Merge branch 'jfn-ustory-leaf-turn' into api36.1.0-merge
glemieux Oct 2, 2024
309075c
Merge branch 'new-arctic-shrubPFT' into api36.1.0-merge
glemieux Oct 2, 2024
5c405f0
rename the patch parameter xml files
glemieux Oct 2, 2024
428e8f0
rename the archived parameter file to be used for the api36.1 update
glemieux Oct 2, 2024
c5e504d
update the instructions for the API 36.1 patch files
glemieux Oct 2, 2024
41d0249
update the default parameter file
glemieux Oct 2, 2024
7c367e5
update api36.1 patch file to rename the pftnames
glemieux Oct 2, 2024
204a061
update modify parameter python script to accept changing pft names
glemieux Oct 3, 2024
646b68b
change internal file name from tmp
glemieux Oct 3, 2024
825579d
Merge pull request #1255 from glemieux/api36.1.0-merge
glemieux Oct 4, 2024
9f85668
renamed flux diagnostic
rgknox Oct 17, 2024
ebfe5a7
Add descriptive comment
rgknox Oct 17, 2024
b1255b9
added back in p and n demand diagnostics
rgknox Oct 17, 2024
b4390fe
fixed comment
rgknox Oct 17, 2024
3a8e105
merge resolution
rgknox Oct 17, 2024
28680e5
converted leaf_litter_input to surf_fine_litter_input
rgknox Oct 17, 2024
c83473d
fixed typo in history interface
rgknox Oct 18, 2024
f5bd625
Merge pull request #1217 from rgknox/history-flux-diags
rgknox Oct 18, 2024
a0dea3b
Added respiration excess to sub-daily npp tracking by holding it like…
rgknox Oct 30, 2024
f5a7caa
removing resp_g_acc
rgknox Oct 30, 2024
1d52034
removing resp_g_acc, it is unnecessary
rgknox Oct 30, 2024
366b73a
merge resolution between growth_respiration and main
rgknox Oct 30, 2024
3f688d7
various bug fixes for growth respiration update
rgknox Oct 31, 2024
a9758b3
Added hard-coded override to revert to original format for inventory …
rgknox Oct 31, 2024
50bf6b9
syntax updates and minor bug fix for respiration update
rgknox Oct 31, 2024
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Thumbs.db
*.dvi
*.toc

# Folders created with unit/functional tests
_build/
_run/


# Old Files
*~
Expand Down
90 changes: 90 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
cmake_minimum_required(VERSION 3.4)

list(APPEND CMAKE_MODULE_PATH ${CIME_CMAKE_MODULE_DIRECTORY})

FIND_PATH(NETCDFC_FOUND libnetcdf.a ${NETCDF_C_DIR}/lib)
FIND_PATH(NETCDFF_FOUND libnetcdff.a ${NETCDF_FORTRAN_DIR}/lib)
MESSAGE(" NETCDFC_FOUND = ${NETCDFC_FOUND}")
MESSAGE(" NETCDFF_FOUND = ${NETCDFF_FOUND}")

string(APPEND LDFLAGS " -L${NETCDF_FORTRAN_DIR}/lib -lnetcdff")
string(APPEND LDFLAGS " -L${NETCDF_C_DIR}/lib -lnetcdf")

include(CIME_initial_setup)

project(FATES_tests Fortran C)

include(CIME_utils)

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

# 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)

# Add FATES source directories
add_subdirectory(${HLM_ROOT}/src/fates/main fates_main)
add_subdirectory(${HLM_ROOT}/src/fates/biogeochem fates_biogeochem)
add_subdirectory(${HLM_ROOT}/src/fates/biogeophys fates_biogeophys)
add_subdirectory(${HLM_ROOT}/src/fates/parteh fates_parteh)
add_subdirectory(${HLM_ROOT}/src/fates/fire fates_fire)
add_subdirectory(${HLM_ROOT}/src/fates/radiation fates_radiation)
add_subdirectory(${HLM_ROOT}/src/fates/testing/testing_shr test_share)

# Remove shr_mpi_mod from share_sources.
# This is needed because we want to use the mock shr_mpi_mod in place of the real one
#
# TODO: this should be moved into a general-purpose function in Sourcelist_utils.
# Then this block of code could be replaced with a single call, like:
# remove_source_file(${share_sources} "shr_mpi_mod.F90")
foreach (sourcefile ${share_sources})
string(REGEX MATCH "shr_mpi_mod.F90" match_found ${sourcefile})
if(match_found)
list(REMOVE_ITEM share_sources ${sourcefile})
endif()
endforeach()

# Remove shr_cal_mod from share_sources.
#
# shr_cal_mod depends on ESMF (or the lightweight esmf wrf timemgr, at
# least). Since CTSM doesn't currently use shr_cal_mod, we're avoiding
# the extra overhead of including esmf_wrf_timemgr sources in this
# build.
#
# TODO: like above, this should be moved into a general-purpose function
# in Sourcelist_utils. Then this block of code could be replaced with a
# single call, like: remove_source_file(${share_sources}
# "shr_cal_mod.F90")
foreach (sourcefile ${share_sources})
string(REGEX MATCH "shr_cal_mod.F90" match_found ${sourcefile})
if(match_found)
list(REMOVE_ITEM share_sources ${sourcefile})
endif()
endforeach()

# Build libraries containing stuff needed for the unit tests.
# Eventually, these add_library calls should probably be distributed into the correct location, rather than being in this top-level CMakeLists.txt file.
add_library(csm_share ${share_sources})
declare_generated_dependencies(csm_share "${share_genf90_sources}")
add_library(fates ${fates_sources})
add_dependencies(fates csm_share)

# We need to look for header files here, in order to pick up shr_assert.h
include_directories(${HLM_ROOT}/share/include)

# This needs to be something we add dynamically
# via some calls using cime
set(NETCDF_C_DIR ${NETCDF_C_PATH})
set(NETCDF_FORTRAN_DIR ${NETCDF_F_PATH})

include_directories(${NETCDF_C_DIR}/include
${NETCDF_FORTRAN_DIR}/include)
link_directories(${NETCDF_C_DIR}/lib
${NETCDF_FORTRAN_DIR}/lib)

# Tell cmake to look for libraries & mod files here, because this is where we built libraries
include_directories(${CMAKE_CURRENT_BINARY_DIR})
link_directories(${CMAKE_CURRENT_BINARY_DIR})

# Add the main test directory
add_subdirectory(${HLM_ROOT}/src/fates/testing)
9 changes: 9 additions & 0 deletions biogeochem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file is required for unit testing, but is not used for production runs
list(APPEND fates_sources
FatesLitterMod.F90
FatesCohortMod.F90
FatesAllometryMod.F90
DamageMainMod.F90
FatesPatchMod.F90)

sourcelist_to_parent(fates_sources)
Loading