wwieder / biogeochem_testbed Goto Github PK
View Code? Open in Web Editor NEWSoil biogeochemical testbed
Soil biogeochemical testbed
create variables for hard coded CUE in CASA parameter file. This is already being done in MIMICS
SUBROUTINE mimics_coeffplant:
ratioLignintoN(:,leaf) = (casapool%Cplant(:,leaf) &
/(max(1.0e-10,casapool%Nplant(:,leaf)) *casabiome%ftransNPtoL(veg%iveg(:),leaf))) &
* casabiome%fracLigninplant(veg%iveg(:),leaf)
ratioLignintoN(:,froot)= (casapool%Cplant(:,froot)&
/(max(1.0e-10,casapool%Nplant(:,froot))*casabiome%ftransNPtoL(veg%iveg(:),froot))) &
* casabiome%fracLigninplant(veg%iveg(:),froot)
Hi @melanniehartman I was hoping to try spinning up MIMICS-CN with new parameters, but couldn't get the source code to compile. Not sure if it's because of the compilers now available on CGD machines or something else?
https://github.com/wwieder/biogeochem_testbed_1.1/blob/1e3e2d581ab8ccb97ffa19e87b0e286888933057/SOURCE_CODE/README.txt#L1
The error I'm getting is below:
corpse_variable.o corpse_soil_carbon.o corpse_inout.o corpse_cycle.o -L/usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib -lnetcdff -lm
/usr/bin/ld: warning: libgfortran.so.5, needed by /usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so, not found (try using -rpath or -rpath-link)
/usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to _gfortran_reshape_4@GFORTRAN_8' /usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to
_gfortran_runtime_error_at@GFORTRAN_8'
/usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to _gfortran_shape_4@GFORTRAN_8' /usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to
_gfortran_reshape_8@GFORTRAN_8'
/usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to _gfortran_os_error@GFORTRAN_8' /usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to
_gfortran_string_scan@GFORTRAN_8'
/usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to _gfortran_size0@GFORTRAN_8' /usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to
_gfortran_string_len_trim@GFORTRAN_8'
/usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to _gfortran_internal_unpack@GFORTRAN_8' /usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to
_gfortran_internal_pack@GFORTRAN_8'
/usr/local/netcdf-c-4.6.1-f-4.4.4-gcc-g++-gfortran-8.1.0/lib/libnetcdff.so: undefined reference to `_gfortran_concat_string@GFORTRAN_8'
collect2: error: ld returned 1 exit status
make: *** [casaclm_mimics-cn_corpse] Error 1
Add parameter fWmin, the minimum soil moisture effect on decomposition, to the CORPSE parameter file. Save CORPSE fW function (soil moisture effect on soil decomposition) to the output file.
Writing out root respiration fluxes calculated by CASA would aid in comparisons with soil respiration database
Work that Kat's done suggests the protected pools in MIMICS are too small, both in absolute amounts of SOMp and the fraction of total C that's physically protected (MAOM / SOMp). This may be especially true in the Arctic.
Towards this end, I've tried:
Increasing the fraction of microbial turnover that is physically protected (MIC -> SOMp)
Increasing decomposition rates, especially in colder systems.
Kint
and increasing the slope Kslope
of the temperature function used, new parameterizations is in blue.Increasing decomposition rates, especially in colder systems.
Vint
and decreasing Vslope
to give higher decomp rates in colder systems.Adding a temperature sensitivity to the desorption rate controlling the transfer of SOMp -> SOMa, see #46.
How do we keep track of sources of restart and history files (e.g. different code bases and forcing data)?
I'm not sure why, but the CN model has much lower microbial biomass turnover rates, which leads to larger MIC pools and smaller SOM stocks, compared to the C-only version of the model, even when using the same parameter file.
Below are to plots of MICr pool sizes for the CN and C-only model (left and right respectively).
Case directories are:
/project/tss/wwieder/biogeochem_testbed_1.1/GRID_CN/MIMICS_mod3_borealNfix_GSWP3
&
/project/tss/wwieder/biogeochem_testbed_1.1/GRID_CN/MIMICS_GSWP3_Conly
On initialization it may be helpful to echo parameter values are they are read in *_inout.f90 (subroutine casa_readbiome)
On initialization it may be helpful to echo restart file contents (subroutine casa_init)
Read the number of years in the met.nc file to determine the number of timesteps needed in the CORPSE output file data structures. Previously the allocation to these output data structures assumed a max number of 7 years. This was an OK assumption when running a 2-degree grid because the size of met.nc files could not exceed 2GB, which was 5-7 years, depending on the number of variables strored in the met.nc files. Seven is not a sufficient number of years for the point weather input files that may contain many more than 7 years wihout exceeding the maximum netcdf file size.
CASA has several functionality issues to solve in casa_cnp.f90:
fraction of water filled pore space (fwps) could be above 1, should be capped at one.
Calculation of metabolic litter slightly different from MIMICS, consider revising. This is also used in CORPSE?!
Remove NPP and LAI reads from forcing (met.nc) files, as they aren't actually used in the code (casa_inout.f90)
Making CORPSE a single layer, like CASA and MIMICS because currently there is no mechanism for leaf litter to move belowground (advection or diffusion), resulting in LARGE litter layer simulated at high latitudes, with no protection mechanisms (corpse_cycle.f90).
Ideally could have name list option at run time where users can either add leaf and root litter to
NPPan is calculated as GPP/2, and used to modify tau in MIMICS.
Should this be updated with the CASAflux%Cnpp that is being calculated?
Need an easier way to compare C & N pools and fluxes between multiple SOM models.
I've been digging some into the stoichiometry differences in CASA and MIMICS and was surprised to see how different the litterfall C:N fluxes are.
These are calculated for MIMICS by summing the following fluxes
MIM_cnLIT = (ds_1.cLitInput_metb + ds_1.cLitInput_struc) / (ds_1.nLitInput_metb + ds_1.nLitInput_struc)
Similarly, in CASA, these are the sum of
CAS_cnLIT = (ds.cLitInptMet + ds.cLitInptStruc) / (ds.nLitInptMet + ds.nLitInptStruc)
Why is the litterfall C:N so much higher for MIMICS?
It seems like CWD fluxes are being included in both fluxes
It's not obvious that the vegetation looks very different (below).
Units for activation energy incorrect in documentation and parameter file. Should be ~30 kJ/mol, (currently ~30e3 kJ/mol).
can we write out these overflow respiration fluxes, separately for MICr and MICK?
On 5/14/2018 Gordon Bonan discovered an error in the xcoldleaf calculation is subroutine casa_xrateplant. The calculation was missing a set of parentheses:
!xcoldleaf(npt) = (casamet%tairk(npt)-phen%TKshed(veg%iveg(npt))-5.0)/5.0
xcoldleaf(npt) = (casamet%tairk(npt)-(phen%TKshed(veg%iveg(npt))-5.0))/5.0
The subroutine WritePointMIMICS was created and added to mimics_inout.f90 to write daily output from MIMICS point simulations to a .csv file. Some output code formerly in mimics_cycle.f90, was moved to this subroutine.
SUBROUTINE mimics_soil_reverseMM_CN:
! Multiply ClitInput by NHOURSfrac = 1/NHOURSf
mimicsbiome%tauR(npt) = (1.7*mimicsbiome%tauR(npt))**2.0*0.55/(0.45*mimicsflux%ClitInput(npt,metbc)*NHOURSfrac)
mimicsbiome%tauK(npt) = (1.7*mimicsbiome%tauK(npt))**2.0*0.55/(0.45*mimicsflux%ClitInput(npt,struc)*NHOURSfrac)
Add root exudate flux as fraction of fine root NPP. This is to explore how changes in below ground allocation may modify labile C availability in the models. We'll have to figure out how to consider the C:N of this flux.
Make sure the water scalar (fW) in CORPSE uses frozen soil water in it's calculation, currently only reading in liquid soil water?
This touches several modules:
corpse_cycle.f90
corpse_soil_carbon.f90
corpse_variable.f90
New CL5 surface datasets use PCT_NAT_PFT
, not PCT_PFT
related to #36, maybe the switch can be something like use_clm5
for the inputs used for names of pft and ndep frequency
For single point runs we'll need to create .met files as testbed inputs that have daily
GPP, air temperature, soil temperature, soil moisture (liquid and ice fractions).
We suspect few sites are likely to have all of this information, maybe it makes sense to generate the testbed forcing with DAYCENT output (@melanniehartman), which can be validated with observations of GPP / NPP where it's available.
For all models it may be helpful to look at environmental scalars being calculated f(W) or f(T) and long with soil temperature, liquid soil moisture, and frozen soil moisture.
casa_inout.f90
corpse_inout.f90
mimics_inout.f90
On 5/14/2018 Gordon Bonan discovered an error in the xcoldleaf calculation is subroutine casa_xrateplant. The calculation was missing a set of parentheses:
!xcoldleaf(npt) = (casamet%tairk(npt)-phen%TKshed(veg%iveg(npt))-5.0)/5.0
xcoldleaf(npt) = (casamet%tairk(npt)-(phen%TKshed(veg%iveg(npt))-5.0))/5.0
Turnover times in CORPSE show strong sensitivity to temperature- especially in cold domain, but also with low C stocks in tropics.
Potentially set min value of water scalar (fW) calculated in corpse_cycle.f90 to value similar to MIMICS?
Write out theta_liq, theta_frzn, fW and fT from CORPSE as diagnostics? (corpse_inout.f90)
Testbed_initial_turnover (dragged).pdf
The Lignin:N ratio that is used to calculate fraction of litter that is metabolic (fmet) when MIMICS is the SOM model is based on a fixed C:N ratio of plant litter (which was OK for the C-only runs); for the runs with C&N, this Lignin:N ratio should be dynamic.
because microbes in MIMCIS have access to fraction of DIN pool, leaching losses are much lower with MIMICS. Leaching should be a function of the total soil DIN pool, not the MIMICS microbial available DIN pool
Soil moisture effects on soil C turnover absent from MIMICS code. Numerous ways forward, could explore using similar functions to CASA or CORPSE (the later would have to be scaled between 0-1).
Davidson and others suggest that moisture should influence substrate concentration in their DAMM model, but in a reverse M-M model, this only shows up in the numerator of the equation. Therefore, a scalar modifying any part of this equation (Vmax * substrate * biomass) could be appropriate? Maybe simplest to apply to temperature sensitive Vmax calculation (mimics_cycle.f90)?
@piersond found a better parameterization for tauMod at Reynolds Creek with the following function SQRT(ANPP)/tauModDenom
.
This is something we can consider trying in global parameterizations?
Modify xknlimiting min and max parameterization for N limitation in CASA pft parameter file. This will allow for similar N limitation of vegetation, even when soil models have different inorganic N availability
I've been trying to look at changes in global C pools and fluxes with the testbed and can't seem to get the numbers to line up. I wonder if you'd have time to look through my math (or check the same calculations with scripts you may have).
The few high level issues are
After spinup NEP doesn't equal zero in MIMICS, you can see this in the cell 8 of the CheckSpinup notebook. When I add cresp from the casa files I get NEP ~ 0 for the spinup simulations, but then the HR fluxes are too high in the transient runs. This made me wonder how CO2 fluxes from CWD decomposition are being handled?
Cumulative NEP changes don't equal changes in total ecosystem C. see cell 18 of MIMICScn_hist.
Soil C stocks really drop in the first year or two of the simulation. This maybe isn't too big of an issue, but I wonder why this is happening?
All of these use utilities here
notebooks can be see here
https://github.com/wwieder/biogeochem_testbed_1.1/tree/Testbed_CN/analysis_code
Updates needed to netCDF tools to build and process new forcing datasets (e.g., CLM5 with GSWP3 forcing).
As I mentioned in our meeting April 13:
Above the figure on page 8 in the documentation it says that MIMICS does not consider moisture effect on decomposition, while moisture effects is described in section 3.4.7.
Just removing the sentence on page 8 would solve this inconsistency.
It seems like the protection_rate (Qmax) in CORPSE is being written and read off the restart files and overwriting values on the parameter files. Maybe this is related to issue #2
Correct in corpse_inout.f90
The first implementation of MIMICS-cn uses fixed stoichoimetry for MICr and MICK (6 & 10, respectively), resulting in a weak / absent latitudinal gradient that is inconsistent with observations from Xu et al. 2013.
Alternative strategies would be to have microbial C:N be a function of litter quality (see Liu et al. 2019, inorganic N availability (as in C:N pools w/in DAYCENT), or others?
New CLM5 forcings include updated monthly NDEP from CESM2-WACCM simulations.
The met.nc files for the testbed require daily Ndep.
Previous (CLM4.5, CESM1) took annual Ndep from the CLM files and divided by 365 and wrote that amount out daily.
See line 1355 in casacnp_model.F90. With monthly values you would have to divy out the Ndep differently.
The subroutine that reads in the Ndep file is in clm_netcdf_tools.F90.
I wondered why the CO2 flux from soil decomposition
https://github.com/wwieder/biogeochem_testbed_1.1/blob/630389decceaac88d7ab8e09339daa75f960ba32/SOURCE_CODE/casa_cnp.f90#L824
is handled differently than for litter decomposition
https://github.com/wwieder/biogeochem_testbed_1.1/blob/630389decceaac88d7ab8e09339daa75f960ba32/SOURCE_CODE/casa_cnp.f90#L816
The desorption of SOMp to SOMa in MIMICS is defined as function of soil texture,
https://github.com/wwieder/biogeochem_testbed_1.1/blob/9988b1b70266f8aafd9877c55e656e52fc77798d/SOURCE_CODE/mimics_inout_CN.f90#L387
see also https://github.com/wwieder/biogeochem_testbed_1.1/blob/9988b1b70266f8aafd9877c55e656e52fc77798d/SOURCE_CODE/mimics_cycle_CN.f90#L888
This function should also depend on temperature (and eventually pH).
On air dried soils Kaiser et al. 2001 Geoderma doi:10.1016/S0016-7061(00)00077-X report increases in DOC released with temperature (intercept b
in isotherms), corresponding to a Q10 of 1.1-1.6 for hydrophopic and hydrophilic DOC, respectively.
This is more broadly consistent with the onion model proposed by Kleber et al 2007 Biogeochemistry DOI: 10.1007/s10533-007-9103-5
Thus, let's add a line below this function
https://github.com/wwieder/biogeochem_testbed_1.1/blob/9988b1b70266f8aafd9877c55e656e52fc77798d/SOURCE_CODE/mimics_inout_CN.f90#L387
mimicsbiome%desorb(npt) = mimicsbiome%desorb(npt) *Q10_desorb
^((SoilTemperature-25
)/10)
Q10_desorb
should also be on the parameter file, but for now I'll just use 1.5
Alternatively, we could wrap Q10_desorb
into fSOM_p(3)
This also assumes soil temperatures are in C and uses 25 C as a reference temperature.
Down the road this should likely be a proper sorption isotherm with bi-direction exchange between SOMc and SOMa, but this is a good start...
CASACNP pool initilization/restart files (for example, cnppool_init_.csv cnppool_end_.csv) must have a header with column names!
Subroutine casa_init(), that reads the initialization/restart file, assumes there is a column header line and was updated to skip past the first line in the file. Subroutine write_cnpepool_header() was created and added to casa_inout.f90 to write a column header line to .csv restart files. Subroutine write_cnpflux_header() was created and added to casa_inout.f90 to write a column header line .csv output flux files (for example cnpflux_end_*.csv). The .csv flux output files are indeed output only.
Preliminary results suggest total C:N doesn't show enough spatial / latitudinal variability in MIMICS-CN.
@melanniehartman and Emily Kyker-Snowman suggested just increasing FI(struc)
from 0.1 to 0.3 to evaluate the model sensitivity to this parameter change.
SOMc
pool (and decreasing LITs
).
SOMc
, but most of the tropical SOM in in the SOMp
pools, resulting in modest changes in tropical total C:N.LITs
, we're also driving a shift in microbial community composition, with a higher relative fraction of MICr
in the new simulationsNOTE the new simulation (FI = 0.3, blue lines) are not yet spun up completely and results are subject to change.
Here's the breakdown of individual pools sizes by latitude for each simulation
How are we doing single point simulations?! let's work on the documentation (and tools) needed to generate input files for for single point simulations.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.