GithubHelp home page GithubHelp logo

biogeochem_testbed's People

Contributors

melanniehartman avatar wwieder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

biogeochem_testbed's Issues

Size allocated to CORPSE output structure depends on size of met.nc file.

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.

Column header line added to CASACNP pool initialization/restart files.

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.

NPPan

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?

Dynamic Lignin:N ratios out of range when Cplant >> Nplant

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)

Documentation: soil moisture in MIMICS

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.

Point-level output .csv files

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

Protection in CORPSE

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

root exudates

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.

microbial turnover w/ CN model?

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).
image

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

Single layer CORPSE

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

  1. common (belowground) litter pools
  2. separate above and below ground pools

NEP does not equal change in total ecosystem C

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

  1. 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?

  2. Cumulative NEP changes don't equal changes in total ecosystem C. see cell 18 of MIMICScn_hist.

  3. 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

  • Note, sometimes it takes refreshing for the notebooks to render.

Variable microbial stoichiometry

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?

Ea units in CORPSE

Units for activation energy incorrect in documentation and parameter file. Should be ~30 kJ/mol, (currently ~30e3 kJ/mol).

modify xknlimiting

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

Updates to CORPSE fW calculation

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.

new surface dataset don't have `PCT_PFT`

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

MIMICS needs water

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

Echo parameters at initialization

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)

Low protected SOM pools

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:

  1. Increasing the fraction of microbial turnover that is physically protected (MIC -> SOMp)

    • Especially in low clay soils by increasing the intercept and decreasing the slope for fPHYS_r and fPHYS_k. New parameterizations is in blue.
      image
    • This increases SOMp pools globally, but mostly in the tropics where we may already have a high bias in total SOC stocls
  2. Increasing decomposition rates, especially in colder systems.

    • This was motivated by the very large LIT stocks that were accumulating in high latitudes (4-5x the size of SOMp pools), suggesting that decomposition rates are too slow. (See also lower than observed microbial biomass at high latitudes.)
    • This was done by decreasing Km in the model, specifically decreasing the intercept Kint and increasing the slope Kslope of the temperature function used, new parameterizations is in blue.
      image
    • This may need further modification, or focus on Vmax instead?
  3. Increasing decomposition rates, especially in colder systems.

    • changes to Km resulted in pretty modest changes, so I modified Vmax parameterization too, increasing Vint and decreasing Vslope to give higher decomp rates in colder systems.
  4. Adding a temperature sensitivity to the desorption rate controlling the transfer of SOMp -> SOMa, see #46.

    • Previously this was simply a function of soil clay content.
    • The new function adds a Q10 of 1.3 to this flux with a reference temperature of 25 C.
    • The plot below shows desorption rates for a soil with 30% clay as a function of temperature for the orig. parameteriztion (black) and the new one (blue)
      image
    • The q10 of this flux may need to be decreased, as the change in the flux is pretty large!
    • It will be interesting to see how this changes the temperature sensitivity of the model and seasonal cycle of CO2 fluxes.

CORPSE too temperature sensitive?

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?

  • Note absolute values of fW in CORPSE and MIMICS are very different, 0.05 in MIMICS is ~ 0.0001 in CORPSE

Write out theta_liq, theta_frzn, fW and fT from CORPSE as diagnostics? (corpse_inout.f90)
Testbed_initial_turnover (dragged).pdf

Modify desorption parameterization

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...

CASA calculations and output

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)

code won't compile

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

Write out root respiration

Writing out root respiration fluxes calculated by CASA would aid in comparisons with soil respiration database

Write MIMICS point output to .csv file

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.

update to netcdfTools for monthly ndep inputs

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.

CASACNP leaf death rates due to cold

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

litterfall stoichiometric differences

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

image

Here a maps of the same data
image

Create .met files from site observations

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.

Write out environmental scalars

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

Single point documentation

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.

Soil C:N

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.

  • As expected, this increased soil C:N by increasing C stocks the SOMc pool (and decreasing LITs).
    • Mean C:N = 13 [range 6-31] when FI=0.3 vs.
    • Mean CN = 11 [range 6-18] when FI = 0.1
  • Results in boreal forests look promising, but changes in the tropics are not as convincing.
  • Moreover, increases in tropical SOC stocks are w/in reality, but maybe shouldn't keep increasing?
  • I'm assuming that increases in total C:N are driven by increases in SOMc, but most of the tropical SOM in in the SOMp pools, resulting in modest changes in tropical total C:N.
  • The other interesting bit, is that by decreasing LITs, we're also driving a shift in microbial community composition, with a higher relative fraction of MICr in the new simulations

NOTE the new simulation (FI = 0.3, blue lines) are not yet spun up completely and results are subject to change.
image

Here's the breakdown of individual pools sizes by latitude for each simulation
image

Dynamic Lignin:N ratio for fmet calculation

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.

Water scalar in CORPSE

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.