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

merge in master, and grass and uptake parameter changes #5

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
377 commits
Select commit Hold shift + click to select a range
d2df8ea
added other solver
rgknox Mar 8, 2024
f6037b4
Merge pull request #1169 from rgknox/solver-improvements
rgknox Mar 10, 2024
672164a
Merge branch 'main' into history-density
rgknox Mar 11, 2024
1d5e02c
adding nesterov module
Mar 12, 2024
46b26ce
use site fire weather object
Mar 12, 2024
9e863c8
bug fix
Mar 12, 2024
055fd00
change acc_ni to nesterov
Mar 13, 2024
9d27244
add unit test
Mar 13, 2024
1e1be1c
update unit test
Mar 13, 2024
214908d
Updated text and comments in history dimensioning
rgknox Mar 13, 2024
1b27b6b
Merge branch 'history-density' of github.com:rgknox/fates into histor…
rgknox Mar 13, 2024
466729b
updated comments history dimension
rgknox Mar 13, 2024
a0bd10d
Merge branch 'history-density' of github.com:rgknox/fates into histor…
rgknox Mar 13, 2024
5e39a38
Merge pull request #1119 from rgknox/history-density
rgknox Mar 13, 2024
271282d
Merge branch 'main' into cch-safemath
rgknox Mar 13, 2024
fce4287
Updated error reporting in 1d taylor solve for hydro
rgknox Mar 13, 2024
4b26a88
refactoring the daylength factor application
glemieux Mar 13, 2024
02af1cb
add check to verify that the use supplied an appropriate parameter value
glemieux Mar 13, 2024
482efe2
add code comment about daylength factor
glemieux Mar 13, 2024
c8780c6
Merge tag 'sci.1.72.2_api.34.0.0' into jfn-recruit-cflux-histvar
glemieux Mar 15, 2024
84f6904
Merge pull request #1153 from JessicaNeedham/jfn-recruit-cflux-histvar
glemieux Mar 16, 2024
13c2caa
correct minor build errors
glemieux Mar 17, 2024
1fb27eb
Merge pull request #1093 from JessicaNeedham/jfn-allometry-param-updates
glemieux Mar 18, 2024
871aabd
re-wrote LAI by patch age
rgknox Mar 19, 2024
9c8a14a
Added exposed LAI (FATES_ELAI) since FATES_LAI was changed to total L…
rgknox Mar 19, 2024
b054cd0
Merge pull request #1156 from jennykowalcz/jkowalcz-hydro-dd-restart-…
glemieux Mar 19, 2024
0633d1e
remove day length factor input to atkin subroutine
glemieux Mar 21, 2024
07dc8c1
Adding simple tool to make unstructured grids
rgknox Mar 25, 2024
8f85de8
Adding ftc protections (ie 0 flux) for perilously low wcs
rgknox Mar 25, 2024
1abba2f
hydro safemath, looking into pinning zero ftc to min psi
rgknox Mar 26, 2024
e1e9b07
merging in vert resp scaler coeffs
JessicaNeedham Feb 27, 2024
dc1d029
added leaf vertical scaling parameter coefficients in read-in and xml
rgknox Mar 26, 2024
7ab9bcc
updating api update xml files
rgknox Mar 26, 2024
e218fb3
updated parameter xml names
rgknox Mar 26, 2024
4942a17
Applied batch patch script to api34 update
rgknox Mar 26, 2024
5a752b7
add bug fix
Mar 26, 2024
48f0a81
adding daylight factor
rgknox Mar 26, 2024
7444f26
bug fix on parameter printing
rgknox Mar 26, 2024
1aef70f
merge resolution between allom mode updates and api34
rgknox Mar 26, 2024
52eda6a
add index as constant
adrifoster Mar 26, 2024
97dc27a
added carbon starvation mode
rgknox Mar 27, 2024
6573572
Merge pull request #11 from rgknox/mpaiao-pr-allom-modes-moreparams
mpaiao Mar 27, 2024
43c490d
Merge pull request #1180 from adrifoster/fire_sumfuel_bugfix
rgknox Mar 29, 2024
35b396d
added hydro code to force zero conductance a psi_min
rgknox Mar 29, 2024
57b10d3
Getting zero flux at psi_min in fates hydro
rgknox Apr 2, 2024
2ade2b1
move get_current_landuse_statevector into ed_site_type
glemieux Apr 2, 2024
833e397
covert get_current_landuse_statevector to a function
glemieux Apr 2, 2024
a269473
adjusted ordering of initializing bounds on cch functions to avoid un…
rgknox Apr 3, 2024
157df2b
condense common code into a new subroutine
glemieux Apr 4, 2024
44fc070
move CopyPatchMeansTimers around to find more common patterns
glemieux Apr 4, 2024
63045a9
remove subroutine stub
glemieux Apr 4, 2024
c19d973
remove duplicate tveg_longterm update that has been condensed
glemieux Apr 4, 2024
3a2b877
Merge tag 'sci.1.72.6_api.34.0.0' into cch-safemath-zeroflux
rgknox Apr 5, 2024
9402839
Revision of some error message output for inventory initialisation, s…
mpaiao Apr 8, 2024
2a5b19f
fixing typos and minor formatting
glemieux Apr 11, 2024
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
90350db
Merge tag 'sci.1.72.6_api.34.0.0' into mpaiao-pr-allom-modes
glemieux Apr 11, 2024
cf05475
Added btran to hydro restart, and protecting downscaling rhiz layer f…
rgknox 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
3621cb0
implement Ryan's fix for the sp mode indexing issue #1182
glemieux 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
5284bd0
Merge pull request #1189 from glemieux/spmode-restart-indexing-hotfix
glemieux Apr 22, 2024
0827f05
Merge tag 'sci.1.72.7_api.34.0.0' into mpaiao-pr-allom-modes
glemieux Apr 22, 2024
adfa664
Merge pull request #1128 from mpaiao/mpaiao-pr-allom-modes
glemieux Apr 23, 2024
62d8004
Removed redundant history variables, updated some text to explain uni…
rgknox Apr 23, 2024
397dbe7
fix to crown area normalized height diagnostic
rgknox Apr 23, 2024
0e98671
fix need to call 2 separate registervar subroutines
Apr 23, 2024
95b6a43
resolving conflicts between vertical scaling PR and main (allometric …
rgknox Apr 23, 2024
b25df0e
clean up
Apr 23, 2024
c611b0d
syntax style updates
rgknox Apr 23, 2024
ad20bfd
update long name of vertical resp scaling to inform proportionality w…
rgknox Apr 23, 2024
f4ef11b
adding in ncalers and unifying vert scaler code
rgknox Apr 23, 2024
b1329af
fix location of module and parameter name
rgknox Apr 23, 2024
c00d711
merged up parameter file in main to vert scaler branch
rgknox Apr 23, 2024
b105d56
PascalCase
ckoven Apr 23, 2024
34dcc5f
shortening line lengths
ckoven Apr 24, 2024
2fb1a88
Merge pull request #4 from rgknox/jfn-leafmr-vert-scaling
JessicaNeedham Apr 25, 2024
04afb12
Merge pull request #1149 from JessicaNeedham/jfn-leafmr-vert-scaling
rgknox Apr 26, 2024
668fabd
trivial merge resolution
rgknox Apr 26, 2024
a9b5230
reverting to parameter file from main, because daylength factor switc…
rgknox Apr 26, 2024
6c85a1b
Merge pull request #1161 from jenniferholm/calibration_dayl-factor-sw…
rgknox Apr 26, 2024
a1c989d
Merge pull request #1166 from ckoven/fire_bugfix
rgknox Apr 26, 2024
cc34d1b
removed unnecessary zeroing in site-level history output
rgknox Apr 27, 2024
25fb73a
Updated some comments in low water potential protections
rgknox Apr 29, 2024
a5d9fd9
update to comments in hydro flux disaggregation code
rgknox Apr 29, 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
bd75295
Merge pull request #1174 from rgknox/lai_ap_fixes
rgknox 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
ec27207
disaggregating fluxes based on root length only when sumweights is ze…
rgknox May 1, 2024
5d5d205
migrating unit testing to folder unit_testing
rgknox May 1, 2024
e262198
Merge pull request #1164 from rgknox/cch-safemath
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
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
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
b8e4eee
Merge pull request #1208 from rgknox/history-zerofixes
glemieux Jun 11, 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
3c05ecf
Merge tag 'sci.1.76.4_api.35.1.0' into luh2_nocomp_merge
Jun 17, 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
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
d8f383f
Adding api36.2 (or 36.1) parameter change xml file
rgknox Aug 13, 2024
8fb5f4f
debugged and applied first pass of the api36.1 parameters
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
8f404b9
Merge branch 'main' into jfn-ustory-leaf-turn
rgknox Aug 14, 2024
3cab776
reverting parameter file default
rgknox Aug 14, 2024
d8b8f7a
Merge branch 'param_updates_api36.1' into jfn-ustory-leaf-turn
rgknox Aug 14, 2024
a60b108
updated naming convention of parameter changing files
rgknox Aug 14, 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